tasks
Interface ChatServerNetwork

All Known Implementing Classes:
ChatServerNetworkSilent, ChatServerNetworkTask

public interface ChatServerNetwork

Interface that defines objects that provide network connectivity to a chat server.

Author:
sean

Method Summary
 void broadcastMessage(java.lang.String message)
          Broadcast a message to all the other chat servers
 void clientConnection(java.nio.channels.SocketChannel channel, java.lang.String sessionId)
          This is called when a client has connected to the chat server.
 void clientDisconnection(java.nio.channels.SocketChannel channel)
          This is called when a client has disconnected from the chat server This is used to modifying internal data structures that allow sendToClient[s] to work.
 void sendToClient(java.lang.String sessionId, java.lang.String message)
          Send a message to the connected client that has the given session id.
 void sendToClients(java.lang.String message)
          Send a message to all clients connected directly to the chat server
 

Method Detail

broadcastMessage

void broadcastMessage(java.lang.String message)
                      throws java.io.IOException
Broadcast a message to all the other chat servers

Parameters:
message -
Throws:
java.io.IOException

sendToClients

void sendToClients(java.lang.String message)
Send a message to all clients connected directly to the chat server

Parameters:
message -

sendToClient

void sendToClient(java.lang.String sessionId,
                  java.lang.String message)
                  throws java.io.IOException
Send a message to the connected client that has the given session id. This won't do anything if no connected client is using that session id.

Parameters:
sessionId -
message -
Throws:
java.io.IOException

clientConnection

void clientConnection(java.nio.channels.SocketChannel channel,
                      java.lang.String sessionId)
This is called when a client has connected to the chat server. This is used to modifying internal data structures that allow sendToClient[s] to work.

Parameters:
channel -
sessionId -

clientDisconnection

void clientDisconnection(java.nio.channels.SocketChannel channel)
This is called when a client has disconnected from the chat server This is used to modifying internal data structures that allow sendToClient[s] to work.

Parameters:
channel -