Constructor and Description |
---|
IMSessionMocImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addPartnerConferenceId(java.lang.String partnerId,
java.lang.String confId)
Method used to store conferences started for this session
|
void |
changeUserStatus(IMUser.IMUserStatus imUserStatus)
Changes the user status related to the connection established with IM
server
|
void |
close()
Closes the connection established with IM server.
|
void |
configure(java.util.Properties properties)
Configure session parameters from maximo configuration
|
IMMessageHandler |
createMessageHandler(IMUser partner)
Creates a new message handler allowing objects to do operations like
sending new messages, closing the conversation or verifying if the
conversation is still opened
|
IMResolveHandler |
createResolveHandler(boolean onlyUnique,
boolean exhaustiveLookup)
Creates and returns a resolve object
|
IMUserStatusHandler |
createUserStatusHandler()
Creates a new user status handler allowing listener objects to be
registered to be notified when some user changes his/her IM status
|
int |
getAckId() |
long |
getConnectionTimeout()
Returns the connection timeout
|
long |
getDefaultConnectionTimeout()
Returns the default connection timeout
|
long |
getDefaultResolveTimeout()
Returns the default resolve timeout
|
IMUser |
getIMUser()
Returns the IMUser object related to the user account used to open this
IM chat session.
|
java.util.List<java.lang.String> |
getListenedUsers() |
IMMessageHandlerMocImpl |
getMessageHandler(java.lang.String userId) |
java.lang.String |
getPartnerConferenceId(java.lang.String partnerId)
Recovery partner conference Id
|
IMMessageHandlerMocImpl |
getPartnerHandlerByConferenceId(java.lang.String confId)
Method that recovery Message Handler by confId
|
ReceiveMessage |
getReceiveMessage() |
long |
getResolveTimeout()
Returns the resolve timeout
|
int |
getRid() |
java.lang.String |
getServerHostName() |
int |
getServerPort() |
java.lang.String |
getServiceName() |
java.lang.String |
getSessionName()
Returns the session name
|
java.lang.String |
getSid() |
java.lang.String |
getTicket() |
java.lang.String |
getUserId() |
java.lang.String |
getUserPassword() |
IMUserStatusHandler |
getUserStatusHandler() |
boolean |
isOpened() |
void |
open()
Connects to the IM server using the information set using
IMSession.configure(Properties) method. |
void |
registerIMSingleListener(IMSingleListener listener)
Registers a new listener for handling incoming messages.
|
void |
removeIMSingleListener(IMSingleListener listener)
Remove the specified IMSingleListener
|
void |
removeMessageHandlerList(java.lang.String userId) |
void |
removePartnerConferenceId(java.lang.String partnerId)
Used to remove conference Id when chat finish
|
IMUser |
resolve(java.lang.String userDisplayName)
Resolves the user identified by userDisplayName parameter.
|
IMResolveEvent |
resolve(java.lang.String userDisplayName,
boolean onlyUnique,
boolean exhaustiveLookup)
Resolves the user identified by userDisplayName parameter.
|
void |
setAckId(int ackId) |
void |
setConnectionTimeout(long timeout)
Defines the timeout used by method
IMSession.open() . |
void |
setListenedUsers(java.util.List<java.lang.String> listenedUsers) |
void |
setReceiveMessage(ReceiveMessage receiveMessage) |
void |
setResolveTimeout(long timeout)
Defines the timeout used by method
IMSession.resolve(String, boolean, boolean) . |
void |
setRid(int rid) |
void |
setSid(java.lang.String sid) |
void |
setTicket(java.lang.String ticket) |
void |
setUserStatusHandler(IMUserStatusHandler userStatusHandler) |
public java.util.List<java.lang.String> getListenedUsers()
public void setListenedUsers(java.util.List<java.lang.String> listenedUsers)
public ReceiveMessage getReceiveMessage()
public void setReceiveMessage(ReceiveMessage receiveMessage)
public int getRid()
public void setRid(int rid)
public java.lang.String getTicket()
public void setTicket(java.lang.String ticket)
public java.lang.String getSid()
public void setSid(java.lang.String sid)
public void changeUserStatus(IMUser.IMUserStatus imUserStatus) throws IMException
IMSession
changeUserStatus
in interface IMSession
IMException
- if the IM session is not openedpublic void open() throws IMException
IMSession
IMSession.configure(Properties)
method. This method uses a
connection timeout set by IMSession.setConnectionTimeout(long)
,
and not returns until the timeout is over or the connection opens. So,
this method is blocking (bolcks the current thread). A not blockiing
method to open a session will be available soon.open
in interface IMSession
IMException
- if it is not possible to open the session (invalid user or
password, for example), or if the connection timeout has
finishedpublic void close() throws IMException
IMSession
close
in interface IMSession
IMException
- if some error occurs during the closing operationpublic void removeMessageHandlerList(java.lang.String userId) throws IMException
IMException
public void configure(java.util.Properties properties) throws IMException
configure
in interface IMSession
IMException
- if the properties are invalid or if the session could not be
createdpublic java.lang.String getServerHostName()
getServerHostName
in interface IMSession
public int getServerPort()
public java.lang.String getServiceName()
public java.lang.String getSessionName()
IMSession
getSessionName
in interface IMSession
public java.lang.String getUserPassword()
getUserPassword
in interface IMSession
public IMUser getIMUser()
IMSession
public IMMessageHandler createMessageHandler(IMUser partner) throws IMException
IMSession
createMessageHandler
in interface IMSession
IMException
- if this session is not opened yetpublic IMResolveHandler createResolveHandler(boolean onlyUnique, boolean exhaustiveLookup) throws IMException
IMSession
createResolveHandler
in interface IMSession
onlyUnique
- This option determines whether the created resolver object
should resolve successfully only if the provided name is
matched exactly in the IM directoryexhaustiveLookup
- This option determines whether the created resolver object
should perform an exhaustive lookup through all directories or
stop in the first directory where a match is foundIMException
- if this session is not opened yet, or if the partner can not
be resolvedpublic IMMessageHandlerMocImpl getMessageHandler(java.lang.String userId)
public IMUserStatusHandler createUserStatusHandler() throws IMException
IMSession
createUserStatusHandler
in interface IMSession
IMException
- if this session is not opened yetpublic long getConnectionTimeout()
IMSession
getConnectionTimeout
in interface IMSession
public long getDefaultConnectionTimeout()
IMSession
getDefaultConnectionTimeout
in interface IMSession
public long getDefaultResolveTimeout()
IMSession
getDefaultResolveTimeout
in interface IMSession
public long getResolveTimeout()
IMSession
getResolveTimeout
in interface IMSession
public IMResolveEvent resolve(java.lang.String userDisplayName, boolean onlyUnique, boolean exhaustiveLookup) throws IMException
IMSession
IMResolveHandler
object and a
IMResolveListener
class if you don't want to block your thread to
use this function.resolve
in interface IMSession
onlyUnique
- This option determines if it should resolve successfully only
if the provided name is matched exactly in the IM directoryexhaustiveLookup
- This option determines if it should perform an exhaustive
lookup through all directories or stop in the first directory
where a match is foundSTUser
object or to know the reason that it could not be
generatedIMException
- if the session is not opened, or if the resolve operation is
not concluded in X milliseconds. X can be set using
IMSession.setResolveTimeout(long)
methodIMSession.createResolveHandler(boolean, boolean)
public IMUser resolve(java.lang.String userDisplayName) throws IMException
IMSession
IMResolveHandler
object and a
IMResolveListener
class if you don't want to block your thread to
use this function. This method returns a user resolve only if the display
name is exactly equal to the existent in serverresolve
in interface IMSession
IMException
- if the session is not opened, or if the resolve operation is
not concluded in X milliseconds. X can be set using
IMSession.setResolveTimeout(long)
methodIMSession.createResolveHandler(boolean, boolean)
public void setConnectionTimeout(long timeout)
IMSession
IMSession.open()
. If a
connection timeout is not set, the default value will be used. The
default connection timeout value can be got using the
IMSession.getDefaultConnectionTimeout()
methodsetConnectionTimeout
in interface IMSession
public void setResolveTimeout(long timeout)
IMSession
IMSession.resolve(String, boolean, boolean)
. If a resolve
timeout is not set, the default value will be used. The default resolve
timeout value can be got using the
IMSession.getDefaultResolveTimeout()
methodsetResolveTimeout
in interface IMSession
public IMUserStatusHandler getUserStatusHandler()
public void setUserStatusHandler(IMUserStatusHandler userStatusHandler)
public int getAckId()
public void setAckId(int ackId)
public void registerIMSingleListener(IMSingleListener listener) throws IMException
IMSession
registerIMSingleListener
in interface IMSession
IMException
public void removeIMSingleListener(IMSingleListener listener) throws IMException
IMSession
removeIMSingleListener
in interface IMSession
IMException
public java.lang.String getPartnerConferenceId(java.lang.String partnerId)
partnerId
- public void removePartnerConferenceId(java.lang.String partnerId)
partnerId
- public void addPartnerConferenceId(java.lang.String partnerId, java.lang.String confId)
partnerId
- confId
- public IMMessageHandlerMocImpl getPartnerHandlerByConferenceId(java.lang.String confId)
confId
-