Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.lutris.appserver.server.session
Class BasicSessionUserTable  view BasicSessionUserTable download BasicSessionUserTable.java

java.lang.Object
  extended bycom.lutris.appserver.server.session.BasicSessionUserTable
All Implemented Interfaces:
StandardSessionUserTable
Direct Known Subclasses:
PagedSessionUserTable

class BasicSessionUserTable
extends java.lang.Object
implements StandardSessionUserTable

Table used by StandardSessionManager to cross reference User objects and sessions. This table does not hold references to the user and session objects. Instead it only cross-references the session keys and user names. An underlying assumption is that the user name can be used as a unique reference to the user. N.B. It is assumed that this class is only used by StandardSessionManager and that it is responsible for providing high level locks instead of synchronizing

Version:
$Revision: 1.3.2.1.4.1 $

Field Summary
private static java.util.Hashtable emptyTable
          A empty hash table used to return empty enumerations.
private  java.util.Hashtable userSessionTable
          Table indexed by a User object.
 
Constructor Summary
BasicSessionUserTable(com.lutris.util.Config config)
          Creates an instance of this table.
 
Method Summary
 void add(java.lang.String sessionKey, com.lutris.appserver.server.user.User user)
          Add a session key to the user name of the session xref table.
private  void debug(int level, java.lang.String msg)
          Prints debug information under Logger.DEBUG.
private  void debug(java.lang.String msg)
          Prints debug information under Logger.DEBUG.
 java.util.Enumeration getSessionKeys(com.lutris.appserver.server.user.User user)
          Returns the session keys associated with a particular user.
 int numSessions(com.lutris.appserver.server.user.User user)
          Get the number of sessions for a user.
 void remove(java.lang.String sessionKey)
          Removes all references to a session from the user session table.
 void remove(java.lang.String sessionKey, com.lutris.appserver.server.user.User user)
          Remove a session from the user to session mapping table.
 void shutdown()
          Shutdown this session user table as required.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

userSessionTable

private java.util.Hashtable userSessionTable
Table indexed by a User object. Each entry contains a Hashtable of sessions keys associated with the user name. The hash table is indexed by the Session object.


emptyTable

private static final java.util.Hashtable emptyTable
A empty hash table used to return empty enumerations.

Constructor Detail

BasicSessionUserTable

public BasicSessionUserTable(com.lutris.util.Config config)
Creates an instance of this table. The config options are ignored.

Method Detail

add

public void add(java.lang.String sessionKey,
                com.lutris.appserver.server.user.User user)
Add a session key to the user name of the session xref table.

Specified by:
add in interface StandardSessionUserTable

remove

public void remove(java.lang.String sessionKey,
                   com.lutris.appserver.server.user.User user)
Remove a session from the user to session mapping table. If the session is not it the table, it is ignored.

Specified by:
remove in interface StandardSessionUserTable

remove

public void remove(java.lang.String sessionKey)
Removes all references to a session from the user session table.

Specified by:
remove in interface StandardSessionUserTable

numSessions

public int numSessions(com.lutris.appserver.server.user.User user)
Get the number of sessions for a user.

Specified by:
numSessions in interface StandardSessionUserTable

getSessionKeys

public java.util.Enumeration getSessionKeys(com.lutris.appserver.server.user.User user)
Returns the session keys associated with a particular user.

Specified by:
getSessionKeys in interface StandardSessionUserTable

shutdown

public void shutdown()
Shutdown this session user table as required. The session user table should not be used after this method has been called

Specified by:
shutdown in interface StandardSessionUserTable

debug

private void debug(java.lang.String msg)
Prints debug information under Logger.DEBUG.


debug

private void debug(int level,
                   java.lang.String msg)
Prints debug information under Logger.DEBUG.