tasks
Class ChatServerNetworkSilent

java.lang.Object
  extended by tasks.ChatServerNetworkSilent
All Implemented Interfaces:
ChatServerNetwork

public class ChatServerNetworkSilent
extends java.lang.Object
implements ChatServerNetwork

This is a ChatServerNetwork that doesn't provide any network connectivity. This is used to provide a "Silent" chat server that only Caches state and doesn't try to propagate it.

Author:
sean

Constructor Summary
ChatServerNetworkSilent()
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChatServerNetworkSilent

public ChatServerNetworkSilent()
Method Detail

broadcastMessage

public void broadcastMessage(java.lang.String message)
                      throws java.io.IOException
Description copied from interface: ChatServerNetwork
Broadcast a message to all the other chat servers

Specified by:
broadcastMessage in interface ChatServerNetwork
Throws:
java.io.IOException

clientConnection

public void clientConnection(java.nio.channels.SocketChannel channel,
                             java.lang.String sessionId)
Description copied from interface: ChatServerNetwork
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.

Specified by:
clientConnection in interface ChatServerNetwork

clientDisconnection

public void clientDisconnection(java.nio.channels.SocketChannel channel)
Description copied from interface: ChatServerNetwork
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.

Specified by:
clientDisconnection in interface ChatServerNetwork

sendToClient

public void sendToClient(java.lang.String sessionId,
                         java.lang.String message)
                  throws java.io.IOException
Description copied from interface: ChatServerNetwork
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.

Specified by:
sendToClient in interface ChatServerNetwork
Throws:
java.io.IOException

sendToClients

public void sendToClients(java.lang.String message)
Description copied from interface: ChatServerNetwork
Send a message to all clients connected directly to the chat server

Specified by:
sendToClients in interface ChatServerNetwork