public class IMSessionHandler extends java.lang.Object implements IMUserStatusListener, javax.servlet.http.HttpSessionBindingListener, MXSessionListener
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
IM_SERVER_HOST_MX_PROPERTY |
static java.lang.String |
MESSAGE_GROUP
This is the Message Group used for all messages related to TSD IM
integration.
|
Modifier and Type | Method and Description |
---|---|
void |
changeUserStatus(IMUser.IMUserStatus imUserStatus) |
void |
chatClosed(java.lang.String sessionId) |
boolean |
closeIMSession(boolean saveFlag,
javax.servlet.http.HttpServletRequest request) |
boolean |
closeIMSession(boolean saveFlag,
WebClientSession webClientSession)
Close IM session related to this IMSessionHandler.
|
ChatHelper |
getChatHelper(javax.servlet.http.HttpServletRequest httpRequest,
java.lang.String sessionId,
long chatIdentifier,
java.lang.String partnerIMId) |
java.lang.String |
getIMConnectionTimeout()
Get IM server connection timeout
|
java.lang.String |
getImDriverName() |
java.lang.String |
getIMServerHostname()
Get IM server hostname
|
static IMSessionHandler |
getIMSessionHandler(javax.servlet.http.HttpSession httpSession)
IMSessionHandler factory.
|
PartnerInfo |
getPartnerInfo(javax.servlet.http.HttpServletRequest httpRequest)
Get specific information about the target person to chat with which
includes the person's IM ID
|
static UserInfo |
getUserInfo(javax.servlet.http.HttpSession httpSession)
Get session specific information about the currently logged in maximo
user include the cross references IM ID and IM password
|
IMUser.IMUserStatus |
getUserStatus(java.lang.String userIdOrEmail)
Returns the user status based on his/her id or email
|
static boolean |
hasIMSessionHandler(javax.servlet.http.HttpSession session)
Returns true only if there is already a IMSessionHandler created for the
current HttpSession
|
boolean |
isIMSessionOpened()
Returns true only if the IMSession related to this IMSessionHandler is
opened.
|
boolean |
isPartnerChatting(java.lang.String partnerIMId) |
boolean |
isUserAvailable(java.lang.String userId) |
static void |
logDebug(java.lang.String logMessage) |
static void |
logError(java.lang.String logMessage,
java.lang.Throwable throwable) |
static void |
logError(java.lang.Throwable throwable) |
static void |
logInfo(java.lang.String logMessage) |
boolean |
openIMSession()
Open IM session related to this IMSessionHandler.
|
boolean |
openIMSession(IMUser.IMUserStatus imUserStatus)
Open IM session related to this IMSessionHandler.
|
boolean |
refreshIMConnectionTimeout()
Change the target session connect timeout
|
boolean |
refreshIMServerHostname()
Gets the value from Maximo System Property for IM server hostname and
refresh it on IMSessionHandler if it is a new value (different from the
current and non blank).
|
void |
resetActivityFlag() |
IMUser |
resolve(java.lang.String userDisplayName) |
void |
serverConnected(MXEvent evt)
Sent when a Session connects to a server.
|
void |
serverConnectionError(MXEvent evt)
Sent when a Session trys to connect to a server but can't
|
void |
serverDisconnected(MXEvent evt)
Sent when a Session is disconnected.
|
void |
userStatusChanged(IMUserStatusEvent userStatusEvent) |
boolean |
validate()
Returns true only if all required connection parameters have already been
set
|
void |
valueBound(javax.servlet.http.HttpSessionBindingEvent arg0) |
void |
valueUnbound(javax.servlet.http.HttpSessionBindingEvent arg0) |
static boolean |
wasChatHelperAborted(java.lang.String sessionId) |
static boolean |
wasChatTranscriptSavedBeforeAbortion(java.lang.String sessionId)
Returns true if the ChatHelper related to sessionId exist, was aborted
and has saved the chat transcript before the abortion
|
public static final java.lang.String MESSAGE_GROUP
MessageKey
enumerationpublic static final java.lang.String IM_SERVER_HOST_MX_PROPERTY
public static IMSessionHandler getIMSessionHandler(javax.servlet.http.HttpSession httpSession)
session
- public static boolean hasIMSessionHandler(javax.servlet.http.HttpSession session)
session
- public boolean validate() throws java.rmi.RemoteException
java.rmi.RemoteException
public boolean refreshIMServerHostname() throws java.rmi.RemoteException
java.rmi.RemoteException
public boolean refreshIMConnectionTimeout() throws java.rmi.RemoteException
java.rmi.RemoteException
public boolean openIMSession() throws IMException, java.rmi.RemoteException
IMException
- if something wrong happens when opening IM session or if IM
driver has not been set yetjava.rmi.RemoteException
public boolean openIMSession(IMUser.IMUserStatus imUserStatus) throws IMException, java.rmi.RemoteException
imUserStatus
- IM user state to be set to IM session when openedIMException
java.rmi.RemoteException
public boolean closeIMSession(boolean saveFlag, WebClientSession webClientSession) throws IMException, TsdIMException
saveFlag
- true means the chat history from the still opened chat windows
will be saved before the still opened chat windows be abortedIMException
TsdIMException
public boolean closeIMSession(boolean saveFlag, javax.servlet.http.HttpServletRequest request) throws IMException, TsdIMException
IMException
TsdIMException
public void changeUserStatus(IMUser.IMUserStatus imUserStatus) throws IMException
IMException
public static UserInfo getUserInfo(javax.servlet.http.HttpSession httpSession)
public java.lang.String getImDriverName()
public java.lang.String getIMServerHostname()
public java.lang.String getIMConnectionTimeout()
public PartnerInfo getPartnerInfo(javax.servlet.http.HttpServletRequest httpRequest) throws java.rmi.RemoteException, java.security.NoSuchAlgorithmException, MXException, IMException
MXException
java.security.NoSuchAlgorithmException
java.rmi.RemoteException
IMException
public boolean isIMSessionOpened()
public void userStatusChanged(IMUserStatusEvent userStatusEvent)
userStatusChanged
in interface IMUserStatusListener
public IMUser.IMUserStatus getUserStatus(java.lang.String userIdOrEmail)
userIdOrEmail
- public IMUser resolve(java.lang.String userDisplayName) throws IMException
IMException
public boolean isUserAvailable(java.lang.String userId)
public ChatHelper getChatHelper(javax.servlet.http.HttpServletRequest httpRequest, java.lang.String sessionId, long chatIdentifier, java.lang.String partnerIMId) throws java.lang.Exception
java.lang.Exception
public boolean isPartnerChatting(java.lang.String partnerIMId)
public void chatClosed(java.lang.String sessionId)
public void valueBound(javax.servlet.http.HttpSessionBindingEvent arg0)
valueBound
in interface javax.servlet.http.HttpSessionBindingListener
public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent arg0)
valueUnbound
in interface javax.servlet.http.HttpSessionBindingListener
public void serverConnected(MXEvent evt)
MXSessionListener
serverConnected
in interface MXSessionListener
public void serverConnectionError(MXEvent evt)
MXSessionListener
serverConnectionError
in interface MXSessionListener
public void serverDisconnected(MXEvent evt)
MXSessionListener
serverDisconnected
in interface MXSessionListener
public static boolean wasChatHelperAborted(java.lang.String sessionId)
public static boolean wasChatTranscriptSavedBeforeAbortion(java.lang.String sessionId)
sessionId
- java.rmi.RemoteException
java.security.NoSuchAlgorithmException
MXException
public void resetActivityFlag()
public static void logInfo(java.lang.String logMessage)
public static void logDebug(java.lang.String logMessage)
public static void logError(java.lang.Throwable throwable)
public static void logError(java.lang.String logMessage, java.lang.Throwable throwable)