net.handle.hdllib
Class ClientSessionTracker

java.lang.Object
  extended by net.handle.hdllib.ClientSessionTracker

public class ClientSessionTracker
extends java.lang.Object

Instances of ClientSessionTracker are meant to maintain a set of ClientSideSessionInfo objects for different servers. When one of the servers in the list are contacted, the existing session information associated with that server is used to authenticate. This object also keeps track of the SessionSetupInfo in case the resolver needs to create a new session.


Constructor Summary
ClientSessionTracker()
          Creates a new ClientSessionTracker object that has no sessionSetupInfo.
ClientSessionTracker(SessionSetupInfo setupInfo)
           
 
Method Summary
 ClientSideSessionInfo[] getAllSessions()
          Returns a list of sessions.
 ClientSideSessionInfo getAndRemoveSession(ServerInfo server, AuthenticationInfo authInfo)
          Gets the session that is associated with the given server and authentication information, and removes it so that no other thread can use it.
 ClientSideSessionInfo getSession(ServerInfo server, AuthenticationInfo authInfo)
          Gets the session that is associated with the given server and authentication information.
 SessionSetupInfo getSessionSetupInfo()
          Gets the session setup information for this session tracker.
 void putSession(ClientSideSessionInfo session, ServerInfo server, AuthenticationInfo authInfo)
          Stores the given session object and associates it with the given server and authInfo objects.
 void removeSession(ClientSideSessionInfo session)
          Remove all references to the given session from this session tracker.
static boolean sessionOptionChanged(ClientSideSessionInfo csinfo, SessionSetupInfo option)
           
 void setSessionSetupInfo(SessionSetupInfo setupInfo)
          Sets the session setup information for this session tracker.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientSessionTracker

public ClientSessionTracker()
Creates a new ClientSessionTracker object that has no sessionSetupInfo. With no sessionSetupInfo, requests that use this session tracker will not cause new sessions to be initiated, but existing sessions will be used.


ClientSessionTracker

public ClientSessionTracker(SessionSetupInfo setupInfo)
Method Detail

setSessionSetupInfo

public void setSessionSetupInfo(SessionSetupInfo setupInfo)
Sets the session setup information for this session tracker. This makes it so that requests that use this session tracker will cause new sessions to be created and stored here.


getSessionSetupInfo

public SessionSetupInfo getSessionSetupInfo()
Gets the session setup information for this session tracker.


getSession

public ClientSideSessionInfo getSession(ServerInfo server,
                                        AuthenticationInfo authInfo)
Gets the session that is associated with the given server and authentication information. If there is no session with the given server and authentication information then this returns null. If the given authInfo object is null then the session is assumed to be anonymous.


getAndRemoveSession

public ClientSideSessionInfo getAndRemoveSession(ServerInfo server,
                                                 AuthenticationInfo authInfo)
Gets the session that is associated with the given server and authentication information, and removes it so that no other thread can use it. If there is no session with the given server and authentication information then this returns null. If the given authInfo object is null then the session is assumed to be anonymous.


getAllSessions

public ClientSideSessionInfo[] getAllSessions()
Returns a list of sessions.


putSession

public void putSession(ClientSideSessionInfo session,
                       ServerInfo server,
                       AuthenticationInfo authInfo)
Stores the given session object and associates it with the given server and authInfo objects. If the authInfo object is null then the session is assumed to be anonymous.


removeSession

public void removeSession(ClientSideSessionInfo session)
Remove all references to the given session from this session tracker.


sessionOptionChanged

public static boolean sessionOptionChanged(ClientSideSessionInfo csinfo,
                                           SessionSetupInfo option)