org.aselect.authspserver.session
Class AuthSPSessionManager

java.lang.Object
  extended by org.aselect.system.storagemanager.StorageManager
      extended by org.aselect.authspserver.session.AuthSPSessionManager

public class AuthSPSessionManager
extends StorageManager

A session manager for all AuthSP's.

Description:
A singleton class that uses a StorageManager from the org.aselect.system package as backend.

Concurrency issues:
-

Author:
Alfa & Ariss

Field Summary
static java.lang.String MODULE
          The module name.
 
Method Summary
 void createSession(java.lang.String sRid, java.util.Hashtable htContext)
          Create a session with the supplied RID as ID.
static AuthSPSessionManager getHandle()
          Get a static handle to the AuthSPSessionManager instance.
 java.util.Hashtable getSessionContext(java.lang.String sRid)
          Get the session context of a session.
 void init()
          Initializes the AuthSPSessionManager.
 void updateSession(java.lang.String sRid, java.util.Hashtable htExtendedContext)
          Update a session context with the given information.
 
Methods inherited from class org.aselect.system.storagemanager.StorageManager
containsKey, destroy, get, getAll, getCount, getExpirationTime, getTimestamp, init, put, remove, removeAll, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODULE

public static final java.lang.String MODULE
The module name.

See Also:
Constant Field Values
Method Detail

getHandle

public static AuthSPSessionManager getHandle()
Get a static handle to the AuthSPSessionManager instance.

Description:
Checks if a static instance exists, otherwise it is created. This instance is returned.

Concurrency issues:
-

Preconditions:
-

Postconditions:
One instance of the AuthSPSessionManager exists.

Returns:
A handle to the AuthSPSessionManager.

init

public void init()
          throws ASelectException
Initializes the AuthSPSessionManager.

Description:
Read configuration settings and initializes the components.

Concurrency issues:
-

Preconditions:
-

Postconditions:
The instance variables and components are initialized.

Throws:
ASelectException - if initialization fails

createSession

public void createSession(java.lang.String sRid,
                          java.util.Hashtable htContext)
                   throws ASelectException
Create a session with the supplied RID as ID.

Description:
The htContext variable contains the information that should be stored in the session.

Concurrency issues:
-

Preconditions:
htSessionContext != null

Postconditions:
The given session is stored.

Parameters:
sRid - The RID that is used as session ID
htContext - The session context parameters in a Hashtable.
Throws:
ASelectException - if the session could not be created or already exists

updateSession

public void updateSession(java.lang.String sRid,
                          java.util.Hashtable htExtendedContext)
                   throws ASelectException
Update a session context with the given information.

Description:
Overwrites the supplied session parameters in the context of the session with the given ID.

Concurrency issues:
-

Preconditions:
Postconditions:
The given session is updated with the new context.

Parameters:
sRid - The ID of the session
htExtendedContext - Hashtable of the parameters in the session context that should be overwritten
Throws:
ASelectException - if the session could not be updated

getSessionContext

public java.util.Hashtable getSessionContext(java.lang.String sRid)
                                      throws ASelectException
Get the session context of a session.

Description:
Retrieve the session context (session parameters) belonging to the given session ID.

Concurrency issues:
-

Preconditions:
sSessionId != null

Postconditions:
-

Parameters:
sRid - The ID of the session.
Returns:
Hashtable Containing the context of the session.
Throws:
ASelectException - if the session oculd not be resolved.


Copyright © 2008 SURFnet BV. All Rights Reserved.