|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sibvisions.rad.server.DirectServerSession
public class DirectServerSession
The DirectServerSession
is a wrapper for server-side sessions. It is fully attached and forwards
every method call to the server-side session. To create a new instance of DirectServerSession
use
DirectServerSession session = DirectServerSession.createMasterSession(...);
or
session.createSubSession(...);
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. |
void |
close()
Closes the object (stream, connection, ...) and releases any system resources associated with it. |
static DirectServerSession |
createMasterSession(java.lang.String pApplicationName,
java.util.Map<java.lang.String,java.lang.Object> pProperties)
Creates a new instance of DirectServerSession for the given application and properties. |
static DirectServerSession |
createMasterSession(java.lang.String pApplicationName,
java.lang.String pUserName,
java.lang.String pPassword)
Creates a new instance of DirectServerSession for the given application and credentials. |
static DirectServerSession |
createMasterSession(java.lang.String pApplicationName,
java.lang.String pUserName,
java.lang.String pPassword,
java.util.Map<java.lang.String,java.lang.Object> pProperties)
Creates a new instance of DirectServerSession for the given application, credentials and properties. |
protected static ChangedHashtable<java.lang.String,java.lang.Object> |
createProperties(java.util.Map<java.lang.String,java.lang.Object> pProperties)
Creates a new ChangedHashtable instance with given properties as base. |
DirectServerSession |
createSubSession(java.lang.String pLifeCycleName)
Creates a new instance of DirectServerSession as sub session for the given life-cycle object name. |
DirectServerSession |
createSubSession(java.lang.String pLifeCycleName,
java.util.Map<java.lang.String,java.lang.Object> pProperties)
Creates a new instance of DirectServerSession as sub session for the given life-cycle object name
and properties. |
void |
destroy()
Destroys the session. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.lang.Object getId()
getId
in interface ISession
public java.lang.String getApplicationName()
getApplicationName
in interface ISession
public java.lang.String getLifeCycleName()
getLifeCycleName
in interface ISession
public java.lang.String getUserName()
getUserName
in interface ISession
public java.lang.String getPassword()
getPassword
in interface ISession
public java.lang.Object get(java.lang.String pObjectName) throws java.lang.Throwable
get
in interface ISession
pObjectName
- the object name
java.lang.Throwable
- if the object was not found or an error occured during object creationpublic java.lang.Object put(java.lang.String pObjectName, java.lang.Object pObject) throws java.lang.Throwable
put
in interface ISession
pObjectName
- the object namepObject
- the object
java.lang.Throwable
- if an unknown error occurs while putting the objectpublic java.lang.Object call(java.lang.String pObjectName, java.lang.String pMethod, java.lang.Object... pParams) throws java.lang.Throwable
call
in interface ISession
pObjectName
- list of already mapped server object name/aliaspMethod
- method name which should be calledpParams
- parameters for the method call
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 allowedpublic java.lang.Object callAction(java.lang.String pAction, java.lang.Object... pParams) throws java.lang.Throwable
callAction
in interface ISession
pAction
- action which should be calledpParams
- the parameters for the action call
java.lang.Throwable
- communication error, security checks, invalid action, ...public IConfiguration getConfig()
IConfiguration
of the session.
getConfig
in interface ISession
public long getLastAccessTime()
getLastAccessTime
in interface ISession
public long getLastAliveTime()
getLastAliveTime
in interface ISession
public void setProperty(java.lang.String pName, java.lang.Object pValue)
setProperty
in interface ISession
pName
- the property namepValue
- the value for the property or null
to delete the propertypublic java.lang.Object getProperty(java.lang.String pName)
getProperty
in interface ISession
pName
- the property name
null
if the property is not availablepublic java.util.Hashtable<java.lang.String,java.lang.Object> getProperties()
getProperties
in interface ISession
Hashtable
with property names and valuespublic long getStartTime()
getStartTime
in interface ISession
public boolean isAlive(long pAccessTime)
isAlive
in interface ISession
pAccessTime
- current access time
true
if the session is aliveISession.getLastAliveTime()
,
ISession.getAliveInterval()
public boolean isInactive(long pAccessTime)
isInactive
in interface ISession
pAccessTime
- current access time
true
if the session is inactiveISession.getMaxInactiveInterval()
,
ISession.getLastAccessTime()
public long getAliveInterval()
getAliveInterval
in interface ISession
public void setAliveInterval(long pAliveInterval)
setAliveInterval
in interface ISession
pAliveInterval
- the alive interval (client-side)public int getMaxInactiveInterval()
setMaxInactiveInterval
method. A zero or negative time indicates the session should never be inactive.
getMaxInactiveInterval
in interface ISession
ISession.setMaxInactiveInterval(int)
public void setMaxInactiveInterval(int pMaxInactiveInterval)
setMaxInactiveInterval
in interface ISession
pMaxInactiveInterval
- time in secondspublic void close() throws java.lang.Throwable
close
in interface ICloseable
java.lang.Throwable
- if an error occurspublic void destroy()
public static DirectServerSession createMasterSession(java.lang.String pApplicationName, java.util.Map<java.lang.String,java.lang.Object> pProperties) throws java.lang.Throwable
DirectServerSession
for the given application and properties.
pApplicationName
- the name of the applicationpProperties
- the additional session properties
java.lang.Throwable
- if session creation failspublic static DirectServerSession createMasterSession(java.lang.String pApplicationName, java.lang.String pUserName, java.lang.String pPassword) throws java.lang.Throwable
DirectServerSession
for the given application and credentials.
pApplicationName
- the name of the applicationpUserName
- the user namepPassword
- the password
java.lang.Throwable
- if session creation failspublic static DirectServerSession createMasterSession(java.lang.String pApplicationName, java.lang.String pUserName, java.lang.String pPassword, java.util.Map<java.lang.String,java.lang.Object> pProperties) throws java.lang.Throwable
DirectServerSession
for the given application, credentials and properties.
pApplicationName
- the name of the applicationpUserName
- the user namepPassword
- the passwordpProperties
- the additional session properties
java.lang.Throwable
- if session creation failspublic DirectServerSession createSubSession(java.lang.String pLifeCycleName) throws java.lang.Throwable
DirectServerSession
as sub session for the given life-cycle object name.
pLifeCycleName
- the full qualified class name of the life-cycle object
java.lang.Throwable
- if session creation failspublic DirectServerSession createSubSession(java.lang.String pLifeCycleName, java.util.Map<java.lang.String,java.lang.Object> pProperties) throws java.lang.Throwable
DirectServerSession
as sub session for the given life-cycle object name
and properties.
pLifeCycleName
- the full qualified class name of the life-cycle objectpProperties
- the additional session properties
java.lang.Throwable
- if session creation failsprotected static ChangedHashtable<java.lang.String,java.lang.Object> createProperties(java.util.Map<java.lang.String,java.lang.Object> pProperties)
ChangedHashtable
instance with given properties as base.
pProperties
- the base properties
ChangedHashtable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |