EAF 7.6 Implementation

com.lutris.appserver.server.sessionContainerAdapter
Class TomcatContainerAdapterSessionManager

java.lang.Object
  extended by com.lutris.appserver.server.sessionContainerAdapter.ContainerAdapterSessionManager
      extended by com.lutris.appserver.server.sessionContainerAdapter.TomcatContainerAdapterSessionManager
All Implemented Interfaces:
com.lutris.appserver.server.session.SessionManager, java.io.Serializable

public class TomcatContainerAdapterSessionManager
extends ContainerAdapterSessionManager

Version:
1.0
Author:
Milin Radivoj

Description:

an implementation of ContainerAdapterSessionManager specific to the Tomcat Servlet container. It uses reflection to obtain data from the Tomcat's session manager, which really manages the sessions
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.lutris.appserver.server.sessionContainerAdapter.ContainerAdapterSessionManager
CFG_ENCODE_FIRST_URL, CFG_ENCODE_URL_STATE, defaultEncodeUrlState, defaultMaxSessionIdleTime, encodeFirstUrl, encodeUrlState, maxSessionIdleTime, SESSION
 
Fields inherited from interface com.lutris.appserver.server.session.SessionManager
ENCODE_URL_ALWAYS, ENCODE_URL_AUTO, ENCODE_URL_NEVER
 
Constructor Summary
TomcatContainerAdapterSessionManager(com.lutris.appserver.server.Application application, com.lutris.util.Config config, com.lutris.logging.LogChannel logger)
           
 
Method Summary
 int activeSessionCount()
          Gets the number of currently active sessions.
 com.lutris.appserver.server.session.Session createSession()
          Creates a new session
 com.lutris.appserver.server.session.Session createSession(HttpPresentationComms comms)
          Creates a new session
 com.lutris.appserver.server.session.Session createSession(java.lang.String ipPortToken)
          Not implemented
 void deleteSession(com.lutris.appserver.server.session.Session parm1)
          Delete existing session
 void deleteSession(java.lang.String parm1)
          Delete existing session
 int expiredSessionCount()
           
 com.lutris.appserver.server.session.Session getSession(java.lang.String sessionId)
          Lookup the Session object associated with the specified session key.
 com.lutris.appserver.server.session.Session getSession(java.lang.Thread parm1, java.lang.String sessionId)
          Lookup the Session object associated with the specified session key.
 com.lutris.appserver.server.session.Session getSession(java.lang.Thread parm1, java.lang.String sessionId, HttpPresentationComms comms)
          Returns teh session object corresponding to the HttpPresentationComms
 java.util.Enumeration getSessionKeys()
          Get all of the active sessions Keys.
 java.util.Enumeration getSessionKeys(com.lutris.appserver.server.user.User parm1)
          Get all of the active sessions Keys.
 void initialize()
           
 int maxSessionCount()
          Gets the maximum number of concurent sessions that existed at any time
 java.util.Date maxSessionCountDate()
          Not implemented
 void resetMaxSessionCount()
          Reset the maximum session count.
 void shutdown()
          NOP
 
Methods inherited from class com.lutris.appserver.server.sessionContainerAdapter.ContainerAdapterSessionManager
getEmptySessionPath, getEncodeFirstUrl, getEncodeUrlState, getSession, getSession, passivateSession, sessionExists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TomcatContainerAdapterSessionManager

public TomcatContainerAdapterSessionManager(com.lutris.appserver.server.Application application,
                                            com.lutris.util.Config config,
                                            com.lutris.logging.LogChannel logger)
                                     throws com.lutris.appserver.server.session.SessionException
Throws:
com.lutris.appserver.server.session.SessionException
Method Detail

createSession

public com.lutris.appserver.server.session.Session createSession()
                                                          throws com.lutris.appserver.server.session.SessionException
Creates a new session

Specified by:
createSession in interface com.lutris.appserver.server.session.SessionManager
Overrides:
createSession in class ContainerAdapterSessionManager
Returns:
Seession
Throws:
com.lutris.appserver.server.session.SessionException

createSession

public com.lutris.appserver.server.session.Session createSession(java.lang.String ipPortToken)
                                                          throws com.lutris.appserver.server.session.SessionException
Not implemented

Specified by:
createSession in interface com.lutris.appserver.server.session.SessionManager
Overrides:
createSession in class ContainerAdapterSessionManager
Returns:
Throws:
com.lutris.appserver.server.session.SessionException

createSession

public com.lutris.appserver.server.session.Session createSession(HttpPresentationComms comms)
                                                          throws com.lutris.appserver.server.session.SessionException
Creates a new session

Specified by:
createSession in interface com.lutris.appserver.server.session.SessionManager
Overrides:
createSession in class ContainerAdapterSessionManager
Parameters:
comms - HttpPresentationComms that containes the HttpServletRequest
Returns:
Seession
Throws:
com.lutris.appserver.server.session.SessionException

deleteSession

public void deleteSession(com.lutris.appserver.server.session.Session parm1)
                   throws com.lutris.appserver.server.session.SessionException
Delete existing session

Specified by:
deleteSession in interface com.lutris.appserver.server.session.SessionManager
Overrides:
deleteSession in class ContainerAdapterSessionManager
Throws:
com.lutris.appserver.server.session.SessionException

deleteSession

public void deleteSession(java.lang.String parm1)
                   throws com.lutris.appserver.server.session.SessionException
Delete existing session

Specified by:
deleteSession in interface com.lutris.appserver.server.session.SessionManager
Overrides:
deleteSession in class ContainerAdapterSessionManager
Throws:
com.lutris.appserver.server.session.SessionException

getSession

public com.lutris.appserver.server.session.Session getSession(java.lang.String sessionId)
                                                       throws com.lutris.appserver.server.session.SessionException
Lookup the Session object associated with the specified session key.

Specified by:
getSession in interface com.lutris.appserver.server.session.SessionManager
Overrides:
getSession in class ContainerAdapterSessionManager
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:
com.lutris.appserver.server.session.SessionException - If the session cannot be retrieved.

getSession

public com.lutris.appserver.server.session.Session getSession(java.lang.Thread parm1,
                                                              java.lang.String sessionId)
                                                       throws com.lutris.appserver.server.session.SessionException
Lookup the Session object associated with the specified session key.

Specified by:
getSession in interface com.lutris.appserver.server.session.SessionManager
Overrides:
getSession in class ContainerAdapterSessionManager
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:
com.lutris.appserver.server.session.SessionException - If the session cannot be retrieved.

getSession

public com.lutris.appserver.server.session.Session getSession(java.lang.Thread parm1,
                                                              java.lang.String sessionId,
                                                              HttpPresentationComms comms)
                                                       throws com.lutris.appserver.server.session.SessionException
Returns teh session object corresponding to the HttpPresentationComms

Specified by:
getSession in interface com.lutris.appserver.server.session.SessionManager
Overrides:
getSession in class ContainerAdapterSessionManager
Parameters:
parm1 - ignored
sessionId - ignored
comms - HttpPresentationComms object that contains HttpServletRequest from which the session is extracted
Returns:
the Session object
Throws:
com.lutris.appserver.server.session.SessionException

getSessionKeys

public java.util.Enumeration getSessionKeys(com.lutris.appserver.server.user.User parm1)
                                     throws com.lutris.appserver.server.session.SessionException
Get all of the active sessions Keys.

Specified by:
getSessionKeys in interface com.lutris.appserver.server.session.SessionManager
Overrides:
getSessionKeys in class ContainerAdapterSessionManager
Returns:
An enumeration of the active sessions Keys.
Throws:
com.lutris.appserver.server.session.SessionException - If the sessions cannot be retrieved.

activeSessionCount

public int activeSessionCount()
                       throws com.lutris.appserver.server.session.SessionException
Gets the number of currently active sessions.

Specified by:
activeSessionCount in interface com.lutris.appserver.server.session.SessionManager
Overrides:
activeSessionCount in class ContainerAdapterSessionManager
Returns:
The number of currently active sessions.
Throws:
com.lutris.appserver.server.session.SessionException

expiredSessionCount

public int expiredSessionCount()
                        throws com.lutris.appserver.server.session.SessionException
Returns:
the number of expired sessions (not including the sessions forced to expire), or -1 if it can not be determined
Throws:
com.lutris.appserver.server.session.SessionException

maxSessionCount

public int maxSessionCount()
Gets the maximum number of concurent sessions that existed at any time

Specified by:
maxSessionCount in interface com.lutris.appserver.server.session.SessionManager
Overrides:
maxSessionCount in class ContainerAdapterSessionManager
Returns:
The number of sessions, or -1.

maxSessionCountDate

public java.util.Date maxSessionCountDate()
Not implemented

Specified by:
maxSessionCountDate in interface com.lutris.appserver.server.session.SessionManager
Overrides:
maxSessionCountDate in class ContainerAdapterSessionManager
Returns:

resetMaxSessionCount

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

Specified by:
resetMaxSessionCount in interface com.lutris.appserver.server.session.SessionManager
Overrides:
resetMaxSessionCount in class ContainerAdapterSessionManager
Throws:
com.lutris.appserver.server.session.SessionException - if the max session count cannot be reset.

getSessionKeys

public java.util.Enumeration getSessionKeys()
                                     throws com.lutris.appserver.server.session.SessionException
Get all of the active sessions Keys.

Specified by:
getSessionKeys in interface com.lutris.appserver.server.session.SessionManager
Overrides:
getSessionKeys in class ContainerAdapterSessionManager
Returns:
An enumeration of the active sessions Keys.
Throws:
com.lutris.appserver.server.session.SessionException - If the sessions cannot be retrieved.

initialize

public void initialize()
                throws com.lutris.appserver.server.session.SessionException
Throws:
com.lutris.appserver.server.session.SessionException

shutdown

public void shutdown()
Description copied from class: ContainerAdapterSessionManager
NOP

Specified by:
shutdown in interface com.lutris.appserver.server.session.SessionManager
Overrides:
shutdown in class ContainerAdapterSessionManager

EAF 7.6 Implementation