Package de.uplanet.lucy.server.session
Class AbstractSession
java.lang.Object
de.uplanet.lucy.server.session.AbstractSession
- All Implemented Interfaces:
ISession
-
Field Summary
Fields inherited from interface de.uplanet.lucy.server.session.ISession
DEFAULT_TIMEOUT
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(de.uplanet.lucy.server.session.ISessionListener p_listener, boolean p_bWeak) Add a listener for session events.boolean
containsKey
(String p_strKey) Test if a certain session variable exists.Get a session variable.Get a session variable or the specified fallback value.long
Get the time when this session was created.getId()
Get the unique session identifier.Get a reference to the internal collection of session variables.Get the subject that is associated with this session.boolean
Check if the session is logged out.boolean
isStale()
Check if the session has timed out.keySet()
Get a set that contains all session variable names.void
Set a session variable.void
Remove a session variable.void
For internal use only.abstract void
setManager
(de.uplanet.lucy.server.session.ISessionManager p_manager) Associates this session with a session manager.void
setSubject
(Subject p_subject) abstract void
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.uplanet.lucy.server.session.ISession
getAuthConfigName, getLastAccessTime, getTimeout, getUser, isAnonymous, isStale, logout, setTimeout, touch
-
Method Details
-
setManager
public abstract void setManager(de.uplanet.lucy.server.session.ISessionManager p_manager) Associates this session with a session manager.- Parameters:
p_manager
- The manager to set.
-
reset
For internal use only. -
getId
Description copied from interface:ISession
Get the unique session identifier. -
getSubject
Description copied from interface:ISession
Get the subject that is associated with this session.- Specified by:
getSubject
in interfaceISession
- Returns:
- The associated subject.
-
setSubject
-
setUser
-
containsKey
Description copied from interface:ISession
Test if a certain session variable exists.- Specified by:
containsKey
in interfaceISession
- Parameters:
p_strKey
- The name of the session variable.
-
keySet
Description copied from interface:ISession
Get a set that contains all session variable names. -
getSessionVars
Get a reference to the internal collection of session variables.- Returns:
- A reference to the internal collection of session variables.
-
get
Description copied from interface:ISession
Get a session variable. -
get
Description copied from interface:ISession
Get a session variable or the specified fallback value. -
put
Description copied from interface:ISession
Set a session variable. -
remove
Description copied from interface:ISession
Remove a session variable. -
getCreationTime
public long getCreationTime()Description copied from interface:ISession
Get the time when this session was created.- Specified by:
getCreationTime
in interfaceISession
- Returns:
- The creation time, measured in milliseconds, between the current time and 01-01-1970 00:00:00 UTC.
-
isLoggedOut
public boolean isLoggedOut()Description copied from interface:ISession
Check if the session is logged out.- Specified by:
isLoggedOut
in interfaceISession
- Returns:
true
is the session is logged out, orfalse
otherwise.
-
isStale
public boolean isStale()Description copied from interface:ISession
Check if the session has timed out.The natural implementation of this method will return
isStale(System.currentTimeMillis())
. -
addListener
public void addListener(de.uplanet.lucy.server.session.ISessionListener p_listener, boolean p_bWeak) Description copied from interface:ISession
Add a listener for session events.- Specified by:
addListener
in interfaceISession
- Parameters:
p_listener
- The session listener to add.p_bWeak
-true
if the listener should be weakly referenced,false
otherwise.
-