Class GroovySession
- java.lang.Object
-
- groovy.lang.GroovyObjectSupport
-
- de.uplanet.lucy.server.portalserver.GroovySession
-
-
Field Summary
-
Fields inherited from interface de.uplanet.lucy.server.session.ISession
DEFAULT_TIMEOUT
-
-
Constructor Summary
Constructors Constructor Description GroovySession(ISession p_session)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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.Object
get(String p_strKey)
Get a session variable.Object
get(String p_strKey, Object p_objFallback)
Get a session variable or the specified fallback value.Object
getAt(String p_strKey)
String
getAuthConfigName()
Get the name of the authentication configuration used to login this session.long
getCreationTime()
Get the time when this session was created.String
getId()
Get the unique session identifier.Set<String>
getKeySet()
long
getLastAccessTime()
Get the time of the last access to this session.Object
getProperty(String p_strKey)
Subject
getSubject()
Get the subject that is associated with this session.long
getTimeout()
Get the session timeout.IUser
getUser()
Get the user that is associated with the session.boolean
isAnonymous()
Determine if the session is an anonymous session.boolean
isLoggedOut()
Check if the session is logged out.boolean
isStale()
Check if the session has timed out.boolean
isStale(long p_lTimeNow)
Test if the session has timed out.Iterator<Map.Entry<String,Object>>
iterator()
Set<String>
keySet()
Get a set that contains all session variable names.void
logout()
Performs a logout on this session.void
put(String p_strKey, Object p_objValue)
Set a session variable.void
putAt(String p_strKey, Object p_value)
void
remove(String p_strKey)
Remove a session variable.void
setProperty(String p_strKey, Object p_value)
void
setTimeout(long p_lTimeout)
Set the session timeout.void
touch()
Touch the session.
-
-
-
Constructor Detail
-
GroovySession
public GroovySession(ISession p_session)
-
-
Method Detail
-
getAuthConfigName
public String getAuthConfigName()
Description copied from interface:ISession
Get the name of the authentication configuration used to login this session.- Specified by:
getAuthConfigName
in interfaceISession
- Returns:
- The name of the authentication configuration.
-
containsKey
public boolean containsKey(String p_strKey)
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.
-
get
public Object get(String p_strKey)
Description copied from interface:ISession
Get a session variable.
-
get
public Object get(String p_strKey, Object p_objFallback)
Description copied from interface:ISession
Get a session variable or the specified fallback value.
-
put
public void put(String p_strKey, Object p_objValue)
Description copied from interface:ISession
Set a session variable.
-
remove
public void remove(String p_strKey)
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.
-
getId
public String getId()
Description copied from interface:ISession
Get the unique session identifier.
-
getSubject
public Subject getSubject()
Description copied from interface:ISession
Get the subject that is associated with this session.- Specified by:
getSubject
in interfaceISession
- Returns:
- The associated subject.
-
getTimeout
public long getTimeout()
Description copied from interface:ISession
Get the session timeout.- Specified by:
getTimeout
in interfaceISession
- Returns:
- p_lTimeout The timeout in milliseconds.
-
getUser
public IUser getUser()
Description copied from interface:ISession
Get the user that is associated with the session.
-
isAnonymous
public boolean isAnonymous()
Description copied from interface:ISession
Determine if the session is an anonymous session.- Specified by:
isAnonymous
in interfaceISession
- Returns:
true
if the session is anonymous,false
otherwise.
-
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.
-
getLastAccessTime
public long getLastAccessTime()
Description copied from interface:ISession
Get the time of the last access to this session.- Specified by:
getLastAccessTime
in interfaceISession
- Returns:
- The time of last access.
-
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())
.
-
isStale
public boolean isStale(long p_lTimeNow)
Description copied from interface:ISession
Test if the session has timed out.
-
keySet
public Set<String> keySet()
Description copied from interface:ISession
Get a set that contains all session variable names.
-
logout
public void logout()
Description copied from interface:ISession
Performs a logout on this session.
-
setTimeout
public void setTimeout(long p_lTimeout)
Description copied from interface:ISession
Set the session timeout.- Specified by:
setTimeout
in interfaceISession
- Parameters:
p_lTimeout
- The timeout in milliseconds.
-
touch
public void touch()
Description copied from interface:ISession
Touch the session.
-
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.
-
getProperty
public Object getProperty(String p_strKey)
- Specified by:
getProperty
in interfacegroovy.lang.GroovyObject
-
setProperty
public void setProperty(String p_strKey, Object p_value)
- Specified by:
setProperty
in interfacegroovy.lang.GroovyObject
-
-