|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.sessions.impl.TransientSessionManager
A thread-safe session manager that maintains a collection of sessions in memory. These sessions are transient so will not persist if the data service resource is terminated.
SessionManager
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE
|
private static DAILogger |
LOG
|
private SessionConfiguration |
mConfig
|
private java.util.Map |
mSessions
|
Constructor Summary | |
TransientSessionManager(SessionConfiguration config)
Constructs a new transient session manager with the specified configuration. |
Method Summary | |
private void |
addSession(InternalSession session)
Adds the specified session to the the sessions being managed. |
Session |
createSessionView(SessionID sid)
Creates a safe view of the specified session for use by a session participant. |
SessionConfiguration |
getSessionConfiguration()
Gets the session configuration information for the session manager. |
boolean |
hasSession(SessionID sid)
Does a session with a given ID exist? |
InternalSession |
lookupSession(SessionID sid)
Looks up a session by its session identifier (SID). |
InternalSession |
newSession()
Creates a new session with default settings. |
InternalSession |
newSession(SessionSettings settings)
Creates a new session with the specified settings. |
void |
terminateSession(SessionID sid)
Terminates the session with the specified session ID without concern of whether the session currently has participants or not. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private static final DAILogger LOG
private final java.util.Map mSessions
private final SessionConfiguration mConfig
Constructor Detail |
public TransientSessionManager(SessionConfiguration config)
config
- The configuration details for the transient session manager.
java.lang.IllegalArgumentException
- If the config
argument is null
.Method Detail |
public boolean hasSession(SessionID sid)
SessionManager
hasSession
in interface SessionManager
sid
- Session id.
true
if the session exists, false
otherwise.public InternalSession newSession() throws SessionCreationException
SessionManager
newSession
in interface SessionManager
SessionCreationException
- if a problem prevents the
method from executing. The nature of this problem may depend on
implementation. The processing of the associated request cannot
continue afterwards, so higher-level components of OGSA-DAI
will treat all such exceptions in the same way.public InternalSession newSession(SessionSettings settings) throws SessionCreationException
SessionManager
newSession
in interface SessionManager
settings
- The settings to be used for creating the new session.
SessionCreationException
- if a problem prevents the
method from executing. The nature of this problem may depend on
implementation. The processing of the associated request cannot
continue afterwards, so higher-level components of OGSA-DAI
will treat all such exceptions in the same way.public InternalSession lookupSession(SessionID sid) throws SessionNotFoundException, SessionLookupException
SessionManager
lookupSession
in interface SessionManager
sid
- The session identifier
InternalSession
object corresponding
to the given identifier.
SessionNotFoundException
- if the session does not exist.
SessionLookupException
- if a problem prevents the
method from executing. The nature of this problem may depend on
implementation. The processing of the associated request cannot
continue afterwards, so higher-level components of OGSA-DAI
will treat all such exceptions in the same way.public Session createSessionView(SessionID sid) throws SessionNotFoundException, SessionLookupException, SessionViewCreationException
SessionManager
The object returned must implement the Session
interface but must not implement the InternalSession
interface. This is to protect the internal session from abuse
such as inadvertent modification.
createSessionView
in interface SessionManager
sid
- The session identifier
InternalSession
object corresponding
to the given identifier.
SessionViewCreationException
- if a problem prevents the
method from executing. The nature of this problem may depend on
implementation. The processing of the associated request cannot
continue afterwards, so higher-level components of OGSA-DAI
will treat all such exceptions in the same way.
SessionLookupException
- if a problem prevents the
method from executing. The nature of this problem may depend on
implementation. The processing of the associated request cannot
continue afterwards, so higher-level components of OGSA-DAI
will treat all such exceptions in the same way.
SessionNotFoundException
- if the session does not exist.public void terminateSession(SessionID sid) throws SessionNotFoundException, SessionLookupException, SessionTerminationException
SessionManager
An implementation of this method should invoke the
cleanUp
method of the session that is being
killed. If the specified session does not exist, no action is
taken.
terminateSession
in interface SessionManager
sid
- The session identifier
SessionLookupException
- if a problem prevents the
method from executing. The nature of this problem may depend on
implementation. The processing of the associated request cannot
continue afterwards, so higher-level components of OGSA-DAI
will treat all such exceptions in the same way.
SessionTerminationException
- if a problem prevents the
method from executing. The nature of this problem may depend on
implementation. The processing of the associated request cannot
continue afterwards, so higher-level components of OGSA-DAI
will treat all such exceptions in the same way.
SessionNotFoundException
- if the session does not exist.private void addSession(InternalSession session)
session
- Session to add.public SessionConfiguration getSessionConfiguration()
SessionManager
getSessionConfiguration
in interface SessionManager
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |