|
EAF 7.6 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lutris.appserver.server.sessionEnhydra.BasicSession
public class BasicSession
The standard implementation of the StandardSession interface. The session reflects and instance of a client interacting with the application. A BasicSession maybe associated with a user or exist in a unauthenticated state. The session manager associated with a BasicSession object must be a StandardSessionManager or a derivation.
Field Summary | |
---|---|
SessionData |
data
The application specific data for this session. |
protected StandardSessionManager |
sessionManager
|
protected com.lutris.appserver.server.user.User |
user
|
Constructor Summary | |
---|---|
|
BasicSession()
Need the following constructor in order to serialize? |
protected |
BasicSession(StandardSessionManager sessionManager,
java.lang.String sessionKey)
Construct a new session. |
protected |
BasicSession(StandardSessionManager sessionManager,
java.lang.String sessionKey,
SessionData sessionData)
Construct a new session. |
Method Summary | |
---|---|
void |
clearUser()
Remove the user association with this session. |
int |
decrementRefCount()
Returns the number of active references to this object. |
java.lang.Object |
getAttribute(java.lang.String name)
|
java.util.Enumeration |
getAttributeNames()
|
long |
getCreationTime()
|
javax.servlet.http.HttpSession |
getHttpSession()
|
java.lang.String |
getId()
|
long |
getLastAccessedTime()
|
long |
getMaxIdleTime()
Obtain the maximum idle time for this object. |
int |
getMaxInactiveInterval()
|
long |
getMaxNoUserIdleTime()
Obtain the maximum idle time when a User object
is not associated with the session. |
int |
getRefCount()
Returns the number of active references to this object. |
javax.servlet.ServletContext |
getServletContext()
|
javax.servlet.http.HttpSessionContext |
getSessionContext()
|
SessionData |
getSessionData()
Obtain the application specific data for this session. |
java.lang.String |
getSessionKey()
Obtain the unique key associated with this session. |
com.lutris.appserver.server.session.SessionManager |
getSessionManager()
Obtain the session manager associated with this session. |
long |
getTimeCreated()
Obtain the creation time for this object. |
long |
getTimeExpires()
Obtain the time of expiry for this object. |
long |
getTimeLastUsed()
Obtain the time of last use for this object. |
com.lutris.appserver.server.user.User |
getUser()
Obtain the user associated with this session. |
java.lang.Object |
getValue(java.lang.String name)
|
java.lang.String[] |
getValueNames()
|
int |
incrementRefCount()
Returns the number of active references to this object. |
void |
invalidate()
|
boolean |
isNew()
Returns true if the session is new. |
void |
putValue(java.lang.String name,
java.lang.Object value)
|
void |
removeAttribute(java.lang.String name)
|
void |
removeValue(java.lang.String name)
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
|
void |
setHttpSession(javax.servlet.http.HttpSession httpSession)
|
void |
setMaxIdleTime(long maxIdleTime)
Set the maximum idle time for this object. |
void |
setMaxInactiveInterval(int interval)
|
void |
setMaxNoUserIdleTime(long maxIdleTime)
set the maximum idle time when a User object
is not associated with the session. |
void |
setTimeExpires(long timeExpires)
Set the time of expiry for this object. |
void |
setUser(com.lutris.appserver.server.user.User sessionUser)
Set the user associated with this session. |
java.lang.String |
toString()
Prints a string representation of this object. |
void |
touch()
Set the "last used" timestamp to the current time, resetting the idle period. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected transient StandardSessionManager sessionManager
protected com.lutris.appserver.server.user.User user
public SessionData data
Constructor Detail |
---|
public BasicSession()
protected BasicSession(StandardSessionManager sessionManager, java.lang.String sessionKey)
StandardSessionManager
.
sessionManager
- The session manager that will manager this session.sessionKey
- The unique session key associated with the session.protected BasicSession(StandardSessionManager sessionManager, java.lang.String sessionKey, SessionData sessionData)
StandardSessionManager
.
sessionManager
- The session manager that will manager this session.sessionKey
- The unique session key associated with the session.sessionData
- The session data to associate with this session.Method Detail |
---|
public void touch()
touch
in interface com.lutris.appserver.server.sessionEnhydra.StandardSession
public com.lutris.appserver.server.user.User getUser()
getUser
in interface com.lutris.appserver.server.session.Session
null
if the
session is not logged in.public void setUser(com.lutris.appserver.server.user.User sessionUser) throws com.lutris.appserver.server.session.SessionException
SessionManager
.
If it is neccessary to prevent a user from logging on multiple times,
this can be accomplished by synchronizing on the
Sessionmanager
object and enquiring about the number of
users associated with a session. It is then possible to delete other
sessions before adding a new session.
setUser
in interface com.lutris.appserver.server.session.Session
user
- the user object to associate with the session.
com.lutris.appserver.server.session.SessionException
- if the user cannot be associated with the session.public void clearUser() throws com.lutris.appserver.server.session.SessionException
SessionManager
.
clearUser
in interface com.lutris.appserver.server.session.Session
com.lutris.appserver.server.session.SessionException
- if an error occurs.public java.lang.String getSessionKey()
getSessionKey
in interface com.lutris.appserver.server.session.Session
public com.lutris.appserver.server.session.SessionManager getSessionManager()
getSessionManager
in interface com.lutris.appserver.server.session.Session
public SessionData getSessionData()
getSessionData
in interface com.lutris.appserver.server.session.Session
public long getTimeCreated()
getTimeCreated
in interface com.lutris.appserver.server.sessionEnhydra.StandardSession
public long getTimeLastUsed()
getTimeLastUsed
in interface com.lutris.appserver.server.sessionEnhydra.StandardSession
public long getTimeExpires()
getTimeExpires
in interface com.lutris.appserver.server.sessionEnhydra.StandardSession
public void setTimeExpires(long timeExpires)
setTimeExpires
in interface com.lutris.appserver.server.sessionEnhydra.StandardSession
timeLastUsed
- The time of expiry since epoch.public long getMaxIdleTime()
getMaxIdleTime
in interface com.lutris.appserver.server.sessionEnhydra.StandardSession
public void setMaxIdleTime(long maxIdleTime)
setMaxIdleTime
in interface com.lutris.appserver.server.sessionEnhydra.StandardSession
maxIdleTime
- The maximum number of milliseconds this
session may be idle, or zero (or negative) to allow sessions to be idle
indefinetly.public long getMaxNoUserIdleTime()
User
object
is not associated with the session. Zero (or negative) indicates that
sessions may be idle indefinetly.
getMaxNoUserIdleTime
in interface com.lutris.appserver.server.sessionEnhydra.StandardSession
public void setMaxNoUserIdleTime(long maxIdleTime)
User
object
is not associated with the session. Set this to zero (or negative) to
disable idle checking.
setMaxNoUserIdleTime
in interface com.lutris.appserver.server.sessionEnhydra.StandardSession
maxIdleTime
- The maximum number of milliseconds this
session may be idle.public boolean isNew()
isNew
in interface com.lutris.appserver.server.session.Session
isNew
in interface javax.servlet.http.HttpSession
public int getRefCount()
public int incrementRefCount()
public int decrementRefCount()
public java.lang.String toString()
toString
in class java.lang.Object
public javax.servlet.http.HttpSession getHttpSession()
getHttpSession
in interface com.lutris.appserver.server.session.Session
getHttpSession
in interface com.lutris.appserver.server.sessionEnhydra.StandardSession
public void setHttpSession(javax.servlet.http.HttpSession httpSession)
setHttpSession
in interface com.lutris.appserver.server.session.Session
public long getCreationTime()
getCreationTime
in interface javax.servlet.http.HttpSession
public java.lang.String getId()
getId
in interface javax.servlet.http.HttpSession
public long getLastAccessedTime()
getLastAccessedTime
in interface javax.servlet.http.HttpSession
public void setMaxInactiveInterval(int interval)
setMaxInactiveInterval
in interface javax.servlet.http.HttpSession
public int getMaxInactiveInterval()
getMaxInactiveInterval
in interface javax.servlet.http.HttpSession
public javax.servlet.http.HttpSessionContext getSessionContext()
getSessionContext
in interface javax.servlet.http.HttpSession
public javax.servlet.ServletContext getServletContext()
getServletContext
in interface javax.servlet.http.HttpSession
public java.lang.Object getAttribute(java.lang.String name)
getAttribute
in interface javax.servlet.http.HttpSession
public java.lang.Object getValue(java.lang.String name)
getValue
in interface javax.servlet.http.HttpSession
public java.util.Enumeration getAttributeNames()
getAttributeNames
in interface javax.servlet.http.HttpSession
public java.lang.String[] getValueNames()
getValueNames
in interface javax.servlet.http.HttpSession
public void setAttribute(java.lang.String name, java.lang.Object value)
setAttribute
in interface javax.servlet.http.HttpSession
public void putValue(java.lang.String name, java.lang.Object value)
putValue
in interface javax.servlet.http.HttpSession
public void removeAttribute(java.lang.String name)
removeAttribute
in interface javax.servlet.http.HttpSession
public void removeValue(java.lang.String name)
removeValue
in interface javax.servlet.http.HttpSession
public void invalidate()
invalidate
in interface javax.servlet.http.HttpSession
|
EAF 7.6 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |