simple.http.session
Class Manager

java.lang.Object
  extended by simple.http.session.Manager

public final class Manager
extends java.lang.Object

The Manager object provides the interface to the session management system. This enables Session objects to be created and retrieved from the system. Sessions are created if the issued State does not have a session reference cookie or if it contains a reference to a dead session. If a reference to a dead session is found a new one is created and is referred to with the existing cookie.

If the Manager creates a new session then it invokes the Store.prepare method for a new instance. This method is given the argument provided in the getSession method, which is either null if none is provided or an object of the users choice. This allows the Store the possibility of setting up JDBC connections by possibly passing it a URI to connection to the database, for example "jdbc:mysql://host/database" could be used to setup the connection to the remote database.

Author:
Niall Gallagher
See Also:
Store

Constructor Summary
Manager()
           
 
Method Summary
static Session getSession(State state)
          This will either retrieve an active session or create a new one.
static Session getSession(State state, java.lang.Object data)
          This will either retrieve an active session or create a new one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Manager

public Manager()
Method Detail

getSession

public static Session getSession(State state)
This will either retrieve an active session or create a new one. The Session object is created if the State does not have a reference to an active session. If a session has expired and the session reference is provided, this will create a new session using the existing reference. Once a Session has been created a Cookie is set with its reference.

Parameters:
state - contains all the cookies sent by the client
Returns:
returns an active Session object

getSession

public static Session getSession(State state,
                                 java.lang.Object data)
This will either retrieve an active session or create a new one. The Session object is created if the State does not have a reference to an active session. If a session has expired and the session reference is provided, this will create a new session using the existing reference. Once a Session has been created a Cookie is set with its reference.

Parameters:
state - contains all the cookies sent by the client
data - this is used to initialize the storage object, this can be anything from a URI to a Map
Returns:
returns an active Session object