org.olat.instantMessaging
Class IMNameHelper

java.lang.Object
  extended by org.olat.instantMessaging.IMNameHelper

public class IMNameHelper
extends java.lang.Object

Description:
Helps to get the right user-/groupname for chat Used to have multiple OLAT instances running on one single jabber server. Can be turned off in olat.properties with instantMessaging.multipleInstances=false

Initial Date: 31.03.2008

Author:
Roman Haag, roman.haag@frentix.com, guido

Constructor Summary
IMNameHelper(IMConfig config, java.lang.String instanceID)
          [used by spring]
 
Method Summary
 java.lang.String extractOlatUsername(java.lang.String imUsername)
          Get olatUsername from imUsername/JID
 java.lang.String getGroupnameForOlatInstance(java.lang.String groupId)
          convert groupId (name) to be usable with multiple OLAT-instances
 java.lang.String getIMUsernameByOlatUsername(java.lang.String olatUsername)
          convert olatUsername to imUsername the instanceID is attached to the olatUsername to distinguish between multiple OLAT instances using all the same IM-server
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IMNameHelper

public IMNameHelper(IMConfig config,
                    java.lang.String instanceID)
[used by spring]

Parameters:
config -
Method Detail

getIMUsernameByOlatUsername

public java.lang.String getIMUsernameByOlatUsername(java.lang.String olatUsername)
convert olatUsername to imUsername the instanceID is attached to the olatUsername to distinguish between multiple OLAT instances using all the same IM-server

Parameters:
olatUsername - (i.e: administrator, author) may contain @
Returns:
im-Username/JID (i.e. administrator_OLATinstanceID )

extractOlatUsername

public java.lang.String extractOlatUsername(java.lang.String imUsername)
Get olatUsername from imUsername/JID

Parameters:
imUsername - (i.e. administrator_OLATinstanceID@jabber.olat.org )
Returns:
olatUsername (i.e: administrator, author) may contain @

getGroupnameForOlatInstance

public java.lang.String getGroupnameForOlatInstance(java.lang.String groupId)
convert groupId (name) to be usable with multiple OLAT-instances

Parameters:
groupId - (i.e: BusinessGroup-12345)
Returns:
groupId with attached instance-id (i.e: BusinessGroup-12345-OLATinstanceID )