org.olat.instantMessaging
Interface InstantMessaging

All Known Implementing Classes:
SmackInstantMessagingImpl

public interface InstantMessaging

Initial Date: 18.01.2005

Author:
guido
Interface Instant Messaging interface for public accessible functions used in the framework outside the package


Method Summary
 boolean addUserToFriendsRoster(java.lang.String groupOwnerUsername, java.lang.String groupId, java.lang.String groupname, java.lang.String addedUsername)
           
 java.lang.String checkServerPlugin()
          check wheter the server plugin is running and the correct version is
 int countConnectedUsers()
           
 boolean createAccount(java.lang.String username, java.lang.String password, java.lang.String fullname, java.lang.String email)
          creates an account on the instant messaging server
 java.lang.String createChatRoomJID(OLATResourceable ores)
           
 java.lang.String createChatRoomString(OLATResourceable ores)
           
 Controller createClientController(UserRequest ureq, WindowControl wControl)
          This method should only be called once as it creates the main controller and the groupchat controller for a single user
 boolean deleteAccount(java.lang.String username)
          delete an account on the im server
 boolean deleteRosterGroup(java.lang.String groupId)
          Delete roster group from instant messaging server
 void disableChat(java.lang.String username, java.lang.String reason)
          disable the chat and groupchat possibilities
 void enableChat(java.lang.String username)
          enable the chat and groupchat possibilities
 java.util.List<ConnectedUsersListEntry> getAllConnectedUsers(Identity currentUser)
           
 ClientManager getClientManager()
          with the client manager you have access to the IM client for sending messages/presence information
 java.util.Map<java.lang.String,InstantMessagingClient> getClients()
           
 IMConfig getConfig()
          provides access to the IM settings like admin user/password and servername...
 GroupChatManagerController getGroupChatManagerController(UserRequest ureq)
          get the controller for creating and managing groupChats
 java.lang.String getIMPassword(java.lang.String username)
           
 java.lang.String getIMUsername(java.lang.String name)
           
 IMNameHelper getNameHelper()
           
 java.lang.String getUserJid(java.lang.String username)
           
 java.lang.String getUsernameFromJid(java.lang.String from)
           
 java.util.Set<java.lang.String> getUsernamesFromConnectedUsers()
           
 boolean hasAccount(java.lang.String username)
          check whether accounts exists on IM server
 boolean removeUserFromFriendsRoster(java.lang.String groupId, java.lang.String username)
           
 boolean renameRosterGroup(java.lang.String groupId, java.lang.String displayName)
          rename roster group on instant messaging server
 void resetAdminConnection()
          reset and reconnect the admin connection to the IM server.
 void sendStatus(java.lang.String username, java.lang.String message)
          send the message to: all members of the VisibilityGroup where 'username' is member.
 void setNameHelper(IMNameHelper nameHelper)
           
 boolean synchonizeBuddyRoster(BusinessGroup group)
          called when OLAT server is started and needs to sync the buddygroups with the IM server.
 boolean synchronizeAllBuddyGroupsWithIMServer()
          called when OLAT server is started and needs to sync the buddygroups with the IM server.
 boolean synchronizeLearningGroupsWithIMServer()
          called when OLAT server is started and needs to sync the learinggroups with the IM server.
 

Method Detail

synchronizeAllBuddyGroupsWithIMServer

boolean synchronizeAllBuddyGroupsWithIMServer()
called when OLAT server is started and needs to sync the buddygroups with the IM server.

Returns:
true upon success

synchronizeLearningGroupsWithIMServer

boolean synchronizeLearningGroupsWithIMServer()
called when OLAT server is started and needs to sync the learinggroups with the IM server.


synchonizeBuddyRoster

boolean synchonizeBuddyRoster(BusinessGroup group)
called when OLAT server is started and needs to sync the buddygroups with the IM server.

Parameters:
group -

createClientController

Controller createClientController(UserRequest ureq,
                                  WindowControl wControl)
This method should only be called once as it creates the main controller and the groupchat controller for a single user

Parameters:
ureq -
wControl -
Returns:
a controller that represents that status changer and the buddy list

createChatRoomString

java.lang.String createChatRoomString(OLATResourceable ores)
Parameters:
ores -
Returns:
a String like BusinessGroup-123456

createChatRoomJID

java.lang.String createChatRoomJID(OLATResourceable ores)
Parameters:
ores -
Returns:
a Jabber ID like grouid@conference.jabber.olat.uzh.ch

getGroupChatManagerController

GroupChatManagerController getGroupChatManagerController(UserRequest ureq)
get the controller for creating and managing groupChats

Returns:

addUserToFriendsRoster

boolean addUserToFriendsRoster(java.lang.String groupOwnerUsername,
                               java.lang.String groupId,
                               java.lang.String groupname,
                               java.lang.String addedUsername)
Parameters:
groupOwnerUsername -
groupId -
groupname -
addedUsername -

removeUserFromFriendsRoster

boolean removeUserFromFriendsRoster(java.lang.String groupId,
                                    java.lang.String username)
Parameters:
groupId -
username - an OLAT unique username

deleteRosterGroup

boolean deleteRosterGroup(java.lang.String groupId)
Delete roster group from instant messaging server

Parameters:
groupId -

renameRosterGroup

boolean renameRosterGroup(java.lang.String groupId,
                          java.lang.String displayName)
rename roster group on instant messaging server

Parameters:
groupId -
displayName -

sendStatus

void sendStatus(java.lang.String username,
                java.lang.String message)
send the message to: all members of the VisibilityGroup where 'username' is member.

Parameters:
username - an OLAT unique username
message -

getIMPassword

java.lang.String getIMPassword(java.lang.String username)
Parameters:
username -
Returns:
the instant messaging password (differs form the olat password)

getClients

java.util.Map<java.lang.String,InstantMessagingClient> getClients()
Returns:
Map with client Objects (InstantMessagingClient)

getUsernamesFromConnectedUsers

java.util.Set<java.lang.String> getUsernamesFromConnectedUsers()
Returns:
a Set with the users connected to the IM server

enableChat

void enableChat(java.lang.String username)
enable the chat and groupchat possibilities

Parameters:
username -

disableChat

void disableChat(java.lang.String username,
                 java.lang.String reason)
disable the chat and groupchat possibilities

Parameters:
username -
reason - A reason why the user is not able to chat.

countConnectedUsers

int countConnectedUsers()
Returns:
number of connected instant messaging users

getAllConnectedUsers

java.util.List<ConnectedUsersListEntry> getAllConnectedUsers(Identity currentUser)
Returns:
a list with information for each user which is connected to the instant messaging server either locally or clusterwide

createAccount

boolean createAccount(java.lang.String username,
                      java.lang.String password,
                      java.lang.String fullname,
                      java.lang.String email)
creates an account on the instant messaging server

Parameters:
username -
password -
firstname -
lastname -
email -
Returns:
true if successful

deleteAccount

boolean deleteAccount(java.lang.String username)
delete an account on the im server

Parameters:
username -

getClientManager

ClientManager getClientManager()
with the client manager you have access to the IM client for sending messages/presence information

Returns:

getConfig

IMConfig getConfig()
provides access to the IM settings like admin user/password and servername...

Returns:

hasAccount

boolean hasAccount(java.lang.String username)
check whether accounts exists on IM server

Parameters:
username -
Returns:

getUserJid

java.lang.String getUserJid(java.lang.String username)
Parameters:
username -
Returns:
a jabber id like admin@jabber.olat.uzh.ch

getUsernameFromJid

java.lang.String getUsernameFromJid(java.lang.String from)
Parameters:
from -
Returns:
only the username part from a jid

getIMUsername

java.lang.String getIMUsername(java.lang.String name)
Parameters:
name -
Returns:
the username which is save for the IM server and may contains an instance id if IM server is used in a multi domain setup

setNameHelper

void setNameHelper(IMNameHelper nameHelper)
Parameters:
nameHelper -

getNameHelper

IMNameHelper getNameHelper()
Returns:
the IMNameHelper for building multipleinstance-save user/group-names

resetAdminConnection

void resetAdminConnection()
reset and reconnect the admin connection to the IM server. Upon failures the admin connection reconnects automatically but not on resource conflicts and manual connection close.


checkServerPlugin

java.lang.String checkServerPlugin()
check wheter the server plugin is running and the correct version is

Returns:
string with information about the plugin.