|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gecco.communication.server.RoleConnection
A class that represents the connection from the server to a specific role. So this class keeps track of all the clients that have joined as that specific role
Constructor Summary | |
RoleConnection(String role,
Server server)
Constructor for the RoleConnection object |
Method Summary | |
void |
add(ClientConnection c)
adds a new client to this role |
int |
getAvailableId()
returns the lowest nonnegative integer that is not used as an id by any client |
int |
getNumberOfClients()
returns the number of clients connected to this role |
void |
remove(ClientConnectionHandler c)
removes a client from this role |
void |
sendMessage(Message m)
called by ClientAmbassodor to send a message to this role This method then distributes this message to all clients connected as this role |
String |
whoIsConnected()
returns a string with the names of the clients connected to this role. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RoleConnection(String role, Server server)
role
- Description of Parameterserver
- Description of ParameterMethod Detail |
public int getNumberOfClients()
public int getAvailableId()
public void add(ClientConnection c)
c
- Description of Parameterpublic void remove(ClientConnectionHandler c)
c
- Description of Parameterpublic String whoIsConnected()
public void sendMessage(Message m)
m
- Description of Parameter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |