All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.habanero.SessionManager

java.lang.Object
   |
   +----ncsa.habanero.ModelObject
           |
           +----ncsa.habanero.SessionManager

public class SessionManager
extends ModelObject
implements Runnable
The SessionManager is intended to be a high-level construct that keeps track of a client's Sessions and presents an interface to other SessionManagers and to Neighborhoods. It keeps a list of sessions in a dictionary, keyed by the session Identifier. There is only one SessionManager per invocation of Habanero. It also responds to server requests, like "create a new session" which logically cannot be sent to objects lower in the hierarchy and to requests from other SessionManagers such as "dump a session"


Variable Index

 o addressCache
 o clipboard
 o collaborativeEnvironment
 o context
 o id
 o latestHood
 o listener
 o multicastAddress
 o multicastPort
 o multipleConnections
 o nextSessionController
 o owner
 o portLocations
 o server
 o startTime

Method Index

 o addSession(Session)
Add the given session to my list.
 o askForInfo(SessionInfo)
 o checkSessionExistence(MarshallInput, MarshallOutput)
 o checkUserPassword(MarshallInput, MarshallOutput)
This is a client-side method which is called when a server requires a session-owner to verify that a user/passwd combination is valid.
 o checkVersion(MarshallInput)
 o dumpSharable(MarshallInput, MarshallOutput)
This method is called when a SessionManager is asked to dump the state of either a Session or a Collobject.
 o dumpSharable(Sharable, String, MarshallOutput)
This method is called when a SessionManager is asked to dump the state of either a Session or a Collobject.
 o executeMissedActions(MarshallInput, MarshallOutput)
 o findAddress(String)
 o findAuthentication(MarshallInput, MarshallOutput)
 o findParticipant(MarshallInput, MarshallOutput)
 o findSessionName(MarshallInput, MarshallOutput)
 o findType(MarshallInput, MarshallOutput)
 o getAppletContext()
 o getClipboard()
 o getCollaborativeEnvironment()
 o getEnvAsEnvironmentAware()
 o getEnvAsParticipantsAware()
 o getEnvAsSessionsAware()
 o getEnvAsToolsAware()
 o getEnvAsWarningAware()
 o getInfoAsString()
Returns a string with info about all the sessions on this server
 o getLatestNeighborhood()
 o getListeningPort()
 o getManager()
Static method called to get the one instance of this class.
 o getMulticastAddress()
 o getMulticastPort()
 o getNextMulticastPort()
 o getNextPortNum()
 o getReplayController()
 o good()
 o handleInstruction(String, MarshallInput, MarshallOutput)
 o handleNewConnection(MarshallInput, MarshallOutput)
 o id()
Returns the id of this object, which is the hostname + listening port.
 o initiateReplaySession(SessionInfo, MarshallInput)
This is called by a client to start a session of the given name on a given address/port.
 o initiateSession(SessionInfo)
This is called by a client to start a session of the given name on a given address/port.
 o initiateSession(SessionInfo, String, MarshallInput)
This is called by a client to start a session of the given name on a given address/port.
 o invited(MarshallInput, MarshallOutput)
 o isEnvironmentInterface(String)
 o isInterface(Object, String)
 o joinOrStartRequested(MarshallInput, MarshallOutput)
 o joinSession(String, String, int)
This is called by a client to join a session of the given name on a given address/port.
 o joinSessionRequested(MarshallInput, MarshallOutput)
When a client asks to join an existing session, this routine writes back the session's owner object, which is where the client goes to get the session's data.
 o joinSessionRequested(Session, SessionParticipant, MarshallInput, MarshallOutput)
 o joinSessionWithAuthentication(String, String, int, int, String)
This is called by a client to join a session of the given name on a given address/port with the given authentification.
 o joinSessionWithAuthenticationRequested(MarshallInput, MarshallOutput)
When a client asks to join an existing session, this routine writes back the session's owner object, which is where the client goes to get the session's data.
 o majorVersionNumber()
 o makeManager(Vector)
 o makeManager(Vector, boolean, String)
 o makeParticipant(String, int)
Static method called to create a TCP participant annie modif
 o makeSession(String, SessionParticipant, SessionInfo, String)
Return a new Session with the given name, owner and additional information.
 o minorVersionNumber()
 o multicastEnabled()
 o newSessionRequested(MarshallInput, MarshallOutput)
This is a server-side method which is called when a client requests a new session be created.
 o newSessionRequested(String, MarshallInput, MarshallOutput)
 o notifyNeighborhood(String, String, String)
 o owner()
Returns the owner of this object.
 o releaseNumber()
 o returnInvitation(SessionInfo, String)
 o run()
Listen until someone makes a connection.
 o sendBeep(SessionParticipant)
 o sessionFromId(String)
Returns a Session object given an Identifier
 o setAppletContext(AppletContext)
 o setClipboard(ImagePrimitiveP)
 o setCollaborativeEnvironment(Object)
 o setLatestNeighborhood(String)
 o setMulticastInformation(String, int)
 o setReplay(ReplayController)
 o setSingleConnection()
 o stop()
 o subModels()
 o useMultipleConnections()

Variables

 o owner
 protected SessionParticipant owner
 o id
 protected String id
 o server
 protected ServerSocket server
 o addressCache
 protected static Hashtable addressCache
 o latestHood
 protected String latestHood
 o context
 protected static AppletContext context
 o clipboard
 protected ImagePrimitiveP clipboard
 o listener
 protected Thread listener
 o multipleConnections
 protected boolean multipleConnections
 o nextSessionController
 protected ReplayController nextSessionController
 o multicastAddress
 protected String multicastAddress
 o multicastPort
 protected int multicastPort
 o portLocations
 protected Vector portLocations
 o startTime
 protected Date startTime
 o collaborativeEnvironment
 protected Object collaborativeEnvironment

Methods

 o getNextPortNum
 public int getNextPortNum()
 o handleInstruction
 protected SessionManagerCommand handleInstruction(String instruction,
                                                   MarshallInput in,
                                                   MarshallOutput out)
 o run
 public void run()
Listen until someone makes a connection. Read the request, call a a routine to execute it. Close the connection.

 o stop
 public void stop()
 o useMultipleConnections
 public boolean useMultipleConnections()
 o setSingleConnection
 public void setSingleConnection()
 o getListeningPort
 public int getListeningPort()
 o setMulticastInformation
 public void setMulticastInformation(String address,
                                     int port)
 o multicastEnabled
 public boolean multicastEnabled()
 o getMulticastAddress
 public String getMulticastAddress()
 o getMulticastPort
 public int getMulticastPort()
 o getNextMulticastPort
 public int getNextMulticastPort()
 o makeParticipant
 public static SessionParticipant makeParticipant(String host,
                                                  int port)
Static method called to create a TCP participant annie modif

 o getManager
 public static SessionManager getManager() throws IllegalArgumentException
Static method called to get the one instance of this class. Throws an exception if there is no instance.

 o makeManager
 public static void makeManager(Vector listeningPort) throws Exception
 o makeManager
 public static synchronized void makeManager(Vector listeningPort,
                                             boolean url,
                                             String location) throws Exception
 o addSession
 public void addSession(Session toAdd)
Add the given session to my list. Will be called when a user creates a new session as well as when a user joins a remote session.

Parameters:
toAdd - the new session
owner - who has rights to determine access to the session
 o sessionFromId
 protected Session sessionFromId(String sessionId)
Returns a Session object given an Identifier

Parameters:
sessionId - Specifier of the session
 o owner
 public SessionParticipant owner()
Returns the owner of this object.

 o id
 public String id()
Returns the id of this object, which is the hostname + listening port.

 o subModels
 protected SubModels subModels()
Overrides:
subModels in class ModelObject
 o getInfoAsString
 protected synchronized String getInfoAsString()
Returns a string with info about all the sessions on this server

 o makeSession
 protected Session makeSession(String sessionName,
                               SessionParticipant sessionOwner,
                               SessionInfo sessionInfo,
                               String arbitratorName) throws IOException
Return a new Session with the given name, owner and additional information.

 o findSessionName
 protected String findSessionName(MarshallInput in,
                                  MarshallOutput out) throws IOException
 o findParticipant
 protected SessionParticipant findParticipant(MarshallInput in,
                                              MarshallOutput out) throws IOException, ClassNotFoundException
 o findType
 protected int findType(MarshallInput in,
                        MarshallOutput out) throws IOException, ClassNotFoundException
 o findAuthentication
 protected String findAuthentication(MarshallInput in,
                                     MarshallOutput out) throws IOException, ClassNotFoundException
 o newSessionRequested
 protected Session newSessionRequested(String sessionName,
                                       MarshallInput in,
                                       MarshallOutput out) throws IOException, ClassNotFoundException
 o newSessionRequested
 protected Session newSessionRequested(MarshallInput in,
                                       MarshallOutput out)
This is a server-side method which is called when a client requests a new session be created. It reads the session's name from the input object, and if the name is not already being used, makes a new session of that name with the owner it reads from the input object.

 o handleNewConnection
 public void handleNewConnection(MarshallInput in,
                                 MarshallOutput out)
 o executeMissedActions
 public void executeMissedActions(MarshallInput in,
                                  MarshallOutput out)
 o checkUserPassword
 public void checkUserPassword(MarshallInput in,
                               MarshallOutput out)
This is a client-side method which is called when a server requires a session-owner to verify that a user/passwd combination is valid.

 o invited
 public void invited(MarshallInput in,
                     MarshallOutput out)
 o returnInvitation
 public void returnInvitation(SessionInfo info,
                              String neighborhood)
 o checkVersion
 protected boolean checkVersion(MarshallInput in)
 o joinSessionRequested
 public synchronized void joinSessionRequested(Session session,
                                               SessionParticipant joiner,
                                               MarshallInput in,
                                               MarshallOutput out) throws IOException, ClassNotFoundException
 o joinSessionRequested
 public synchronized Session joinSessionRequested(MarshallInput in,
                                                  MarshallOutput out)
When a client asks to join an existing session, this routine writes back the session's owner object, which is where the client goes to get the session's data. It also adds the client to the session's list of participants. This is a server-side method.

 o joinSessionWithAuthenticationRequested
 public synchronized Session joinSessionWithAuthenticationRequested(MarshallInput in,
                                                                    MarshallOutput out)
When a client asks to join an existing session, this routine writes back the session's owner object, which is where the client goes to get the session's data. It also adds the client to the session's list of participants. This is a server-side method.

 o initiateSession
 public Session initiateSession(SessionInfo is)
This is called by a client to start a session of the given name on a given address/port. It makes a connection to the server, writes out the new session request, and gets back the port of the session arbitrator. Then it creates a new session object as its child.

 o initiateReplaySession
 public Session initiateReplaySession(SessionInfo is,
                                      MarshallInput input)
This is called by a client to start a session of the given name on a given address/port. It makes a connection to the server, writes out the new session request, and gets back the port of the session arbitrator. Then it creates a new session object as its child.

 o joinOrStartRequested
 protected Session joinOrStartRequested(MarshallInput in,
                                        MarshallOutput out)
 o askForInfo
 public void askForInfo(SessionInfo is)
 o initiateSession
 public Session initiateSession(SessionInfo is,
                                String strArb,
                                MarshallInput input)
This is called by a client to start a session of the given name on a given address/port. It makes a connection to the server, writes out the new session request, and gets back the port of the session arbitrator. Then it creates a new session object as its child.

 o joinSession
 public Session joinSession(String sessionName,
                            String serverName,
                            int serverPort)
This is called by a client to join a session of the given name on a given address/port. It makes a connection to the server, writes out the join session request, and gets back the object referring to the owner of that session. It then contacts that owner's SessionManager and asks it to dump the state of the session. It unmarshalls and returns the session.

 o joinSessionWithAuthentication
 public Session joinSessionWithAuthentication(String sessionName,
                                              String serverName,
                                              int serverPort,
                                              int type,
                                              String authentication)
This is called by a client to join a session of the given name on a given address/port with the given authentification. It makes a connection to the server, writes out the join authentication session request, and gets back the object referring to the owner of that session. It then contacts that owner's SessionManager and asks it to dump the state of the session. It unmarshalls and returns the session.

 o dumpSharable
 public synchronized void dumpSharable(MarshallInput in,
                                       MarshallOutput out)
This method is called when a SessionManager is asked to dump the state of either a Session or a Collobject.

 o dumpSharable
 public synchronized void dumpSharable(Sharable toDump,
                                       String toWho,
                                       MarshallOutput out)
This method is called when a SessionManager is asked to dump the state of either a Session or a Collobject.

 o good
 public boolean good()
 o minorVersionNumber
 protected static int minorVersionNumber()
 o majorVersionNumber
 protected static int majorVersionNumber()
 o releaseNumber
 public static String releaseNumber()
 o setAppletContext
 public static void setAppletContext(AppletContext ac)
 o getAppletContext
 public static AppletContext getAppletContext()
 o findAddress
 public static InetAddress findAddress(String key)
 o setLatestNeighborhood
 public void setLatestNeighborhood(String hood)
 o getLatestNeighborhood
 public String getLatestNeighborhood()
 o notifyNeighborhood
 protected void notifyNeighborhood(String sessionName,
                                   String server,
                                   String portNum)
 o setClipboard
 public void setClipboard(ImagePrimitiveP clipboard)
 o getClipboard
 public ImagePrimitiveP getClipboard()
 o sendBeep
 public void sendBeep(SessionParticipant p)
 o setCollaborativeEnvironment
 public void setCollaborativeEnvironment(Object e)
 o getCollaborativeEnvironment
 public Object getCollaborativeEnvironment()
 o isEnvironmentInterface
 public boolean isEnvironmentInterface(String className)
 o isInterface
 public boolean isInterface(Object object,
                            String className)
 o getEnvAsWarningAware
 public WarningAware getEnvAsWarningAware()
 o getEnvAsSessionsAware
 public SessionsAware getEnvAsSessionsAware()
 o getEnvAsParticipantsAware
 public ParticipantsAware getEnvAsParticipantsAware()
 o getEnvAsToolsAware
 public ToolsAware getEnvAsToolsAware()
 o getEnvAsEnvironmentAware
 public EnvironmentAware getEnvAsEnvironmentAware()
 o getReplayController
 public ReplayController getReplayController()
Returns:
returns the replay object for the user
 o setReplay
 public void setReplay(ReplayController newReplayController)
Parameters:
newReplayController - the new replay controller
Returns:
sets the replay controller
 o checkSessionExistence
 public void checkSessionExistence(MarshallInput in,
                                   MarshallOutput out)

All Packages  Class Hierarchy  This Package  Previous  Next  Index