de.uplanet.lucy.server.portalserver
Class GroovySession

java.lang.Object
  extended by groovy.lang.GroovyObjectSupport
      extended by de.uplanet.lucy.server.portalserver.GroovySession
All Implemented Interfaces:
ISession, groovy.lang.GroovyObject

@Scriptable
public final class GroovySession
extends groovy.lang.GroovyObjectSupport
implements ISession

Version:
$Revision: 64867 $

Field Summary
 
Fields inherited from interface de.uplanet.lucy.server.session.ISession
DEFAULT_TIMEOUT
 
Constructor Summary
GroovySession(Session p_session)
           
 
Method Summary
 void addListener(de.uplanet.lucy.server.session.ISessionListener p_listener, boolean p_bWeak)
          Add a listener for session events.
 boolean containsKey(java.lang.String p_strKey)
          Test if a certain session variable exists.
 java.lang.Object get(java.lang.String p_strKey)
          Get a session variable.
 java.lang.Object get(java.lang.String p_strKey, java.lang.Object p_objFallback)
          Get a session variable or the specified fallback value.
 java.lang.Object getAt(java.lang.String p_strKey)
           
 java.lang.String getAuthConfigName()
           
 long getCreationTime()
          Get the time when this session was created.
 java.lang.String getId()
          Get the unique session identifier.
 java.util.Set<java.lang.String> getKeySet()
           
 long getLastAccessTime()
          Get the time of the last access to this session.
 java.lang.Object getProperty(java.lang.String p_strKey)
           
 javax.security.auth.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.
 java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.Object>> iterator()
           
 java.util.Set<java.lang.String> keySet()
          Get a set that contains all session variable names.
 void logout()
          Performs a logout on this session.
 void put(java.lang.String p_strKey, java.lang.Object p_objValue)
          Set a session variable.
 void putAt(java.lang.String p_strKey, java.lang.Object p_value)
           
 void remove(java.lang.String p_strKey)
          Remove a session variable.
 void setProperty(java.lang.String p_strKey, java.lang.Object p_value)
           
 void setTimeout(long p_lTimeout)
          Set the session timeout.
 void touch()
          Touch the session.
 
Methods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, invokeMethod, setMetaClass
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroovySession

public GroovySession(Session p_session)
Method Detail

getAuthConfigName

public java.lang.String getAuthConfigName()

containsKey

public boolean containsKey(java.lang.String p_strKey)
Description copied from interface: ISession
Test if a certain session variable exists.

Specified by:
containsKey in interface ISession
Parameters:
p_strKey - The name of the session variable.

get

public java.lang.Object get(java.lang.String p_strKey)
Description copied from interface: ISession
Get a session variable.

Specified by:
get in interface ISession
Parameters:
p_strKey - The name of the session variable.
Returns:
The session variable.

get

public java.lang.Object get(java.lang.String p_strKey,
                            java.lang.Object p_objFallback)
Description copied from interface: ISession
Get a session variable or the specified fallback value.

Specified by:
get in interface ISession
Parameters:
p_strKey - The name of the session variable.
p_objFallback - The fallback value that's being used if the session variable does not exist.
Returns:
The session variable.

put

public void put(java.lang.String p_strKey,
                java.lang.Object p_objValue)
Description copied from interface: ISession
Set a session variable.

Specified by:
put in interface ISession
Parameters:
p_strKey - The name of the session variable.
p_objValue - The value of the session variable.

remove

public void remove(java.lang.String p_strKey)
Description copied from interface: ISession
Remove a session variable.

Specified by:
remove in interface ISession
Parameters:
p_strKey - The name of the session variable to be removed.

getCreationTime

public long getCreationTime()
Description copied from interface: ISession
Get the time when this session was created.

Specified by:
getCreationTime in interface ISession
Returns:
The creation time, measured in milliseconds, between the current time and 01-01-1970 00:00:00 UTC.

getId

public java.lang.String getId()
Description copied from interface: ISession
Get the unique session identifier.

Specified by:
getId in interface ISession

getSubject

public javax.security.auth.Subject getSubject()
Description copied from interface: ISession
Get the subject that is associated with this session.

Specified by:
getSubject in interface ISession
Returns:
The associated subject.

getTimeout

public long getTimeout()
Description copied from interface: ISession
Get the session timeout.

Specified by:
getTimeout in interface ISession
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.

Specified by:
getUser in interface ISession
Returns:
The user that is associated with this session, or null.

isAnonymous

public boolean isAnonymous()
Description copied from interface: ISession
Determine if the session is an anonymous session.

Specified by:
isAnonymous in interface ISession
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 interface ISession
Returns:
true is the session is logged out, or false otherwise.

getLastAccessTime

public long getLastAccessTime()
Description copied from interface: ISession
Get the time of the last access to this session.

Specified by:
getLastAccessTime in interface ISession
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()).

Specified by:
isStale in interface ISession
Returns:
true if the session already has timed out, false otherwise.

isStale

public boolean isStale(long p_lTimeNow)
Description copied from interface: ISession
Test if the session has timed out.

Specified by:
isStale in interface ISession
Returns:
true if the session has timed out, false otherwise.

keySet

public java.util.Set<java.lang.String> keySet()
Description copied from interface: ISession
Get a set that contains all session variable names.

Specified by:
keySet in interface ISession
Returns:
A set wit all session variables.

getKeySet

public java.util.Set<java.lang.String> getKeySet()

logout

public void logout()
Description copied from interface: ISession
Performs a logout on this session.

Specified by:
logout in interface ISession

setTimeout

public void setTimeout(long p_lTimeout)
Description copied from interface: ISession
Set the session timeout.

Specified by:
setTimeout in interface ISession
Parameters:
p_lTimeout - The timeout in milliseconds.

touch

public void touch()
Description copied from interface: ISession
Touch the session.

Specified by:
touch in interface ISession

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 interface ISession
Parameters:
p_listener - The session listener to add.
p_bWeak - true if the listener should be weakly referenced, false otherwise.

iterator

public java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.Object>> iterator()

getProperty

public java.lang.Object getProperty(java.lang.String p_strKey)
Specified by:
getProperty in interface groovy.lang.GroovyObject
Overrides:
getProperty in class groovy.lang.GroovyObjectSupport

setProperty

public void setProperty(java.lang.String p_strKey,
                        java.lang.Object p_value)
Specified by:
setProperty in interface groovy.lang.GroovyObject
Overrides:
setProperty in class groovy.lang.GroovyObjectSupport

getAt

public java.lang.Object getAt(java.lang.String p_strKey)

putAt

public void putAt(java.lang.String p_strKey,
                  java.lang.Object p_value)


Last updated: 2011-08-11 10-04
Copyright © 2000-2011 United Planet. All Rights Reserved.