EAF 7.4 API

com.lutris.appserver.server.session
Interface SessionManager


public interface SessionManager

The session management object interface. This class implementing this interface manage the session state for currently active users of one or more applications. It allocates sessions and maintains the mapping between session keys and Session objects.

Version:
$Revision: 1.3 $
Author:
Shawn McMurdo, Mark Diekhans

Field Summary
static java.lang.String ENCODE_URL_ALWAYS
          Indicates that url encoding of session ids is always preformed.
static java.lang.String ENCODE_URL_AUTO
          Indicates that url encoding of session ids is preformed only when cookies are disabled on the client browser.
static java.lang.String ENCODE_URL_NEVER
          Indicates that url encoding of session ids is never preformed.
 
Method Summary
 int activeSessionCount()
          Gets the number of currently active sessions.
 Session createSession()
          Create a new Session object and an associated unique random key.
 Session createSession(com.lutris.appserver.server.httpPresentation.HttpPresentationComms comms)
          Create a new Session object and an associated unique random key.
 Session createSession(java.lang.String ipPortToken)
          Create a new Session object and an associated unique random key.
 void deleteSession(Session session)
          Removes a session from the session manager.
 void deleteSession(java.lang.String sessionKey)
          Removes a session from the manager.
 boolean getEmptySessionPath()
          Return value determins whether to use empty path (/) as session cookie path attribute value!
 boolean getEncodeFirstUrl()
          Returns the url encoding rule for the first application page (true/false).
 java.lang.String getEncodeUrlState()
          Returns the url encoding state.
 Session getSession(java.lang.String sessionKey)
          Returns the Session object associated with the specified session key.
 Session getSession(java.lang.Thread thread, java.lang.String sessionKey)
          Returns the Session object associated with the specified session key.
 Session getSession(java.lang.Thread thread, java.lang.String sessionKey, com.lutris.appserver.server.httpPresentation.HttpPresentationComms comms)
          Returns the Session object associated with the specified session key.
 java.util.Enumeration getSessionKeys()
          Get an enumeration of all session keys.
 java.util.Enumeration getSessionKeys(User user)
          Lookup active sessions keys for a user.
 int maxSessionCount()
          Gets the maximum number of concurent sessions that existed at any time since this object was created, or resetMaxSessionCount() was called.
 java.util.Date maxSessionCountDate()
          Gets the time when the maximum refered to by maxSessionCount() occured.
 void passivateSession(java.lang.Thread thread, java.lang.String sessionKey)
          Puts a session into the 'passive' state.
 void resetMaxSessionCount()
          Reset the maximum session count.
 boolean sessionExists(java.lang.String sessionKey)
          Returns whether the Session object associated with the specified session key exists.
 void shutdown()
          Shutdown this session manager as required.
 

Field Detail

ENCODE_URL_NEVER

static final java.lang.String ENCODE_URL_NEVER
Indicates that url encoding of session ids is never preformed.

See Also:
getEncodeUrlState(), Constant Field Values

ENCODE_URL_ALWAYS

static final java.lang.String ENCODE_URL_ALWAYS
Indicates that url encoding of session ids is always preformed.

See Also:
getEncodeUrlState(), Constant Field Values

ENCODE_URL_AUTO

static final java.lang.String ENCODE_URL_AUTO
Indicates that url encoding of session ids is preformed only when cookies are disabled on the client browser. This is automatically detected.

See Also:
getEncodeUrlState(), Constant Field Values
Method Detail

createSession

Session createSession()
                      throws SessionException
Create a new Session object and an associated unique random key. No User object is initially associated with the session (getUser() returns null).

Returns:
session The new Session object.
Throws:
SessionException - if the session cannot be created.
See Also:
Session

createSession

Session createSession(java.lang.String ipPortToken)
                      throws SessionException
Create a new Session object and an associated unique random key. No User object is initially associated with the session (getUser() returns null).

Parameters:
ipPortToken - The base64 encoded IP and Port number to include in session key
Returns:
session The new Session object.
Throws:
SessionException - if the session cannot be created.
See Also:
Session

createSession

Session createSession(com.lutris.appserver.server.httpPresentation.HttpPresentationComms comms)
                      throws SessionException
Create a new Session object and an associated unique random key. No User object is initially associated with the session (getUser() returns null).

Parameters:
comms - The presentations manager comms object with all request/response information in it.
Returns:
session The new Session object.
Throws:
SessionException - if the session cannot be created.
See Also:
Session

deleteSession

void deleteSession(Session session)
                   throws SessionException
Removes a session from the session manager.

Parameters:
session - The session object to delete.
Throws:
SessionException - if the session cannot be deleted.

deleteSession

void deleteSession(java.lang.String sessionKey)
                   throws SessionException
Removes a session from the manager.

Parameters:
sessionKey - the session key.
Throws:
SessionException - if the session cannot be deleted.

sessionExists

boolean sessionExists(java.lang.String sessionKey)
                      throws SessionException
Returns whether the Session object associated with the specified session key exists.

Parameters:
sessionKey - The String used to reference a Session object.
Returns:
If the key is associated with an active session, then return true, otherwise return false.
Throws:
SessionException - if the existence of the session cannot be determined.

getSession

Session getSession(java.lang.String sessionKey)
                   throws SessionException
Returns the Session object associated with the specified session key. The session is put in the 'active' state. If no Session object is associated with the key then this method returns null.

Parameters:
sessionKey - The String used to reference a Session object.
Returns:
If the key is associated with an active session, then the corresponding Session object is returned. Otherwise null is returned.
Throws:
SessionException - if the session cannot be retrieved.
See Also:
Session

getSession

Session getSession(java.lang.Thread thread,
                   java.lang.String sessionKey)
                   throws SessionException
Returns the Session object associated with the specified session key. The session is put in the 'active' state. If no Session object is associated with the key then this method returns null.

Parameters:
thread - the thread that should be associated with the session. Only this thread can subsequently put the session into the passive state.
sessionKey - The String used to reference a Session object.
Returns:
If the key is associated with an active session, then the corresponding Session object is returned. Otherwise null is returned.
Throws:
SessionException - if the session cannot be retrieved.
See Also:
Session

getSession

Session getSession(java.lang.Thread thread,
                   java.lang.String sessionKey,
                   com.lutris.appserver.server.httpPresentation.HttpPresentationComms comms)
                   throws SessionException
Returns the Session object associated with the specified session key. The session is put in the 'active' state. If no Session object is associated with the key then this method returns null.

Parameters:
thread - the thread that should be associated with the session. Only this thread can subsequently put the session into the passive state.
comms - The presentations manager comms object with all request/response information in it.
sessionKey - The String used to reference a Session object.
Returns:
If the key is associated with an active session, then the corresponding Session object is returned. Otherwise null is returned.
Throws:
SessionException - if the session cannot be retrieved.
See Also:
Session

getSessionKeys

java.util.Enumeration getSessionKeys(User user)
                                     throws SessionException
Lookup active sessions keys for a user. A given user may have multiple sessions associated with it.

Parameters:
user - The user to search for.
Returns:
An enumeration of the active sessions keys for the user.
Throws:
SessionException - if the sessions cannot be retrieved.

passivateSession

void passivateSession(java.lang.Thread thread,
                      java.lang.String sessionKey)
                      throws SessionException
Puts a session into the 'passive' state. A 'passive' session may be made persistent.

Parameters:
thread - the thread currently associate with the the session.
sessionKey - the session key for the session that will be made persistent.
Throws:
SessionException - if the session cannot be put into the passive state..

activeSessionCount

int activeSessionCount()
                       throws SessionException
Gets the number of currently active sessions.

Returns:
The number of currently active sessions.
Throws:
SessionException - if the active session count cannot be determined.

maxSessionCount

int maxSessionCount()
Gets the maximum number of concurent sessions that existed at any time since this object was created, or resetMaxSessionCount() was called. This is a historical highwater mark. If you do not implement this feature, return -1.

Returns:
The highwater mark for number of sessions, or -1.

maxSessionCountDate

java.util.Date maxSessionCountDate()
Gets the time when the maximum refered to by maxSessionCount() occured.

Returns:
The Date of when the maximum number of sessions occured.

resetMaxSessionCount

void resetMaxSessionCount()
                          throws SessionException
Reset the maximum session count. See maxSessionCount(). The highwater mark should be reset to the current number of sessions.

Throws:
SessionException - if the max session count cannot be reset.

getSessionKeys

java.util.Enumeration getSessionKeys()
                                     throws SessionException
Get an enumeration of all session keys.

Returns:
An enumeration of the session keys.
Throws:
SessionException - if the session keys cannot be retrieved.

shutdown

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


getEncodeUrlState

java.lang.String getEncodeUrlState()
Returns the url encoding state. Either Never Always Auto


getEmptySessionPath

boolean getEmptySessionPath()
Return value determins whether to use empty path (/) as session cookie path attribute value!

Returns:
Whether to use empty path for session cookies

getEncodeFirstUrl

boolean getEncodeFirstUrl()
Returns the url encoding rule for the first application page (true/false).


EAF 7.4 API