com.asdf.server
Class SessionManager

java.lang.Object
  extended by com.asdf.server.SessionManager

public class SessionManager
extends java.lang.Object

Stores session - client association.


Constructor Summary
SessionManager()
          Initializes empty lists
 
Method Summary
 java.lang.Long[] getByClientConnection(ClientConnection client)
          Get Session IDs by ClientConnection.
 ClientConnection getBySessionID(long sessionID)
          Get ClientConnection by session ID.
 void put(long sessionID, ClientConnection client)
          Add new session ID for given ClientConnection
 void remove(ClientConnection client)
          Remove ClientConnection and associated session IDs
 void remove(long sessionID)
          Remove session ID
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionManager

public SessionManager()
Initializes empty lists

Method Detail

getBySessionID

public ClientConnection getBySessionID(long sessionID)
Get ClientConnection by session ID. There can only be one or none.

Parameters:
sessionID - ClientConnection having this session ID
Returns:
ClientConnection associated to given session ID

getByClientConnection

public java.lang.Long[] getByClientConnection(ClientConnection client)
Get Session IDs by ClientConnection. There can be any amount of ids including none.

Parameters:
client - ClientConnection used as search key
Returns:
Array of session ids or null

put

public void put(long sessionID,
                ClientConnection client)
Add new session ID for given ClientConnection

Parameters:
sessionID -
client -

remove

public void remove(long sessionID)
Remove session ID

Parameters:
sessionID - ID to remove

remove

public void remove(ClientConnection client)
Remove ClientConnection and associated session IDs

Parameters:
client - ClientConnection to remove