com.plumtree.uiinfrastructure.web
Interface ISessionManager

All Known Implementing Classes:
DefaultSessionManager

public interface ISessionManager

Interface defines the majority of the functionality outlined in the requirements. Code built against this interface can be jumped. An implementation will be written for both Java and C#. The implementation will be hidden from developers.


Method Summary
 void Abandon()
          Abandon this session at the end of this request so that the Java/.NET session can be reclaimed by the server.
 void Clear()
          Remove all the elements in this session manager.
 boolean ContainsSubSession(java.lang.String key)
          Check if a subsession is already in the subsession table (i.e.
 java.lang.Object GetAttribute(java.lang.String key)
          Get an Attribute from this SessionManager.
 IXPEnumerator GetKeys()
          A String[] of all the keys contained in the session manager.
 int GetMaxCount()
          Get the max number of objects that can be placed on this session.
 int GetMaxInactiveInterval()
          Have this session manager timeout objects after x number of seconds.
 java.lang.Object GetMostRecentlyAccessedObject()
          Get the most recently accessed Object (by set or get).
 ISessionManager GetSubSession(java.lang.String key)
          Get a sub session.
 long GetTimeStamp(java.lang.String key)
          Get the timestamp of an Attribute from this SessionManager.
 boolean IsAbandoned()
          Check if the underlying Java/.NET session will be abandoned at the end of this request.
 boolean IsNewSession()
          Check if the session is created from the factory.
 void RemoveAttribute(java.lang.String key)
          Remove an attribute from the session manager.
 void RemoveSubSession(java.lang.String subSessionName)
          Remove a sub session from this session manager.
 java.lang.String SetAttribute(java.lang.Object value)
          Place an object on the session.
 void SetAttribute(java.lang.String key, java.lang.Object value)
          Place an object on the session based on a key.
 void SetAttribute(java.lang.String key, java.lang.Object value, ICacheUpdateListener callback, int updateInterval)
          Set an attribute with a callback.
 void SetMaxCount(int maxCount)
          Set the max number of objects that can be placed into this session.
 void SetMaxInactiveInterval(int timeOut)
          Have this session manager timeout objects after x number of seconds.
 

Method Detail

Clear

void Clear()
Remove all the elements in this session manager. This includes all sub-sessions.


ContainsSubSession

boolean ContainsSubSession(java.lang.String key)
Check if a subsession is already in the subsession table (i.e. a subsession will already exist if GetSubSession(key) has been called).

Parameters:
key - The key which the subsession is under.
Returns:
true if the subsession exists.

GetAttribute

java.lang.Object GetAttribute(java.lang.String key)
Get an Attribute from this SessionManager.

Parameters:
key - Key to look up the value to return.
Returns:
Object placed on the session manager.
See Also:
SetAttribute

GetKeys

IXPEnumerator GetKeys()
A String[] of all the keys contained in the session manager. This does not include keys in sub-sessions or keys to sub-sessions.

Returns:
A String[] of all the keys contained in the session manager.

GetMaxCount

int GetMaxCount()
Get the max number of objects that can be placed on this session. This does NOT include sub-sessions.

Returns:
The max number of objects this session manager can hold.
See Also:
SetMaxCount

GetMaxInactiveInterval

int GetMaxInactiveInterval()
Have this session manager timeout objects after x number of seconds. 0 or a negative number means all the objects the session manager contains will expire with the underlying Java/.NET Session. NOTE: The session manager and any sub sessions will only time out with the underlying Java/.NET session.

Returns:
Timeout in seconds.
See Also:
SetMaxInactiveInterval

GetMostRecentlyAccessedObject

java.lang.Object GetMostRecentlyAccessedObject()
Get the most recently accessed Object (by set or get).

Returns:
The object that has the newest timestamp.

GetSubSession

ISessionManager GetSubSession(java.lang.String key)
Get a sub session. This is to provide seperate spaces to place objects in. By grouping objects that belong together in one session it is easier to clean up, debug and maintain. If the sub session with key has not already been created one will be created.

Parameters:
key - The key which the subsession is under.
Returns:
The subsession - ISessionManager

GetTimeStamp

long GetTimeStamp(java.lang.String key)
Get the timestamp of an Attribute from this SessionManager.

Parameters:
key - Key to look up the value to return.
Returns:
long the time stamp of the object placed on the session manager. -1 if there was an error

IsNewSession

boolean IsNewSession()
Check if the session is created from the factory.

Returns:
false is the session has been created by a previous call to the session factory. True the session was just created.

RemoveAttribute

void RemoveAttribute(java.lang.String key)
Remove an attribute from the session manager.

Parameters:
key - The key to remove.

RemoveSubSession

void RemoveSubSession(java.lang.String subSessionName)
Remove a sub session from this session manager.

Parameters:
subSessionName -

SetAttribute

java.lang.String SetAttribute(java.lang.Object value)
Place an object on the session. Key is generated.

Parameters:
value - The value interested in storing on the session.
Returns:
String used by GetAttribute to get the object

SetAttribute

void SetAttribute(java.lang.String key,
                  java.lang.Object value)
Place an object on the session based on a key.

Parameters:
key - The key to place the value under.
value - The value interested in storing on the session.

SetAttribute

void SetAttribute(java.lang.String key,
                  java.lang.Object value,
                  ICacheUpdateListener callback,
                  int updateInterval)
Set an attribute with a callback. The callback will be called when the session manager asks for the key from GetAttribute and the update interval has elapsed.

Parameters:
key - Key on the session
value - The value to place on the session.
callback - Object to call back when time has elapsed.
updateInterval - Time in seconds before calling the callback.

SetMaxCount

void SetMaxCount(int maxCount)
Set the max number of objects that can be placed into this session. After the max count is reached the object used last will be removed to make space.

Parameters:
maxCount - The max number of objects this session can hold.

SetMaxInactiveInterval

void SetMaxInactiveInterval(int timeOut)
Have this session manager timeout objects after x number of seconds. 0 or a negative number means all the objects the session manager contains will expire with the underlying Java/.NET Session. NOTE: The session manager and any sub sessions will only time out with the underlying Java/.NET session.

Parameters:
timeOut - Timeout in seconds.
See Also:
GetMaxInactiveInterval

Abandon

void Abandon()
Abandon this session at the end of this request so that the Java/.NET session can be reclaimed by the server. This call will be ignored for sub-sessions.


IsAbandoned

boolean IsAbandoned()
Check if the underlying Java/.NET session will be abandoned at the end of this request. This call will return incorrect values for sub-sessions.

Returns:
boolean true implies that this session will be abandoned at the end of this request.



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.