com.ibm.tivoli.imi.drivers.sametime

Class IMSessionSTImpl

  • java.lang.Object
    • com.ibm.tivoli.imi.drivers.sametime.IMSessionSTImpl
  • All Implemented Interfaces:
    IMSession, com.lotus.sametime.community.LoginListener, java.util.EventListener


    public class IMSessionSTImpl
    extends java.lang.Object
    implements IMSession, com.lotus.sametime.community.LoginListener
    • Constructor Detail

      • IMSessionSTImpl

        public IMSessionSTImpl()
    • Method Detail

      • configure

        public void configure(java.util.Properties properties)
                       throws IMException
        Description copied from interface: IMSession
        Configures the session using the properties specified. A unique session name is automatically created and set to this session. The method IMDriver.validateProperties(Properties) can be used to make sure that the properties are valid
        Specified by:
        configure in interface IMSession
        Throws:
        IMException - if the properties are invalid or if the session could not be created
      • getServerPort

        public int getServerPort()
      • getSessionName

        public java.lang.String getSessionName()
        Description copied from interface: IMSession
        Returns the session name
        Specified by:
        getSessionName in interface IMSession
        Returns:
        the session name or null if it is not opened yet
      • getUserId

        public java.lang.String getUserId()
        Specified by:
        getUserId in interface IMSession
      • getCommunity

        public java.lang.String getCommunity()
      • getIMUser

        public IMUser getIMUser()
        Description copied from interface: IMSession
        Returns the IMUser object related to the user account used to open this IM chat session. If the session is not opened yet this method will return null
        Specified by:
        getIMUser in interface IMSession
        Returns:
        the IMUser object related to the user account used to open this IM chat session or null if the session is not opened yet
      • open

        public void open()
                  throws IMException
        Description copied from interface: IMSession
        Connects to the IM server using the information set using 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.
        Specified by:
        open in interface IMSession
        Throws:
        IMException - if it is not possible to open the session (invalid user or password, for example), or if the connection timeout has finished
      • close

        public void close()
                   throws IMException
        Description copied from interface: IMSession
        Closes the connection established with IM server. It doesn't do nothing it the session is not opened
        Specified by:
        close in interface IMSession
        Throws:
        IMException - if some error occurs during the closing operation
      • loggedIn

        public void loggedIn(com.lotus.sametime.community.LoginEvent stEvent)
        Specified by:
        loggedIn in interface com.lotus.sametime.community.LoginListener
      • loggedOut

        public void loggedOut(com.lotus.sametime.community.LoginEvent stEvent)
        Specified by:
        loggedOut in interface com.lotus.sametime.community.LoginListener
      • isOpened

        public boolean isOpened()
        Specified by:
        isOpened in interface IMSession
      • createResolveHandler

        public IMResolveHandler createResolveHandler(boolean onlyUnique,
                                                     boolean exhaustiveLookup)
                                              throws IMException
        Description copied from interface: IMSession
        Creates and returns a resolve object
        Specified by:
        createResolveHandler in interface IMSession
        Parameters:
        onlyUnique - This option determines whether the created resolver object should resolve successfully only if the provided name is matched exactly in the IM directory
        exhaustiveLookup - 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 found
        Returns:
        Throws:
        IMException - if this session is not opened yet, or if the partner can not be resolved
      • createUserStatusHandler

        public IMUserStatusHandler createUserStatusHandler()
                                                    throws IMException
        Description copied from interface: IMSession
        Creates a new user status handler allowing listener objects to be registered to be notified when some user changes his/her IM status
        Specified by:
        createUserStatusHandler in interface IMSession
        Returns:
        a new user status handler
        Throws:
        IMException - if this session is not opened yet
      • createMessageHandler

        public IMMessageHandler createMessageHandler(IMUser partner)
                                              throws IMException
        Description copied from interface: IMSession
        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
        Specified by:
        createMessageHandler in interface IMSession
        Returns:
        a new user status handler
        Throws:
        IMException - if this session is not opened yet
      • resolve

        public IMResolveEvent resolve(java.lang.String userDisplayName,
                                      boolean onlyUnique,
                                      boolean exhaustiveLookup)
                               throws IMException
        Description copied from interface: IMSession
        Resolves the user identified by userDisplayName parameter. This method is blocking, what means that the thread that call this method will be blocked until the resolve operation is finished. It happens because this function is done remotely. Use a IMResolveHandler object and a IMResolveListener class if you don't want to block your thread to use this function.
        Specified by:
        resolve in interface IMSession
        onlyUnique - This option determines if it should resolve successfully only if the provided name is matched exactly in the IM directory
        exhaustiveLookup - This option determines if it should perform an exhaustive lookup through all directories or stop in the first directory where a match is found
        Returns:
        this object contains all information needed to get the STUser object or to know the reason that it could not be generated
        Throws:
        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) method
        See Also:
        IMSession.createResolveHandler(boolean, boolean)
      • resolve

        public IMUser resolve(java.lang.String userDisplayName)
                       throws IMException,
                              IMException
        Description copied from interface: IMSession
        Resolves the user identified by userDisplayName parameter. This method is blocking, what means that the thread that call this method will be blocked until the resolve operation is finished. It happens because this function is done remotely. Use a 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 server
        Specified by:
        resolve in interface IMSession
        Returns:
        the user resolved or null if could not be found
        Throws:
        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) method
        See Also:
        IMSession.createResolveHandler(boolean, boolean)
      • getDefaultConnectionTimeout

        public long getDefaultConnectionTimeout()
        Description copied from interface: IMSession
        Returns the default connection timeout
        Specified by:
        getDefaultConnectionTimeout in interface IMSession
        Returns:
        the default connection timeout
      • getConnectionTimeout

        public long getConnectionTimeout()
        Description copied from interface: IMSession
        Returns the connection timeout
        Specified by:
        getConnectionTimeout in interface IMSession
        Returns:
        the connection timeout
      • getDefaultResolveTimeout

        public long getDefaultResolveTimeout()
        Description copied from interface: IMSession
        Returns the default resolve timeout
        Specified by:
        getDefaultResolveTimeout in interface IMSession
        Returns:
        the default resolve timeout
      • getResolveTimeout

        public long getResolveTimeout()
        Description copied from interface: IMSession
        Returns the resolve timeout
        Specified by:
        getResolveTimeout in interface IMSession
        Returns:
        the resolve timeout