javax.rad.server
Interface ISession

All Known Subinterfaces:
ICloseableSession, IMasterSession, ISubSession
All Known Implementing Classes:
AbstractSession, DetachedSession, DirectServerSession

public interface ISession

Provides a way to identify a user and to store information about that user.


Method Summary
 java.lang.Object call(java.lang.String pObjectName, java.lang.String pMethod, java.lang.Object... pParams)
          Executes a method from an object in the life-cycle object.
 java.lang.Object callAction(java.lang.String pAction, java.lang.Object... pParams)
          Executes an action from the life-cycle object.
 java.lang.Object get(java.lang.String pObjectName)
          Gets an object from the life-cycle object.
 long getAliveInterval()
          Gets the desired client-side communication interval for this session.
 java.lang.String getApplicationName()
          Gets the associated application name of the session.
 IConfiguration getConfig()
          Gets the IConfiguration of the session.
 java.lang.Object getId()
          Gets the session identifier.
 long getLastAccessTime()
          Gets the time of the last session access.
 long getLastAliveTime()
          Gets the time of the last communication of the session.
 java.lang.String getLifeCycleName()
          Gets the name of the life-cycle object.
 int getMaxInactiveInterval()
          Returns the maximum time interval, in seconds, that this session will be active.
 java.lang.String getPassword()
          Gets the sessions password.
 java.util.Hashtable<java.lang.String,java.lang.Object> getProperties()
          Gets all properties.
 java.lang.Object getProperty(java.lang.String pName)
          Gets the value of a property.
 long getStartTime()
          Gets the session start/create time.
 java.lang.String getUserName()
          Gets the sessions user name.
 boolean isAlive(long pAccessTime)
          Checks if the session is alive.
 boolean isInactive(long pAccessTime)
          Checks if the session is inactive.
 java.lang.Object put(java.lang.String pObjectName, java.lang.Object pObject)
          Puts an object to the life-cycle object.
 void setAliveInterval(long pAliveInterval)
          Sets the desired client-side communication interval for this session.
 void setMaxInactiveInterval(int pMaxInactiveInterval)
          Specifies the time, in seconds, before the session will be inactive.
 void setProperty(java.lang.String pName, java.lang.Object pValue)
          Sets the value of a property.
 

Method Detail

getId

java.lang.Object getId()
Gets the session identifier.

Returns:
session id

getLifeCycleName

java.lang.String getLifeCycleName()
Gets the name of the life-cycle object.

Returns:
the name of the life-cycle object

getApplicationName

java.lang.String getApplicationName()
Gets the associated application name of the session.

Returns:
service name

getUserName

java.lang.String getUserName()
Gets the sessions user name.

Returns:
the user name

getPassword

java.lang.String getPassword()
Gets the sessions password.

Returns:
the password

getProperty

java.lang.Object getProperty(java.lang.String pName)
Gets the value of a property.

Parameters:
pName - the property name
Returns:
the value of the property or null if the property is not available

getProperties

java.util.Hashtable<java.lang.String,java.lang.Object> getProperties()
Gets all properties.

Returns:
a Hashtable with property names and values

setProperty

void setProperty(java.lang.String pName,
                 java.lang.Object pValue)
Sets the value of a property.

Parameters:
pName - the property name
pValue - the value for the property or null to delete the property

getStartTime

long getStartTime()
Gets the session start/create time.

Returns:
start time in millis

getLastAccessTime

long getLastAccessTime()
Gets the time of the last session access.

Returns:
access time in millis

setMaxInactiveInterval

void setMaxInactiveInterval(int pMaxInactiveInterval)
Specifies the time, in seconds, before the session will be inactive. A zero or negative time indicates the session should never be inactive.

Parameters:
pMaxInactiveInterval - time in seconds

getMaxInactiveInterval

int getMaxInactiveInterval()
Returns the maximum time interval, in seconds, that this session will be active. After this interval, the session is inactive. The maximum time interval can be set with the setMaxInactiveInterval method. A zero or negative time indicates the session should never be inactive.

Returns:
time in seconds
See Also:
setMaxInactiveInterval(int)

isInactive

boolean isInactive(long pAccessTime)
Checks if the session is inactive.

Parameters:
pAccessTime - current access time
Returns:
true if the session is inactive
See Also:
getMaxInactiveInterval(), getLastAccessTime()

getLastAliveTime

long getLastAliveTime()
Gets the time of the last communication of the session.

Returns:
the last communication/alive time

setAliveInterval

void setAliveInterval(long pAliveInterval)
Sets the desired client-side communication interval for this session.

Parameters:
pAliveInterval - the alive interval (client-side)

getAliveInterval

long getAliveInterval()
Gets the desired client-side communication interval for this session.

Returns:
the alive interval (client-side)

isAlive

boolean isAlive(long pAccessTime)
Checks if the session is alive. That means the client sends alive messages. The session is not alive if the client doesn't send alive messages.

Parameters:
pAccessTime - current access time
Returns:
true if the session is alive
See Also:
getLastAliveTime(), getAliveInterval()

call

java.lang.Object call(java.lang.String pObjectName,
                      java.lang.String pMethod,
                      java.lang.Object... pParams)
                      throws java.lang.Throwable
Executes a method from an object in the life-cycle object.

Parameters:
pObjectName - list of already mapped server object name/alias
pMethod - method name which should be called
pParams - parameters for the method call
Returns:
result of method call or null if it's an asynchronous method call
Throws:
java.lang.Throwable - if the object identified by pObjectName was found but can not be created
java.lang.SecurityException - if the method call is not allowed

callAction

java.lang.Object callAction(java.lang.String pAction,
                            java.lang.Object... pParams)
                            throws java.lang.Throwable
Executes an action from the life-cycle object.

Parameters:
pAction - action which should be called
pParams - the parameters for the action call
Returns:
result from the action call
Throws:
java.lang.Throwable - communication error, security checks, invalid action, ...

get

java.lang.Object get(java.lang.String pObjectName)
                     throws java.lang.Throwable
Gets an object from the life-cycle object.

Parameters:
pObjectName - the object name
Returns:
the object
Throws:
java.lang.Throwable - if the object was not found or an error occured during object creation

put

java.lang.Object put(java.lang.String pObjectName,
                     java.lang.Object pObject)
                     throws java.lang.Throwable
Puts an object to the life-cycle object.

Parameters:
pObjectName - the object name
pObject - the object
Returns:
the object if an object was already specified
Throws:
java.lang.Throwable - if an unknown error occurs while putting the object

getConfig

IConfiguration getConfig()
Gets the IConfiguration of the session.

Returns:
the sessions configuration


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.