uk.ac.vamsas.client.simpleclient
Class SimpleSessionManager

java.lang.Object
  extended byuk.ac.vamsas.client.simpleclient.SimpleSessionManager

public class SimpleSessionManager
extends java.lang.Object

Class to deal with sessions retrieves list of available sessions adds an active session removes a close session (the last client has been closed)


Constructor Summary
protected SimpleSessionManager(java.io.File sessionsFile)
           
 
Method Summary
 int addSession(SessionHandle newSession)
          adds SessionHandle me to the sessionList
 java.lang.String[] getCurrentSessions()
           
 FileWatcher getSessionsWatcher()
          make a new watcher object for the sessionsFile
protected  void removeSession(SessionHandle session)
          Removes a session from the list of currently active session
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleSessionManager

protected SimpleSessionManager(java.io.File sessionsFile)
                        throws java.io.IOException
Method Detail

getSessionsWatcher

public FileWatcher getSessionsWatcher()
make a new watcher object for the sessionsFile

Returns:
new SessionsFile watcher instance

getCurrentSessions

public java.lang.String[] getCurrentSessions()
See Also:
IClientFactory.getCurrentSessions()

addSession

public int addSession(SessionHandle newSession)
adds SessionHandle me to the sessionList

Parameters:
newSession - session to add to the session list
Returns:
session index in list or 0 if lock was invalid or addSession operation failed.

removeSession

protected void removeSession(SessionHandle session)
Removes a session from the list of currently active session

Parameters:
session - SessionHandle of the session to remove