com.cafesoft.cams.session
Class AbstractBaseSession

java.lang.Object
  |
  +--com.cafesoft.cams.session.AbstractBaseSession
All Implemented Interfaces:
Recyclable, Serializable, Session
Direct Known Subclasses:
StandardRemoteSession

public abstract class AbstractBaseSession
extends Object
implements Session

Abstract base class for all Session objects.

Since:
5/15/02
See Also:
ManagedSession, RemoteSession, Session, Serialized Form

Field Summary
protected  NamespaceMap namespaceMap
          Session's namespace map.
protected  SessionStatus sessionStatus
          Session status.
protected  long touchTime
          Last time session was touched.
 
Constructor Summary
AbstractBaseSession(SessionId sessionId, String securityDomainName, long creationTime, long touchTime, Map authenticationMap, SessionStatus sessionStatus, NamespaceMap namespaceMap)
          Create an AbstractBaseSession with the given SessionId, creation time, last touch time, AuthenticationMethod Map, Session status, and NamespaceMap
AbstractBaseSession(SessionId sessionId, String securityDomainName, long creationTime, Map authenticationMap)
          Create an AbstractBaseSession with the given SessionId and AuthenticationMethod Map
 
Method Summary
 Object getAttribute(String namespace, String name)
          Get a attribute from the session
 String[] getAttributeNames(String namespace)
          Get the names of all the attributes in the session
 Map getAuthenticationMethods()
          Get the authentication methods used to login the Subject.
 long getCreationTime()
          Get the session creation time.
 SessionId getId()
          Get the Session's Id
 long getLastTouchTime()
          Get the instant the session was last touched.
 String[] getNamespaces()
          Get all attribute namespaces.
 String getSecurityDomainName()
          Get the Session's security domain name.
 SessionStatus getStatus()
          Get the Session status.
 void recycle()
          Recycle the resources of this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

touchTime

protected long touchTime
Last time session was touched.


sessionStatus

protected SessionStatus sessionStatus
Session status.


namespaceMap

protected NamespaceMap namespaceMap
Session's namespace map.

Constructor Detail

AbstractBaseSession

public AbstractBaseSession(SessionId sessionId,
                           String securityDomainName,
                           long creationTime,
                           Map authenticationMap)
Create an AbstractBaseSession with the given SessionId and AuthenticationMethod Map

Parameters:
sessionId - the session id
securityDomainName - the name of the security domain to which this session belongs
authenticationMap - the Map of AuthenticationMethods

AbstractBaseSession

public AbstractBaseSession(SessionId sessionId,
                           String securityDomainName,
                           long creationTime,
                           long touchTime,
                           Map authenticationMap,
                           SessionStatus sessionStatus,
                           NamespaceMap namespaceMap)
Create an AbstractBaseSession with the given SessionId, creation time, last touch time, AuthenticationMethod Map, Session status, and NamespaceMap

Parameters:
sessionId - the session id
securityDomainName - the name of the security domain to which this session belongs
creationTime - the session creation time
touchTime - the session last touch time
authenticationMap - the Map of AuthenticationMethods
sessionStatus - the session's status
namespaceMap - the namespace map of the session
Method Detail

recycle

public void recycle()
Recycle the resources of this object

Specified by:
recycle in interface Recyclable

getId

public final SessionId getId()
Get the Session's Id

Specified by:
getId in interface Session
Returns:
A string representing the session's id

getSecurityDomainName

public String getSecurityDomainName()
Get the Session's security domain name.

Specified by:
getSecurityDomainName in interface Session
Returns:
the name of the security domain to which this session belongs.

getLastTouchTime

public final long getLastTouchTime()
Get the instant the session was last touched.

Specified by:
getLastTouchTime in interface Session
Returns:
a long number that represents the time the session was last touched.

getCreationTime

public final long getCreationTime()
Get the session creation time.

Specified by:
getCreationTime in interface Session
Returns:
A long number that represents the time the Session was created.

getStatus

public final SessionStatus getStatus()
Get the Session status.

Specified by:
getStatus in interface Session
Returns:
a Session is either "active", "expired", or "closed". When a session is first created, it is "active". If the associated Subject has logged out, the session is "closed". If the session has been inactive for longer than the period defined by it's SessionManagerService, then it is "expired".

getAuthenticationMethods

public final Map getAuthenticationMethods()
Get the authentication methods used to login the Subject.

Specified by:
getAuthenticationMethods in interface Session
Returns:
a String array of authentication types which may include any of the following values:
  • AuthenticationMethod.PASSWORD
  • AuthenticationMethod.SECUREPASSWORD
  • AuthenticationMethod.KERBEROS
  • AuthenticationMethod.HARDWARETOKEN
  • AuthenticationMethod.SSLTLS
  • AuthenticationMethod.X509
  • AuthenticationMethod.PGP
  • AuthenticationMethod.SPKI
  • AuthenticationMethod.XKMS
  • AuthenticationMethod.XMLDIGSIG
See Also:
AuthenticationMethod

getAttribute

public final Object getAttribute(String namespace,
                                 String name)
Get a attribute from the session

Specified by:
getAttribute in interface Session
Parameters:
namespace - the namespace of the name/value pair
name - the name string to get the value for
Returns:
The attribute from the Session, null if the name doesn't exist.

getNamespaces

public final String[] getNamespaces()
Get all attribute namespaces.

Specified by:
getNamespaces in interface Session
Returns:
a String array of all namespaces used for values currently stored in the session including the "default" namepace.

getAttributeNames

public final String[] getAttributeNames(String namespace)
Get the names of all the attributes in the session

Specified by:
getAttributeNames in interface Session
Parameters:
namespace - the namespace of attributes to be retrieved.
Returns:
A String array of all names in the sessions that contain attributes


Generated on 10:40:31 AM September 10, 2003, © 1996-2003 Cafésoft LLC. All rights reserved.