com.netscape.certsrv.base
Class SessionContext

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable
          extended by com.netscape.certsrv.base.SessionContext
All Implemented Interfaces:
IAuthInfo, java.io.Serializable, java.lang.Cloneable, java.util.Map

public class SessionContext
extends java.util.Hashtable
implements IAuthInfo

This class specifies the context object that includes authentication environment and connection information. This object is later used in access control evaluation. This is a global object that can be accessible throughout the server. It is useful for passing global and per-thread infomration in methods.

Version:
$Revision: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $
See Also:
Serialized Form

Field Summary
static java.lang.String AUTH_MANAGER_ID
          ID of the authentication manager in the current thread.
static java.lang.String AUTH_TOKEN
          Authentication token in the current thread.
static java.lang.String GROUP_ID
          Group ID of the authenticated user in the current thread.
static java.lang.String IPADDRESS
          IP Address of the requestor of the request in the current thread.
static java.lang.String LOCALE
          End user locale of the current processing request in the current thread.
static java.lang.String RECOVERY_ID
          Recovery ID of a recovery operation in KRA in the current thread.
static java.lang.String REQUESTER_ID
          ID of the processing request in the current thread.
static java.lang.String USER
          User object of the authenticated user in the current thread.
static java.lang.String USER_ID
          User ID of the authenticated user in the current thread.
 
Constructor Summary
SessionContext()
          Constructs a session context.
 
Method Summary
static SessionContext getContext()
          Retrieves the session context associated with the current thread.
static SessionContext getExistingContext()
          Retrieves the session context associated with the current thread.
static void releaseContext()
          Releases the current session context.
static void setContext(SessionContext sc)
          Sets the current context.
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LOCALE

public static final java.lang.String LOCALE
End user locale of the current processing request in the current thread.

See Also:
Constant Field Values

AUTH_TOKEN

public static final java.lang.String AUTH_TOKEN
Authentication token in the current thread.

See Also:
Constant Field Values

AUTH_MANAGER_ID

public static final java.lang.String AUTH_MANAGER_ID
ID of the authentication manager in the current thread.

See Also:
Constant Field Values

USER

public static final java.lang.String USER
User object of the authenticated user in the current thread.

See Also:
Constant Field Values

USER_ID

public static final java.lang.String USER_ID
User ID of the authenticated user in the current thread.

See Also:
Constant Field Values

GROUP_ID

public static final java.lang.String GROUP_ID
Group ID of the authenticated user in the current thread.

See Also:
Constant Field Values

REQUESTER_ID

public static final java.lang.String REQUESTER_ID
ID of the processing request in the current thread.

See Also:
Constant Field Values

RECOVERY_ID

public static final java.lang.String RECOVERY_ID
Recovery ID of a recovery operation in KRA in the current thread.

See Also:
Constant Field Values

IPADDRESS

public static final java.lang.String IPADDRESS
IP Address of the requestor of the request in the current thread.

See Also:
Constant Field Values
Constructor Detail

SessionContext

public SessionContext()
Constructs a session context.

Method Detail

setContext

public static void setContext(SessionContext sc)
Sets the current context. This allows the caller to associate a specific session context with the current thread. This methods makes custom session context possible.

Parameters:
sc - session context

getContext

public static SessionContext getContext()
Retrieves the session context associated with the current thread. If no context is associated, a context is created.

Returns:
sesssion context

getExistingContext

public static SessionContext getExistingContext()
Retrieves the session context associated with the current thread. If no context is associated, null is returned.

Returns:
sesssion context

releaseContext

public static void releaseContext()
Releases the current session context.