Package de.uplanet.lucy.server.session
Schnittstelle ISession
- Alle bekannten Implementierungsklassen:
AbstractSession,GroovySession
public interface ISession
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final longDefault session timeout in milliseconds (20 minutes). -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidaddListener(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.Get a session variable.Get a session variable or the specified fallback value.Get the name of the authentication configuration used to login this session.longGet the time when this session was created.getId()Get the unique session identifier.longGet the time of the last access to this session.Get the subject that is associated with this session.longGet the session timeout.getUser()Get the user that is associated with the session.booleanDetermine if the session is an anonymous session.booleanCheck if the session is logged out.booleanisStale()Check if the session has timed out.booleanisStale(long p_lTimeNow) Test if the session has timed out.keySet()Get a set that contains all session variable names.voidlogout()Performs a logout on this session.voidSet a session variable.voidRemove a session variable.voidsetTimeout(long p_lTimeout) Set the session timeout.voidtouch()Touch the session.
-
Felddetails
-
DEFAULT_TIMEOUT
static final long DEFAULT_TIMEOUTDefault session timeout in milliseconds (20 minutes).- Siehe auch:
-
-
Methodendetails
-
getSubject
Subject getSubject()Get the subject that is associated with this session.- Gibt zurück:
- The associated subject.
-
getAuthConfigName
String getAuthConfigName()Get the name of the authentication configuration used to login this session.- Gibt zurück:
- The name of the authentication configuration.
-
getCreationTime
long getCreationTime()Get the time when this session was created.- Gibt zurück:
- The creation time, measured in milliseconds, between the current time and 01-01-1970 00:00:00 UTC.
-
getId
String getId()Get the unique session identifier. -
isAnonymous
boolean isAnonymous()Determine if the session is an anonymous session.- Gibt zurück:
trueif the session is anonymous,falseotherwise.
-
getUser
IUser getUser()Get the user that is associated with the session.- Gibt zurück:
- The user that is associated with this session, or
null.
-
get
Get a session variable.- Parameter:
p_strKey- The name of the session variable.- Gibt zurück:
- The session variable.
-
get
Get a session variable or the specified fallback value.- Parameter:
p_strKey- The name of the session variable.p_objFallback- The fallback value that's being used if the session variable does not exist.- Gibt zurück:
- The session variable.
-
put
Set a session variable.- Parameter:
p_strKey- The name of the session variable.p_objValue- The value of the session variable.
-
containsKey
Test if a certain session variable exists.- Parameter:
p_strKey- The name of the session variable.
-
keySet
Get a set that contains all session variable names.- Gibt zurück:
- A set with all session variables.
-
remove
Remove a session variable.- Parameter:
p_strKey- The name of the session variable to be removed.
-
setTimeout
void setTimeout(long p_lTimeout) Set the session timeout.- Parameter:
p_lTimeout- The timeout in milliseconds.
-
getTimeout
long getTimeout()Get the session timeout.- Gibt zurück:
- p_lTimeout The timeout in milliseconds.
-
touch
void touch()Touch the session. -
isLoggedOut
boolean isLoggedOut()Check if the session is logged out.- Gibt zurück:
trueis the session is logged out, orfalseotherwise.
-
getLastAccessTime
long getLastAccessTime()Get the time of the last access to this session.- Gibt zurück:
- The time of last access.
-
isStale
boolean isStale()Check if the session has timed out.The natural implementation of this method will return
isStale(System.currentTimeMillis()).- Gibt zurück:
trueif the session already has timed out,falseotherwise.
-
isStale
boolean isStale(long p_lTimeNow) Test if the session has timed out.- Gibt zurück:
trueif the session has timed out,falseotherwise.
-
logout
void logout()Performs a logout on this session. -
addListener
void addListener(de.uplanet.lucy.server.session.ISessionListener p_listener, boolean p_bWeak) Add a listener for session events.- Parameter:
p_listener- The session listener to add.p_bWeak-trueif the listener should be weakly referenced,falseotherwise.
-