EAF 7.4 Implementation

com.lutris.appserver.server.sessionContainerAdapter
Class ContainerAdapterSession

java.lang.Object
  extended by com.lutris.appserver.server.sessionContainerAdapter.ContainerAdapterSession
All Implemented Interfaces:
com.lutris.appserver.server.session.Session, java.io.Serializable, java.util.EventListener, javax.servlet.http.HttpSessionActivationListener, javax.servlet.http.HttpSessionBindingListener

public class ContainerAdapterSession
extends java.lang.Object
implements com.lutris.appserver.server.session.Session, javax.servlet.http.HttpSessionActivationListener, javax.servlet.http.HttpSessionBindingListener, java.io.Serializable

Description:

Session object, used to keep the session data

Version:
1.0
See Also:
Serialized Form

Field Summary
protected  java.lang.String SESSION
          Name of the session object in the HttpSession
 
Constructor Summary
ContainerAdapterSession()
          Default constructor
ContainerAdapterSession(ContainerAdapterSessionManager sessionManager, javax.servlet.http.HttpSession httpSession)
           
 
Method Summary
 void clearUser()
          clears the user object
 javax.servlet.http.HttpSession getHttpSession()
           
 long getMaxIdleTime()
          Obtain the maximum idle time for this object.
 SessionData getSessionData()
           
 java.lang.String getSessionKey()
           
 com.lutris.appserver.server.session.SessionManager getSessionManager()
           
 long getTimeCreated()
           
 long getTimeLastUsed()
          Obtain the time of last use for this object.
 com.lutris.appserver.server.user.User getUser()
           
 boolean isNew()
           
 void sessionDidActivate(javax.servlet.http.HttpSessionEvent event)
           
 void sessionWillPassivate(javax.servlet.http.HttpSessionEvent event)
           
 void setHttpSession(javax.servlet.http.HttpSession httpSession)
           
 void setMaxIdleTime(int maxIdleTime)
          Set the maximum idle time for this object.
 void setSessionData(SessionData sessionData)
          puts the SessionData into this session
 void setSessionManager(com.lutris.appserver.server.session.SessionManager sessionManager)
           
protected  void setTimeCreated(long cTime)
           
 void setUser(com.lutris.appserver.server.user.User user)
          Sets the user
 java.lang.String toString()
           
 void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
           
 void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SESSION

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

Constructor Detail

ContainerAdapterSession

public ContainerAdapterSession()
Default constructor


ContainerAdapterSession

public ContainerAdapterSession(ContainerAdapterSessionManager sessionManager,
                               javax.servlet.http.HttpSession httpSession)
Parameters:
sessionManager - SessionManager that is used to create this Session object
sessionKey - The identifiction of the session
Method Detail

getUser

public com.lutris.appserver.server.user.User getUser()
Specified by:
getUser in interface com.lutris.appserver.server.session.Session
Returns:
the User object;

setUser

public void setUser(com.lutris.appserver.server.user.User user)
             throws com.lutris.appserver.server.session.SessionException
Sets the user

Specified by:
setUser in interface com.lutris.appserver.server.session.Session
Parameters:
user - - the user object of the session
Throws:
com.lutris.appserver.server.session.SessionException

clearUser

public void clearUser()
               throws com.lutris.appserver.server.session.SessionException
clears the user object

Specified by:
clearUser in interface com.lutris.appserver.server.session.Session
Throws:
com.lutris.appserver.server.session.SessionException

getSessionKey

public java.lang.String getSessionKey()
Specified by:
getSessionKey in interface com.lutris.appserver.server.session.Session
Returns:
the session identification

getTimeCreated

public long getTimeCreated()
Returns:
the session creation time

getTimeLastUsed

public long getTimeLastUsed()
Obtain the time of last use for this object. The time is in milliseconds since Midnight, Jan 1, 1970 (epoch).

Returns:
The time of last use since epoch for this object.

setTimeCreated

protected void setTimeCreated(long cTime)

getMaxIdleTime

public long getMaxIdleTime()
Obtain the maximum idle time for this object. Zero (or negative) indicates that sessions may be idle indefinetly.

Returns:
The maximum number of milliseconds this session may be idle.

setMaxIdleTime

public void setMaxIdleTime(int maxIdleTime)
Set the maximum idle time for this object. Set this to zero (or negative) to disable idle checking.

Parameters:
maxIdleTime - The maximum number of milliseconds this session may be idle, or zero (or negative) to allow sessions to be idle indefinetly.

getSessionManager

public com.lutris.appserver.server.session.SessionManager getSessionManager()
Specified by:
getSessionManager in interface com.lutris.appserver.server.session.Session
Returns:
the SessionManager used to create this session

setSessionManager

public void setSessionManager(com.lutris.appserver.server.session.SessionManager sessionManager)

getSessionData

public SessionData getSessionData()
Specified by:
getSessionData in interface com.lutris.appserver.server.session.Session
Returns:
the SessionData

setSessionData

public void setSessionData(SessionData sessionData)
puts the SessionData into this session

Parameters:
sessionData -

isNew

public boolean isNew()
Specified by:
isNew in interface com.lutris.appserver.server.session.Session

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getHttpSession

public javax.servlet.http.HttpSession getHttpSession()
Specified by:
getHttpSession in interface com.lutris.appserver.server.session.Session

setHttpSession

public void setHttpSession(javax.servlet.http.HttpSession httpSession)
Specified by:
setHttpSession in interface com.lutris.appserver.server.session.Session

valueBound

public void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
Specified by:
valueBound in interface javax.servlet.http.HttpSessionBindingListener

valueUnbound

public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
Specified by:
valueUnbound in interface javax.servlet.http.HttpSessionBindingListener

sessionWillPassivate

public void sessionWillPassivate(javax.servlet.http.HttpSessionEvent event)
Specified by:
sessionWillPassivate in interface javax.servlet.http.HttpSessionActivationListener

sessionDidActivate

public void sessionDidActivate(javax.servlet.http.HttpSessionEvent event)
Specified by:
sessionDidActivate in interface javax.servlet.http.HttpSessionActivationListener

EAF 7.4 Implementation