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"
-
addressCache
-
-
clipboard
-
-
collaborativeEnvironment
-
-
context
-
-
id
-
-
latestHood
-
-
listener
-
-
multicastAddress
-
-
multicastPort
-
-
multipleConnections
-
-
nextSessionController
-
-
owner
-
-
portLocations
-
-
server
-
-
startTime
-
-
addSession(Session)
- Add the given session to my list.
-
askForInfo(SessionInfo)
-
-
checkSessionExistence(MarshallInput, MarshallOutput)
-
-
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.
-
checkVersion(MarshallInput)
-
-
dumpSharable(MarshallInput, MarshallOutput)
- This method is called when a SessionManager is asked to dump the state
of either a Session or a Collobject.
-
dumpSharable(Sharable, String, MarshallOutput)
- This method is called when a SessionManager is asked to dump the state
of either a Session or a Collobject.
-
executeMissedActions(MarshallInput, MarshallOutput)
-
-
findAddress(String)
-
-
findAuthentication(MarshallInput, MarshallOutput)
-
-
findParticipant(MarshallInput, MarshallOutput)
-
-
findSessionName(MarshallInput, MarshallOutput)
-
-
findType(MarshallInput, MarshallOutput)
-
-
getAppletContext()
-
-
getClipboard()
-
-
getCollaborativeEnvironment()
-
-
getEnvAsEnvironmentAware()
-
-
getEnvAsParticipantsAware()
-
-
getEnvAsSessionsAware()
-
-
getEnvAsToolsAware()
-
-
getEnvAsWarningAware()
-
-
getInfoAsString()
- Returns a string with info about all the sessions on this server
-
getLatestNeighborhood()
-
-
getListeningPort()
-
-
getManager()
- Static method called to get the one instance of this class.
-
getMulticastAddress()
-
-
getMulticastPort()
-
-
getNextMulticastPort()
-
-
getNextPortNum()
-
-
getReplayController()
-
-
good()
-
-
handleInstruction(String, MarshallInput, MarshallOutput)
-
-
handleNewConnection(MarshallInput, MarshallOutput)
-
-
id()
- Returns the id of this object, which is the hostname + listening port.
-
initiateReplaySession(SessionInfo, MarshallInput)
- This is called by a client to start a session of the given name on a
given address/port.
-
initiateSession(SessionInfo)
- This is called by a client to start a session of the given name on a
given address/port.
-
initiateSession(SessionInfo, String, MarshallInput)
- This is called by a client to start a session of the given name on a
given address/port.
-
invited(MarshallInput, MarshallOutput)
-
-
isEnvironmentInterface(String)
-
-
isInterface(Object, String)
-
-
joinOrStartRequested(MarshallInput, MarshallOutput)
-
-
joinSession(String, String, int)
- This is called by a client to join a session of the given name on a
given address/port.
-
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.
-
joinSessionRequested(Session, SessionParticipant, MarshallInput, MarshallOutput)
-
-
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.
-
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.
-
majorVersionNumber()
-
-
makeManager(Vector)
-
-
makeManager(Vector, boolean, String)
-
-
makeParticipant(String, int)
- Static method called to create a TCP participant
annie modif
-
makeSession(String, SessionParticipant, SessionInfo, String)
- Return a new Session with the given name, owner and additional information.
-
minorVersionNumber()
-
-
multicastEnabled()
-
-
newSessionRequested(MarshallInput, MarshallOutput)
- This is a server-side method which is called when a client requests
a new session be created.
-
newSessionRequested(String, MarshallInput, MarshallOutput)
-
-
notifyNeighborhood(String, String, String)
-
-
owner()
- Returns the owner of this object.
-
releaseNumber()
-
-
returnInvitation(SessionInfo, String)
-
-
run()
- Listen until someone makes a connection.
-
sendBeep(SessionParticipant)
-
-
sessionFromId(String)
- Returns a Session object given an Identifier
-
setAppletContext(AppletContext)
-
-
setClipboard(ImagePrimitiveP)
-
-
setCollaborativeEnvironment(Object)
-
-
setLatestNeighborhood(String)
-
-
setMulticastInformation(String, int)
-
-
setReplay(ReplayController)
-
-
setSingleConnection()
-
-
stop()
-
-
subModels()
-
-
useMultipleConnections()
-
owner
protected SessionParticipant owner
id
protected String id
server
protected ServerSocket server
addressCache
protected static Hashtable addressCache
latestHood
protected String latestHood
context
protected static AppletContext context
clipboard
protected ImagePrimitiveP clipboard
listener
protected Thread listener
multipleConnections
protected boolean multipleConnections
nextSessionController
protected ReplayController nextSessionController
multicastAddress
protected String multicastAddress
multicastPort
protected int multicastPort
portLocations
protected Vector portLocations
startTime
protected Date startTime
collaborativeEnvironment
protected Object collaborativeEnvironment
getNextPortNum
public int getNextPortNum()
handleInstruction
protected SessionManagerCommand handleInstruction(String instruction,
MarshallInput in,
MarshallOutput out)
run
public void run()
- Listen until someone makes a connection. Read the request, call a
a routine to execute it. Close the connection.
stop
public void stop()
useMultipleConnections
public boolean useMultipleConnections()
setSingleConnection
public void setSingleConnection()
getListeningPort
public int getListeningPort()
setMulticastInformation
public void setMulticastInformation(String address,
int port)
multicastEnabled
public boolean multicastEnabled()
getMulticastAddress
public String getMulticastAddress()
getMulticastPort
public int getMulticastPort()
getNextMulticastPort
public int getNextMulticastPort()
makeParticipant
public static SessionParticipant makeParticipant(String host,
int port)
- Static method called to create a TCP participant
annie modif
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.
makeManager
public static void makeManager(Vector listeningPort) throws Exception
makeManager
public static synchronized void makeManager(Vector listeningPort,
boolean url,
String location) throws Exception
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
sessionFromId
protected Session sessionFromId(String sessionId)
- Returns a Session object given an Identifier
- Parameters:
- sessionId - Specifier of the session
owner
public SessionParticipant owner()
- Returns the owner of this object.
id
public String id()
- Returns the id of this object, which is the hostname + listening port.
subModels
protected SubModels subModels()
- Overrides:
- subModels in class ModelObject
getInfoAsString
protected synchronized String getInfoAsString()
- Returns a string with info about all the sessions on this server
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.
findSessionName
protected String findSessionName(MarshallInput in,
MarshallOutput out) throws IOException
findParticipant
protected SessionParticipant findParticipant(MarshallInput in,
MarshallOutput out) throws IOException, ClassNotFoundException
findType
protected int findType(MarshallInput in,
MarshallOutput out) throws IOException, ClassNotFoundException
findAuthentication
protected String findAuthentication(MarshallInput in,
MarshallOutput out) throws IOException, ClassNotFoundException
newSessionRequested
protected Session newSessionRequested(String sessionName,
MarshallInput in,
MarshallOutput out) throws IOException, ClassNotFoundException
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.
handleNewConnection
public void handleNewConnection(MarshallInput in,
MarshallOutput out)
executeMissedActions
public void executeMissedActions(MarshallInput in,
MarshallOutput out)
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.
invited
public void invited(MarshallInput in,
MarshallOutput out)
returnInvitation
public void returnInvitation(SessionInfo info,
String neighborhood)
checkVersion
protected boolean checkVersion(MarshallInput in)
joinSessionRequested
public synchronized void joinSessionRequested(Session session,
SessionParticipant joiner,
MarshallInput in,
MarshallOutput out) throws IOException, ClassNotFoundException
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.
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.
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.
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.
joinOrStartRequested
protected Session joinOrStartRequested(MarshallInput in,
MarshallOutput out)
askForInfo
public void askForInfo(SessionInfo is)
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.
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.
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.
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.
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.
good
public boolean good()
minorVersionNumber
protected static int minorVersionNumber()
majorVersionNumber
protected static int majorVersionNumber()
releaseNumber
public static String releaseNumber()
setAppletContext
public static void setAppletContext(AppletContext ac)
getAppletContext
public static AppletContext getAppletContext()
findAddress
public static InetAddress findAddress(String key)
setLatestNeighborhood
public void setLatestNeighborhood(String hood)
getLatestNeighborhood
public String getLatestNeighborhood()
notifyNeighborhood
protected void notifyNeighborhood(String sessionName,
String server,
String portNum)
setClipboard
public void setClipboard(ImagePrimitiveP clipboard)
getClipboard
public ImagePrimitiveP getClipboard()
sendBeep
public void sendBeep(SessionParticipant p)
setCollaborativeEnvironment
public void setCollaborativeEnvironment(Object e)
getCollaborativeEnvironment
public Object getCollaborativeEnvironment()
isEnvironmentInterface
public boolean isEnvironmentInterface(String className)
isInterface
public boolean isInterface(Object object,
String className)
getEnvAsWarningAware
public WarningAware getEnvAsWarningAware()
getEnvAsSessionsAware
public SessionsAware getEnvAsSessionsAware()
getEnvAsParticipantsAware
public ParticipantsAware getEnvAsParticipantsAware()
getEnvAsToolsAware
public ToolsAware getEnvAsToolsAware()
getEnvAsEnvironmentAware
public EnvironmentAware getEnvAsEnvironmentAware()
getReplayController
public ReplayController getReplayController()
- Returns:
- returns the replay object for the user
setReplay
public void setReplay(ReplayController newReplayController)
- Parameters:
- newReplayController - the new replay controller
- Returns:
- sets the replay controller
checkSessionExistence
public void checkSessionExistence(MarshallInput in,
MarshallOutput out)
All Packages Class Hierarchy This Package Previous Next Index