org.jdesktop.wonderland.server.comms
Class ProtocolSessionListener.ProtocolClientMap

java.lang.Object
  extended by org.jdesktop.wonderland.server.comms.ProtocolSessionListener.ProtocolClientMap
All Implemented Interfaces:
com.sun.sgs.app.ManagedObject, java.io.Serializable
Enclosing class:
ProtocolSessionListener

protected static class ProtocolSessionListener.ProtocolClientMap
extends java.lang.Object
implements com.sun.sgs.app.ManagedObject, java.io.Serializable

A record of clients connected with the given protocol

See Also:
Serialized Form

Constructor Summary
protected ProtocolSessionListener.ProtocolClientMap()
           
 
Method Summary
 void add(CommunicationsProtocol protocol, com.sun.sgs.app.ClientSession session)
          Add a session to a communications protocol
 CommunicationsProtocol get(com.sun.sgs.app.ClientSession session)
          Get the protocol associated with the given session
 java.util.Set<com.sun.sgs.app.ClientSession> get(CommunicationsProtocol protocol)
          Get all sessions associated with the given protocol
 void remove(CommunicationsProtocol protocol, com.sun.sgs.app.ManagedReference<com.sun.sgs.app.ClientSession> sessionRef)
          Remove a session from a communications protocol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtocolSessionListener.ProtocolClientMap

protected ProtocolSessionListener.ProtocolClientMap()
Method Detail

add

public void add(CommunicationsProtocol protocol,
                com.sun.sgs.app.ClientSession session)
Add a session to a communications protocol

Parameters:
protocol - the communications protocol
session - the client session associated with the given protocol

remove

public void remove(CommunicationsProtocol protocol,
                   com.sun.sgs.app.ManagedReference<com.sun.sgs.app.ClientSession> sessionRef)
Remove a session from a communications protocol

Parameters:
protocol - the communications protocol
sessionRef - a reference to the client session associated with the given protocol

get

public java.util.Set<com.sun.sgs.app.ClientSession> get(CommunicationsProtocol protocol)
Get all sessions associated with the given protocol

Parameters:
protocol - the protocol
Returns:
the set of client sessions associated with the given protocol, or an empty set if no sessions are associated with the protocol

get

public CommunicationsProtocol get(com.sun.sgs.app.ClientSession session)
Get the protocol associated with the given session

Parameters:
session - the session to get
Returns:
the protocol in use by that session, or null if the sessionId does not exist


Open Wonderland - http://openwonderland.org