Interface D2SessionFactory
-
- All Known Subinterfaces:
D2Connector
,RedundantConnectionManager
- All Known Implementing Classes:
Connector
,RedundantConnectionManagerImpl
public interface D2SessionFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Close connection to D2000.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.java.util.concurrent.Future<D2Session>
createSession(D2SessionParameters sessionParams, D2SessionEventsListener eventsListener, java.util.Set<SharedResourceType> interestSet)
Create new session object, connect it to D2000 and authorize it with valid D2000 user account.java.util.concurrent.Future<CreateSessionResponse>
createSessionWithSpnego(D2SessionParameters sessionParams, D2SessionEventsListener eventsListener, java.util.Set<SharedResourceType> interestSet)
Create new session object, connect it to D2000 and authorize it with valid D2000 user account.boolean
isClosed()
Gettrue
afterclose()
has been called.
-
-
-
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. Get the session asynchronously via returnedFuture
object.Note: Do not use in combination with SPNEGO authentication mechanism if you intend to obtain result from returned future.
Operation is executed in background thread and goes through following steps:
- Create new instance.
- Connect session to the D2000 kernel.
- Logon to the D2000 kernel with provided user account.
- Future result may throw
ExecutionException
withcause
: ConnectSessionException
- when kernel refused connection of the sessionLoginFailedException
- when kernel refused to logon with provided user account
- Parameters:
sessionParams
- authentication informationeventsListener
- 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 authorize it with valid D2000 user account. Get the session asynchronously via returnedFuture
object.Note: Do not use in combination with SPNEGO authentication mechanism if you intend to obtain result from returned future.
Operation is executed in background thread and goes through following steps:
- Create new instance.
- Report current state of shared resources to the
sharedResourcesListener
. - Connect session to the D2000 kernel.
- Logon to the D2000 kernel with provided user account.
- Future result may throw
ExecutionException
withcause
: ConnectSessionException
- when kernel refused connection of the sessionLoginFailedException
- when kernel refused to logon with provided user account
- Parameters:
sessionParams
- authentication informationeventsListener
- instance of event listener object to receive asynchronous events from D2000 sessioninterestSet
- interesting shared resource types- Returns:
- upcoming session object in form of future
-
createSessionWithSpnego
java.util.concurrent.Future<CreateSessionResponse> createSessionWithSpnego(D2SessionParameters sessionParams, D2SessionEventsListener eventsListener, java.util.Set<SharedResourceType> interestSet)
Create new session object, connect it to D2000 and authorize it with valid D2000 user account.Note: You should prefer
createSession(sk.ipesoft.d2000.d2japi.D2SessionParameters, sk.ipesoft.d2000.d2japi.D2SessionEventsListener, java.util.Set)
when you don't use SPNEGO or when you obtain new session througheventsListener
.Note 2: Keep implementation of
SpnegoHandler.handleTokenFromServer(byte[], sk.ipesoft.d2000.d2japi.SpnegoHandler.ResponseHandler)
blank, because you will obtain SPNEGO response via returned future.Operation is executed in background thread and goes through following steps:
- Create new instance.
- Report current state of shared resources to the
sharedResourcesListener
. - Connect session to the D2000 kernel.
- Logon to the D2000 kernel with provided user account.
- Future result may throw
ExecutionException
withcause
: ConnectSessionException
- when kernel refused connection of the sessionLoginFailedException
- when kernel refused to logon with provided user account
- Parameters:
sessionParams
- authentication informationeventsListener
- instance of event listener object to receive asynchronous events from D2000 sessioninterestSet
- interesting shared resource types- Returns:
- upcoming session object in form of future
-
isClosed
boolean isClosed()
Gettrue
afterclose()
has been called. Indicates that no new session can be created and all created sessions has been terminated.- Returns:
true
when closed;
-
-