EAF 7.4 Implementation

com.lutris.appserver.server.sessionContainerAdapter
Class ContainerAdapterSessionManager

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

public class ContainerAdapterSessionManager
extends java.lang.Object
implements com.lutris.appserver.server.session.SessionManager, java.io.Serializable

Description:

Simple session manager to be used with servlet container capable of managing their sessions. Uses HttpSession to keep the session data. The sessions are completely managed by the session container. To use this class as a session manager, enter it as a value of the SessionManager.Class in the config file of the application - e.g. SessionManager.Class = com.lutris.appserver.server.sessionContainerAdapter.ContainerAdapterSessionManager

Version:
1.0
See Also:
Serialized Form

Field Summary
static java.lang.String CFG_ENCODE_FIRST_URL
          Url encoding for first page state (to force it or not) CFG_ENCODE_URL_STATE must not be set to NEVER for this parameter to take efect
static java.lang.String CFG_ENCODE_URL_STATE
          The name of the config variable for the url encoding state
protected static java.lang.String defaultEncodeUrlState
          Indicates url encoding status.
protected static int defaultMaxSessionIdleTime
          Default maximum session idle time, in seconds.
protected  boolean encodeFirstUrl
          Url encoding for first page state (force it or not)
protected  java.lang.String encodeUrlState
          The url encoding state.
protected  int maxSessionIdleTime
          Maximum session idle time, in seconds.
protected  java.lang.String SESSION
          Name of the session object in the HttpSession
 
Fields inherited from interface com.lutris.appserver.server.session.SessionManager
ENCODE_URL_ALWAYS, ENCODE_URL_AUTO, ENCODE_URL_NEVER
 
Constructor Summary
ContainerAdapterSessionManager(com.lutris.appserver.server.Application application, com.lutris.util.Config config, com.lutris.logging.LogChannel logger)
           
 
Method Summary
 int activeSessionCount()
          Not implemented, since this session manager doesn't really control the sessions - they are managed by the servlet container
 com.lutris.appserver.server.session.Session createSession()
          Creates a new session
 com.lutris.appserver.server.session.Session createSession(HttpPresentationComms comms)
          Extracts the SessionId from the httpSession and creates a newSession object with that Id
 com.lutris.appserver.server.session.Session createSession(java.lang.String ipport)
          Not implemented - backward compatibility with the API specification
 void deleteSession(com.lutris.appserver.server.session.Session parm1)
          Not implemented, since this session manager doesn't really control the sessions - they are managed by the servlet container
 void deleteSession(java.lang.String parm1)
          Not implemented, since this session manager doesn't really control the sessions - they are managed by the servlet container
 boolean getEmptySessionPath()
          Not used for container adapter session management scenario! Container itself should take care about this.
 boolean getEncodeFirstUrl()
          Returns the url encoding rule for the first application page (true/false).
 java.lang.String getEncodeUrlState()
           
 com.lutris.appserver.server.session.Session getSession(java.lang.String sessionId)
          Not implemented, since the sessions are kept at the container side
 com.lutris.appserver.server.session.Session getSession(java.lang.String sessionId, HttpPresentationComms comms)
          Returns teh session object corresponding to the HttpPresentationComms
 com.lutris.appserver.server.session.Session getSession(java.lang.String sessionId, javax.servlet.http.HttpServletRequest servletRequest)
          returns the session object contained in the HttpServletRequest
 com.lutris.appserver.server.session.Session getSession(java.lang.Thread parm1, java.lang.String sessionId)
          Not implemented, needed for the compatibility with the API specification
 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()
          Not implemented, this information is kept at the servlet container side
 java.util.Enumeration getSessionKeys(com.lutris.appserver.server.user.User parm1)
          Not implemented, this information is kept at the servlet container side
 int maxSessionCount()
          Not implemented, this information is kept at the servlet container side
 java.util.Date maxSessionCountDate()
          Not implemented
 void passivateSession(java.lang.Thread parm1, java.lang.String parm2)
          Not implemented, since this session manager doesn't really control the sessions - they are managed by the servlet container
 void resetMaxSessionCount()
          Not implemented, since this session manager doesn't really control the sessions - they are managed by the servlet container
 boolean sessionExists(java.lang.String sessionId)
           
 void shutdown()
          NOP
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultEncodeUrlState

protected static java.lang.String defaultEncodeUrlState
Indicates url encoding status. Assumes that comms.response.writeHTML(HTMLDocument doc) is used to commit the response to the client. The default is to Auto.
Never indicates urls are never encoded with session keys. This indicates that session cookies have to be used or no session state can be maintained.
Always indicates that urls are always encoded with session keys. Session cookies are never used.
Auto indicates that session cookies will be if available. If not, urls will automatically be encoded.

See Also:
getEncodeUrlState()

CFG_ENCODE_URL_STATE

public static final java.lang.String CFG_ENCODE_URL_STATE
The name of the config variable for the url encoding state

See Also:
Constant Field Values

CFG_ENCODE_FIRST_URL

public static final java.lang.String CFG_ENCODE_FIRST_URL
Url encoding for first page state (to force it or not) CFG_ENCODE_URL_STATE must not be set to NEVER for this parameter to take efect

See Also:
Constant Field Values

encodeUrlState

protected java.lang.String encodeUrlState
The url encoding state. Either Never Always Auto.


SESSION

protected java.lang.String SESSION
Name of the session object in the HttpSession


defaultMaxSessionIdleTime

protected static int defaultMaxSessionIdleTime
Default maximum session idle time, in seconds. A derived SessionManager may override this value to use the default expiration logic or override isSessionExpired to define custom expiration logic. A value less-than or equal to zero disables idle checking. Default value is 30 minutes.

See Also:
#getMaxSessionIdleTime

maxSessionIdleTime

protected int maxSessionIdleTime
Maximum session idle time, in seconds. A value less-than or equal to zero disables idle checking.

See Also:
#getMaxSessionIdleTime

encodeFirstUrl

protected boolean encodeFirstUrl
Url encoding for first page state (force it or not)

Constructor Detail

ContainerAdapterSessionManager

public ContainerAdapterSessionManager(com.lutris.appserver.server.Application application,
                                      com.lutris.util.Config config,
                                      com.lutris.logging.LogChannel logger)
                               throws com.lutris.appserver.server.session.SessionException
Parameters:
application - application that uses this session manager
config - the application config object
logger - logger, ignored, since some common loggers are not serilizable
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
Returns:
Seession
Throws:
com.lutris.appserver.server.session.SessionException

createSession

public com.lutris.appserver.server.session.Session createSession(java.lang.String ipport)
                                                          throws com.lutris.appserver.server.session.SessionException
Not implemented - backward compatibility with the API specification

Specified by:
createSession in interface com.lutris.appserver.server.session.SessionManager
Parameters:
ipport -
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
Extracts the SessionId from the httpSession and creates a newSession object with that Id

Specified by:
createSession in interface com.lutris.appserver.server.session.SessionManager
Parameters:
comms - HttpPresentationComms that containes the HttpServletRequest
Returns:
new Session
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
Not implemented, since this session manager doesn't really control the sessions - they are managed by the servlet container

Specified by:
deleteSession in interface com.lutris.appserver.server.session.SessionManager
Parameters:
parm1 -
Throws:
com.lutris.appserver.server.session.SessionException

deleteSession

public void deleteSession(java.lang.String parm1)
                   throws com.lutris.appserver.server.session.SessionException
Not implemented, since this session manager doesn't really control the sessions - they are managed by the servlet container

Specified by:
deleteSession in interface com.lutris.appserver.server.session.SessionManager
Parameters:
parm1 -
Throws:
com.lutris.appserver.server.session.SessionException

sessionExists

public boolean sessionExists(java.lang.String sessionId)
                      throws com.lutris.appserver.server.session.SessionException
Specified by:
sessionExists in interface com.lutris.appserver.server.session.SessionManager
Parameters:
sessionId -
Returns:
always true
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
Not implemented, since the sessions are kept at the container side

Specified by:
getSession in interface com.lutris.appserver.server.session.SessionManager
Parameters:
sessionId -
Returns:
Throws:
com.lutris.appserver.server.session.SessionException

getSession

public com.lutris.appserver.server.session.Session getSession(java.lang.String sessionId,
                                                              javax.servlet.http.HttpServletRequest servletRequest)
                                                       throws com.lutris.appserver.server.session.SessionException
returns the session object contained in the HttpServletRequest

Parameters:
sessionId - - ignored, kept for the backward compatibility
servletRequest - HttpServletRequest from which the session is extracted
Returns:
the Session object
Throws:
com.lutris.appserver.server.session.SessionException

getSession

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

Parameters:
sessionId - ignored, kept for the backward compatibility
comms - HttpPresentationComms object that contains HttpServletRequest from which the session is extracted
Returns:
the Session object
Throws:
com.lutris.appserver.server.session.SessionException

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
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

getSession

public com.lutris.appserver.server.session.Session getSession(java.lang.Thread parm1,
                                                              java.lang.String sessionId)
                                                       throws com.lutris.appserver.server.session.SessionException
Not implemented, needed for the compatibility with the API specification

Specified by:
getSession in interface com.lutris.appserver.server.session.SessionManager
Parameters:
parm1 -
sessionId -
Returns:
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
Not implemented, this information is kept at the servlet container side

Specified by:
getSessionKeys in interface com.lutris.appserver.server.session.SessionManager
Parameters:
parm1 -
Returns:
Throws:
com.lutris.appserver.server.session.SessionException

passivateSession

public void passivateSession(java.lang.Thread parm1,
                             java.lang.String parm2)
                      throws com.lutris.appserver.server.session.SessionException
Not implemented, since this session manager doesn't really control the sessions - they are managed by the servlet container

Specified by:
passivateSession in interface com.lutris.appserver.server.session.SessionManager
Parameters:
parm1 -
parm2 -
Throws:
com.lutris.appserver.server.session.SessionException

activeSessionCount

public int activeSessionCount()
                       throws com.lutris.appserver.server.session.SessionException
Not implemented, since this session manager doesn't really control the sessions - they are managed by the servlet container

Specified by:
activeSessionCount in interface com.lutris.appserver.server.session.SessionManager
Returns:
Throws:
com.lutris.appserver.server.session.SessionException

maxSessionCount

public int maxSessionCount()
Not implemented, this information is kept at the servlet container side

Specified by:
maxSessionCount in interface com.lutris.appserver.server.session.SessionManager
Returns:

maxSessionCountDate

public java.util.Date maxSessionCountDate()
Not implemented

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

resetMaxSessionCount

public void resetMaxSessionCount()
                          throws com.lutris.appserver.server.session.SessionException
Not implemented, since this session manager doesn't really control the sessions - they are managed by the servlet container

Specified by:
resetMaxSessionCount in interface com.lutris.appserver.server.session.SessionManager
Throws:
com.lutris.appserver.server.session.SessionException

getSessionKeys

public java.util.Enumeration getSessionKeys()
                                     throws com.lutris.appserver.server.session.SessionException
Not implemented, this information is kept at the servlet container side

Specified by:
getSessionKeys in interface com.lutris.appserver.server.session.SessionManager
Returns:
Throws:
com.lutris.appserver.server.session.SessionException

shutdown

public void shutdown()
NOP

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

getEncodeUrlState

public java.lang.String getEncodeUrlState()
Specified by:
getEncodeUrlState in interface com.lutris.appserver.server.session.SessionManager
Returns:
the value indicating the url encoding status

getEmptySessionPath

public boolean getEmptySessionPath()
Not used for container adapter session management scenario! Container itself should take care about this.

Specified by:
getEmptySessionPath in interface com.lutris.appserver.server.session.SessionManager
Returns:
Whether to use empty path for session cookies

getEncodeFirstUrl

public boolean getEncodeFirstUrl()
Returns the url encoding rule for the first application page (true/false). CFG_ENCODE_URL_STATE must not be set to NEVER for this parameter to take efect

Specified by:
getEncodeFirstUrl in interface com.lutris.appserver.server.session.SessionManager

EAF 7.4 Implementation