HooChat
Class MessageServerImpl

java.lang.Object
  |
  +--org.omg.PortableServer.Servant
        |
        +--HooChat.IM_MODULE.MessageServerPOA
              |
              +--HooChat.MessageServerImpl
All Implemented Interfaces:
InvokeHandler, MessageServerOperations

public class MessageServerImpl
extends MessageServerPOA

This is the class where server methods are located


Constructor Summary
MessageServerImpl(int currentServerNum)
           
 
Method Summary
 void clientCheckIn(String username)
          The client calls this method to let the server know that it is still alive.
 String getClientList()
          The client calls this to get the list of clients that are currently signed on as a comma delimited string Version 2: Chuck has added global state via hydra services to get the most up-to-date list down
 String getMessage(String username)
          Gets the most current "message" which is a vector containing a username and message.
 void logOff(String username)
          The client uses this method to notify the server that it is logging out of the chat.
 void post(String username, String msg)
          The client uses this method to post a message to the chat room
 boolean register(String username, String password)
          The client is invoked by the client to log-in to the system, authenticate(and i use that term SO loosely) the identity of the client
 
Methods inherited from class HooChat.IM_MODULE.MessageServerPOA
_all_interfaces, _invoke, _this, _this
 
Methods inherited from class org.omg.PortableServer.Servant
_default_POA, _get_delegate, _get_interface_def, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageServerImpl

public MessageServerImpl(int currentServerNum)
Method Detail

clientCheckIn

public void clientCheckIn(String username)
The client calls this method to let the server know that it is still alive. Essentially, this means putting a true value in the clientsCheckedIn hashTable used to monitor client status Version 2: This is now a globally stored object via Hydra services!

Parameters:
username - the name of the user that wants to check in
Returns:
void

getClientList

public String getClientList()
The client calls this to get the list of clients that are currently signed on as a comma delimited string Version 2: Chuck has added global state via hydra services to get the most up-to-date list down

Returns:
String

logOff

public void logOff(String username)
The client uses this method to notify the server that it is logging out of the chat. This is the "clean" log-off mechanism and is not used when the client is simply killed Version 2: Chuck has added global state via hydraServices to make sure we keep the lists updated

Parameters:
username - the name of the user that wants to log-off
Returns:
void

getMessage

public String getMessage(String username)
Gets the most current "message" which is a vector containing a username and message. If there is no message it returns null;

Returns:
Vector

post

public void post(String username,
                 String msg)
The client uses this method to post a message to the chat room

Parameters:
username - the name of the user that is posting
msg - the message they are posting
Returns:
void

register

public boolean register(String username,
                        String password)
The client is invoked by the client to log-in to the system, authenticate(and i use that term SO loosely) the identity of the client

Parameters:
username - the name of the user logging in
password - the client password
Returns:
boolean this value is true if registration was successful