Package de.uplanet.lucy.server.session
Class AbstractSession
- java.lang.Object
-
- de.uplanet.lucy.server.session.AbstractSession
-
-
Field Summary
-
Fields inherited from interface de.uplanet.lucy.server.session.ISession
DEFAULT_TIMEOUT
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddListener(de.uplanet.lucy.server.session.ISessionListener p_listener, boolean p_bWeak)Add a listener for session events.booleancontainsKey(String p_strKey)Test if a certain session variable exists.Objectget(String p_strKey)Get a session variable.Objectget(String p_strKey, Object p_objFallback)Get a session variable or the specified fallback value.longgetCreationTime()Get the time when this session was created.StringgetId()Get the unique session identifier.abstract Map<String,Object>getSessionVars()Get a reference to the internal collection of session variables.SubjectgetSubject()Get the subject that is associated with this session.booleanisLoggedOut()Check if the session is logged out.booleanisStale()Check if the session has timed out.Set<String>keySet()Get a set that contains all session variable names.voidput(String p_strKey, Object p_objValue)Set a session variable.voidremove(String p_strKey)Remove a session variable.voidreset(String p_strNewSessionId)For internal use only.abstract voidsetManager(de.uplanet.lucy.server.session.ISessionManager p_manager)Associates this session with a session manager.voidsetSubject(Subject p_subject)abstract voidsetUser(IUser p_user)-
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 Detail
-
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
public void reset(String p_strNewSessionId)
For internal use only.
-
getId
public String getId()
Description copied from interface:ISessionGet the unique session identifier.
-
getSubject
public Subject getSubject()
Description copied from interface:ISessionGet the subject that is associated with this session.- Specified by:
getSubjectin interfaceISession- Returns:
- The associated subject.
-
setSubject
public void setSubject(Subject p_subject)
-
setUser
public abstract void setUser(IUser p_user)
-
containsKey
public boolean containsKey(String p_strKey)
Description copied from interface:ISessionTest if a certain session variable exists.- Specified by:
containsKeyin interfaceISession- Parameters:
p_strKey- The name of the session variable.
-
keySet
public Set<String> keySet()
Description copied from interface:ISessionGet a set that contains all session variable names.
-
getSessionVars
public abstract Map<String,Object> getSessionVars()
Get a reference to the internal collection of session variables.- Returns:
- A reference to the internal collection of session variables.
-
get
public Object get(String p_strKey)
Description copied from interface:ISessionGet a session variable.
-
get
public Object get(String p_strKey, Object p_objFallback)
Description copied from interface:ISessionGet a session variable or the specified fallback value.
-
put
public void put(String p_strKey, Object p_objValue)
Description copied from interface:ISessionSet a session variable.
-
remove
public void remove(String p_strKey)
Description copied from interface:ISessionRemove a session variable.
-
getCreationTime
public long getCreationTime()
Description copied from interface:ISessionGet the time when this session was created.- Specified by:
getCreationTimein 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:ISessionCheck if the session is logged out.- Specified by:
isLoggedOutin interfaceISession- Returns:
trueis the session is logged out, orfalseotherwise.
-
isStale
public boolean isStale()
Description copied from interface:ISessionCheck 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:ISessionAdd a listener for session events.- Specified by:
addListenerin interfaceISession- Parameters:
p_listener- The session listener to add.p_bWeak-trueif the listener should be weakly referenced,falseotherwise.
-
-