ProgramixGenericLib v5.0.1

com.programix.da2.bridge
Class DABridgeSession

java.lang.Object
  extended by com.programix.da2.bridge.DABridgeSession

public class DABridgeSession
extends Object

Encapsulates information about a user's session including the session id, and can store session-specific key-value pairs.

Author:
Paul Hyde

Nested Class Summary
static interface DABridgeSession.Initializer
          Used to specify a block of code that should be executed whenever a new session is created.
static class DABridgeSession.Manager
          Used to manage the sessions.
 
Field Summary
static int DEFAULT_TIMEOUT
           
static int NEVER_TIMEOUT
           
 
Method Summary
 long getIdleTime()
          Returns the difference between 'now' and the 'last used time'.
 int getIdleTimeoutMinutes()
           
 String getIdString()
           
 long getLastUsedTime()
          Returns the time that this session last sent a response.
 ValueMap getSessionStore()
          Returns the ValueMap that can be used to store session-specific information.
 Value getSessionValue(String sessionStoreKey)
           
 void invalidate()
          Removes this session from the list of sessions that the Session.Manager is monitoring.
 void setIdleTimeoutMinutes(int minutes)
          Used to specify a shorter or longer timeout for this session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEVER_TIMEOUT

public static final int NEVER_TIMEOUT
See Also:
Constant Field Values

DEFAULT_TIMEOUT

public static final int DEFAULT_TIMEOUT
See Also:
Constant Field Values
Method Detail

getIdString

public String getIdString()

getLastUsedTime

public long getLastUsedTime()
Returns the time that this session last sent a response. While in request/response cycle, this method shows the last time that a response was sent—potentially from another concurrent thread.


getIdleTime

public long getIdleTime()
Returns the difference between 'now' and the 'last used time'.


setIdleTimeoutMinutes

public void setIdleTimeoutMinutes(int minutes)
Used to specify a shorter or longer timeout for this session. The default timeout comes from session manager.


getIdleTimeoutMinutes

public int getIdleTimeoutMinutes()

invalidate

public void invalidate()
Removes this session from the list of sessions that the Session.Manager is monitoring. This session can continue to be used for the rest of the request—even to generate URI's—but subsequent request will not find this session, and a new session will be created.


getSessionStore

public ValueMap getSessionStore()
Returns the ValueMap that can be used to store session-specific information. This activity on this ValueMap is synchronized independently of the Session it belongs to (use the getLockObject() method on ValueMap if you need to perform multiple operations on the ValueMap that must be done without interference).


getSessionValue

public Value getSessionValue(String sessionStoreKey)

ProgramixGenericLib v5.0.1

Copyright © 2001-2009 Programix Incorporated. All rights reserved. ProgramixGenericLib is free and is OSI Certified Open Source Software under the BSD license.