Interface D2SessionFactory

    • Method Detail

      • close

        void close​()
        Close connection to D2000.
      • createSession

        java.util.concurrent.Future<D2Session> createSession​(D2SessionParameters sessionParams,
                                                             D2SessionEventsListener eventsListener)
        Create new session object, connect it to D2000 and authorize it with valid D2000 user account.

        Operation is executed in background thread and goes through following steps:

        1. Create new instance.
        2. Connect session to the D2000 kernel.
        3. Logon to the D2000 kernel with provided user account.
        Future result may throw ExecutionException with cause:
        ConnectSessionException - when kernel refused connection of the session
        LoginFailedException - when kernel refused to logon with provided user account
        Parameters:
        sessionParams - authentication information
        eventsListener - instance of event listener object to receive asynchronous events from D2000 session
        Returns:
        upcoming session object in form of future
      • createSession

        java.util.concurrent.Future<D2Session> createSession​(D2SessionParameters sessionParams,
                                                             D2SessionEventsListener eventsListener,
                                                             java.util.Set<SharedResourceType> interestSet)
        Create new session object, connect it to D2000 and authorise it with valid D2000 user account.

        Operation is executed in background thread and goes through following steps:

        1. Create new instance.
        2. Report current state of shared resources to the sharedResourcesListener.
        3. Connect session to the D2000 kernel.
        4. Logon to the D2000 kernel with provided user account.
        Future result may throw ExecutionException with cause:
        ConnectSessionException - when kernel refused connection of the session
        LoginFailedException - when kernel refused to logon with provided user account
        Parameters:
        sessionParams - authentication information
        eventsListener - instance of event listener object to receive asynchronous events from D2000 session
        interestSet - interesting shared resource types
        Returns:
        upcoming session object in form of future
      • isClosed

        boolean isClosed​()
        Get true after close() has been called. Indicates that no new session can be created and all created sessions has been terminated.
        Returns:
        true when closed;