| Constructor and Description |
|---|
IMSessionSTImpl() |
| Modifier and Type | Method and Description |
|---|---|
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)
Configures the session using the properties specified.
|
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
|
java.lang.String |
getCommunity() |
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.
|
long |
getResolveTimeout()
Returns the resolve timeout
|
java.lang.String |
getServerHostName() |
int |
getServerPort() |
java.lang.String |
getSessionName()
Returns the session name
|
java.lang.String |
getUserId() |
java.lang.String |
getUserPassword() |
boolean |
isOpened() |
void |
loggedIn(com.lotus.sametime.community.LoginEvent stEvent) |
void |
loggedOut(com.lotus.sametime.community.LoginEvent stEvent) |
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
|
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 |
setConnectionTimeout(long timeout)
Defines the timeout used by method
IMSession.open(). |
void |
setResolveTimeout(long timeout)
Defines the timeout used by method
IMSession.resolve(String, boolean, boolean). |
public void configure(java.util.Properties properties)
throws IMException
IMSessionIMDriver.validateProperties(Properties) can be used to make sure
that the properties are validconfigure in interface IMSessionIMException - if the properties are invalid or if the session could not be
createdpublic java.lang.String getServerHostName()
getServerHostName in interface IMSessionpublic int getServerPort()
public java.lang.String getSessionName()
IMSessiongetSessionName in interface IMSessionpublic java.lang.String getUserPassword()
getUserPassword in interface IMSessionpublic java.lang.String getCommunity()
public IMUser getIMUser()
IMSessionpublic void open()
throws IMException
IMSessionIMSession.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 IMSessionIMException - if it is not possible to open the session (invalid user or
password, for example), or if the connection timeout has
finishedpublic void changeUserStatus(IMUser.IMUserStatus imUserStatus) throws IMException
IMSessionchangeUserStatus in interface IMSessionIMException - if the IM session is not openedpublic void close()
throws IMException
IMSessionclose in interface IMSessionIMException - if some error occurs during the closing operationpublic void loggedIn(com.lotus.sametime.community.LoginEvent stEvent)
loggedIn in interface com.lotus.sametime.community.LoginListenerpublic void loggedOut(com.lotus.sametime.community.LoginEvent stEvent)
loggedOut in interface com.lotus.sametime.community.LoginListenerpublic IMResolveHandler createResolveHandler(boolean onlyUnique, boolean exhaustiveLookup) throws IMException
IMSessioncreateResolveHandler in interface IMSessiononlyUnique - 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 IMUserStatusHandler createUserStatusHandler() throws IMException
IMSessioncreateUserStatusHandler in interface IMSessionIMException - if this session is not opened yetpublic IMMessageHandler createMessageHandler(IMUser partner) throws IMException
IMSessioncreateMessageHandler in interface IMSessionIMException - if this session is not opened yetpublic IMResolveEvent resolve(java.lang.String userDisplayName, boolean onlyUnique, boolean exhaustiveLookup) throws IMException
IMSessionIMResolveHandler object and a
IMResolveListener class if you don't want to block your thread to
use this function.resolve in interface IMSessiononlyUnique - 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, IMException
IMSessionIMResolveHandler 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 IMSessionIMException - 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 long getDefaultConnectionTimeout()
IMSessiongetDefaultConnectionTimeout in interface IMSessionpublic void setConnectionTimeout(long timeout)
IMSessionIMSession.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 IMSessionpublic long getConnectionTimeout()
IMSessiongetConnectionTimeout in interface IMSessionpublic long getDefaultResolveTimeout()
IMSessiongetDefaultResolveTimeout in interface IMSessionpublic void setResolveTimeout(long timeout)
IMSessionIMSession.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 IMSessionpublic long getResolveTimeout()
IMSessiongetResolveTimeout in interface IMSessionpublic void registerIMSingleListener(IMSingleListener listener) throws IMException
IMSessionregisterIMSingleListener in interface IMSessionIMExceptionpublic void removeIMSingleListener(IMSingleListener listener) throws IMException
IMSessionremoveIMSingleListener in interface IMSessionIMException