public class Session extends Values implements java.lang.Cloneable
The session object is available on every service invocation and can therefore be used to store user state between invocations. Use it just like Values to store and retrieve keyed values.
Modifier and Type | Field and Description |
---|---|
boolean |
gDirty
Used to indicate that the object has changed.
|
Constructor and Description |
---|
Session(java.lang.String name)
Creates a new Session object with defaults.
|
Session(java.lang.String ssnid,
long timeout,
java.lang.String name)
Creates a new Session object for the specified user,
session id, and timeout.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Clones a Session object.
|
Values |
copyFrom(java.util.Hashtable v)
Copies the elements from the given Hashtable object into
the current Values object.
|
Values |
copyFrom(Values v)
Copies the elements from the given Values object into
the current Values object.
|
long |
getAge()
Returns the age of the current session in milliseconds.
|
int |
getCalls()
Returns the total number of invocations on this session during
its lifetime.
|
iContext |
getIContext()
Returns the iContext associated with this session.
|
Subject |
getJaasSubject()
Returns the jaasSubject that was created for this session during JAAS
authentication (returns null if there is not one).
|
Subject |
getJaasSubject(boolean shouldCreate)
Returns the jaasSubject for a session.
|
long |
getLast()
Returns the time of the most recent invocation on this session, in milliseconds.
|
java.util.Locale |
getLocale()
Returns the locale of this session.
|
java.lang.String |
getName()
Returns the name of the current session.
|
java.lang.String |
getSessionID()
Returns the id of the current session.
|
java.util.Date |
getStart()
Returns the start time of the current session.
|
long |
getTimeout()
Returns the idle timeout value for the current session, in milliseconds.
|
User |
getUser()
Returns the user associated with the current session.
|
java.lang.Object |
put(java.lang.Object value)
Adds an "unnamed" object which can be retrieved
by a positional get(int).
|
java.lang.Object |
put(java.lang.String key,
int value)
put() which converts int value to an Integer object.
|
java.lang.Object |
put(java.lang.String key,
long value)
put() which converts long value to a Long object.
|
java.lang.Object |
put(java.lang.String k,
java.lang.Object value)
Adds a named object which can be retrieved by get(String).
|
java.lang.Object |
putClean(java.lang.String k,
java.lang.Object value)
Adds a named object which can be retrieved by get(String).
|
java.lang.Object |
remove(java.lang.String key)
Returns a named object and permanently remove it from the Values object.
|
void |
renameKey(java.lang.String oldKey,
java.lang.String newKey)
Renames a key, preserving its order.
|
void |
setCalls(int val) |
void |
setIContext(iContext change)
Sets the iContext to the given value.
|
void |
setIContext(java.lang.String lang)
Sets the iContext using the language string.
|
void |
setLast(long val)
Sets the time of the most recent invocation on this session, in milliseconds.
|
void |
setLocale(java.util.Locale l)
Sets the locale of this session.
|
void |
setStart(java.util.Date val)
Sets the start time of the current session.
|
void |
setTimeout(long tmout)
Sets the idle timeout value for the current session, in milliseconds.
|
void |
setUser(User user)
Sets the user associated with the current session.
|
java.lang.String |
toString()
Standard toString implementation.
|
void |
update()
Increments the session call count and update the last call time
with the current time.
|
equals, get, get, getBoolean, getInt, getInt, getLong, getLong, getNonEmptyString, getString, getStringArray, getStringTable, getTrimmedString, getValues, getValuesArray, hashCode, isEmpty, sortedKeys, use
getCursor, getHashCursor, getIndexCursor, getSharedCursor, getTreeCursor
getValue, getValueKeys, setValue
public Session(java.lang.String name)
public Session(java.lang.String ssnid, long timeout, java.lang.String name)
public java.util.Locale getLocale()
public void setLocale(java.util.Locale l)
l
- the localepublic iContext getIContext()
public void setIContext(iContext change)
change
- The new iContext. If change is null,
the session's iContext is set to a new, empty iContext.public void setIContext(java.lang.String lang)
lang
- the locale. The language string can be one of the following:
public java.lang.String getName()
public java.lang.String getSessionID()
public long getAge()
public java.util.Date getStart()
public void setStart(java.util.Date val)
public User getUser()
public void setUser(User user)
public long getLast()
public void setLast(long val)
public long getTimeout()
public void setTimeout(long tmout)
public int getCalls()
public void setCalls(int val)
public void update()
public java.lang.Object clone()
public java.lang.String toString()
public java.lang.Object put(java.lang.Object value)
Note: If your Integration Server runs as part of a non-clustered group of Integration Servers that share an ISInternal database, you should not call Session.put() to save data across requests as this can cause unpredictable results. Instead, create a local or distributed cache or a database table with a key of sessionID to hold the data you need to preserve between client requests.
public java.lang.Object put(java.lang.String k, java.lang.Object value)
Note: If your Integration Server runs as part of a non-clustered group of Integration Servers that share an ISInternal database, you should not call Session.put() to save data across requests as this can cause unpredictable results. Instead, create a local or distributed cache or a database table with a key of sessionID to hold the data you need to preserve between client requests.
public java.lang.Object putClean(java.lang.String k, java.lang.Object value)
Note: If your Integration Server runs as part of a non-clustered group of Integration Servers that share an ISInternal database, you should not call Session.putClean() to save data across requests as this can cause unpredictable results. Instead, create a local or distributed cache or a database table with a key of sessionID to hold the data you need to preserve between client requests.
Hashtable.put(K, V)
public java.lang.Object put(java.lang.String key, int value)
Note: If your Integration Server runs as part of a non-clustered group of Integration Servers that share an ISInternal database, you should not call Session.put() to save data across requests as this can cause unpredictable results. Instead, create a local or distributed cache or a database table with a key of sessionID to hold the data you need to preserve between client requests.
public java.lang.Object put(java.lang.String key, long value)
Note: If your Integration Server runs as part of a non-clustered group of Integration Servers that share an ISInternal database, you should not call Session.put() to save data across requests as this can cause unpredictable results. Instead, create a local or distributed cache or a database table with a key of sessionID to hold the data you need to preserve between client requests.
public java.lang.Object remove(java.lang.String key)
public void renameKey(java.lang.String oldKey, java.lang.String newKey)
public Values copyFrom(Values v)
public Values copyFrom(java.util.Hashtable v)
public Subject getJaasSubject()
public Subject getJaasSubject(boolean shouldCreate)
shouldCreate
- -Set to true to create a jaasSubject and override the existing jaasSubject for the session.
-Set to false to return the existing jaasSubject.