public class CollabServer extends Server
Server class
that provides specific support for the collaboration mechanism
within the IDV.
This class does 2 things. First it overwrites the base clas method createClient to create CollabClient objects. Second it routes the server calls (e.g., handleIncomingMessage, notifyClientAdd, etc.) to the CollabManager
DEFAULT_PORT| Constructor and Description |
|---|
CollabServer(CollabManager collabManager,
int port)
Create the server with the given collaboratio manager.
|
| Modifier and Type | Method and Description |
|---|---|
protected Client |
createClient(java.net.Socket clientSocket)
Factory method for creating our own CollabClient object.
|
void |
handleIncomingMessage(Client client,
java.lang.String message)
Route the call to the CollabManager
|
protected void |
notifyClientAdd(Client client)
Gets called when we have added a new client.
|
protected void |
notifyClientRemove(Client client)
Gets called when we have removed a client.
|
protected void |
notifyServerStart()
Gets called when we are starting to listen
Route the call to the CollabManager
|
protected void |
notifyServerStop()
Gets called when we are done running on the server socket
Route the call to the CollabManager
|
addClient, addClient, getClients, getIsRunning, hasClients, initClient, logException, main, removeClient, startServer, startServer, stopServer, write, writepublic CollabServer(CollabManager collabManager, int port)
collabManager - The singleton collab managerport - The port to open a listening socket onprotected Client createClient(java.net.Socket clientSocket) throws java.io.IOException
createClient in class ServerclientSocket - The socket we are connected to the client withjava.io.IOExceptionpublic void handleIncomingMessage(Client client, java.lang.String message)
handleIncomingMessage in class Serverclient - The client the message came onmessage - The messageprotected void notifyServerStop()
notifyServerStop in class Serverprotected void notifyServerStart()
notifyServerStart in class Serverprotected void notifyClientAdd(Client client)
notifyClientAdd in class Serverclient - The new clientprotected void notifyClientRemove(Client client)
notifyClientRemove in class Serverclient - The removed client