Server
Class Session

java.lang.Object
  |
  +--Server.Session
All Implemented Interfaces:
java.lang.Cloneable

public class Session
extends java.lang.Object
implements java.lang.Cloneable

An object describing a session which holds a set of members


Field Summary
private  java.lang.String serviceName
          The name of the service this session is attached to.
private  java.lang.String sessionName
          The identifying name for this session.
private  SessionWrapper sessionWrapper
           
private  java.util.HashMap users
          A set holding the members of this session.
 
Constructor Summary
Session(java.lang.String serviceName, java.lang.String sessionName)
          A constructor which saves that identifying session-name and service-name
 
Method Summary
 java.lang.Object clone()
          Create a clone of this object.
 java.lang.String getServiceName()
          Returns the service-name associated with this server session.
 java.lang.String getSessionName()
          Returns the session-name associated with this server session.
 SessionWrapper getSessionWrapper()
          Returns the session thread associated with this object
 java.util.Map getUsers()
          Returns a set representing the members of this session.
 void setSessionWrapper(SessionWrapper thread)
          Sets the session thread associated with this object
 java.lang.String toString()
          Returns the name of this session
 
Methods inherited from class java.lang.Object
, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

sessionName

private final java.lang.String sessionName
The identifying name for this session.

serviceName

private final java.lang.String serviceName
The name of the service this session is attached to.

sessionWrapper

private SessionWrapper sessionWrapper

users

private java.util.HashMap users
A set holding the members of this session. Each member is of type User. note: we use HashSet interface here for its clone() implementation.
Constructor Detail

Session

public Session(java.lang.String serviceName,
               java.lang.String sessionName)
A constructor which saves that identifying session-name and service-name
Parameters:
sessionName - session-name string
serviceName - service-name string
Method Detail

toString

public final java.lang.String toString()
Returns the name of this session
Overrides:
toString in class java.lang.Object
Returns:
the name of this session

getUsers

public final java.util.Map getUsers()
Returns a set representing the members of this session. Each member is a User instance.
Returns:
a set of User instances

clone

public final java.lang.Object clone()
Create a clone of this object. The cloning behaves as if based of the standard super class cloning, and cloning of the 'users' HashSet.
Overrides:
clone in class java.lang.Object

getServiceName

public final java.lang.String getServiceName()
Returns the service-name associated with this server session.
Returns:
the service-name associated with this server session.

getSessionName

public final java.lang.String getSessionName()
Returns the session-name associated with this server session.
Returns:
the session-name associated with this server session.

getSessionWrapper

public final SessionWrapper getSessionWrapper()
Returns the session thread associated with this object
Returns:
the session thread associated with this object

setSessionWrapper

public final void setSessionWrapper(SessionWrapper thread)
Sets the session thread associated with this object
Parameters:
thread - The thread to associate to