com.lyrisoft.chat.server.local
Class CommandProcessorLocal

java.lang.Object
  |
  +--com.lyrisoft.chat.server.local.CommandProcessorLocal
All Implemented Interfaces:
ICommands

public class CommandProcessorLocal
extends java.lang.Object
implements ICommands

CommandProcessorLocal lives on the local (client) side and processes messages that come from the server. This class maintains a registry of ICommandProcessorLocal instances. When the process method is called, the appropriate ICommandProcessorLocal is invoked. If no processor is found, generalMessage is invoked on the client.

See Also:
com.lyrisoft.chat.server.local.command, ICommandProcessorLocal

Fields inherited from interface com.lyrisoft.chat.ICommands
ACCESS_DENIED, ACK_KILL, ALREADY_SIGNED_ON, DELIMITER, EMOTE_TO_ROOM, EMOTE_TO_USER, ERROR, GET_ROOMS, GET_USERS_IN_ROOM, GET_USERS_ON_SERVER, HELP, HYPERLINK, IGNORE, INVALID_CHARACTER, INVITE, JOIN_ROOM, JOIN_ROOM_ACK, KICK, KILL, NO_INVITE, NO_SUCH_USER, OP, PART_ROOM, PART_ROOM_ACK, PING, PONG, REMOTE_CLIENT_MESSAGE, ROOM_ACCESS_DENIED, ROOM_DIFF, ROOM_MSG, ROOM_USER_DIFF, SAY_TO_ROOM, SAY_TO_USER, SHUTDOWN, SIGNOFF, SIGNON, SIGNON_ACK, STATS, UNIGNORE, UNINVITE, USER_DIFF, VERSION, WHOIS
 
Constructor Summary
CommandProcessorLocal(java.util.Properties p)
           
 
Method Summary
static java.lang.String[] decompose(java.lang.String input)
          Helper function that breaks a server message down into an array
 void extendCommandSet(java.lang.String command, ICommandProcessorLocal processor)
          Used to extend the core set of commands that the client can process.
 void process(java.lang.String input, IChatClient client)
          Process a message that came over the socket Find the appropriate ICommandProcessorLocal instance in the registry, then invoke its process method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandProcessorLocal

public CommandProcessorLocal(java.util.Properties p)
Method Detail

extendCommandSet

public void extendCommandSet(java.lang.String command,
                             ICommandProcessorLocal processor)
Used to extend the core set of commands that the client can process.
Parameters:
command - the first argument of the command
processor - an ICommandProcessorLocal instance that will handle the new command.

process

public void process(java.lang.String input,
                    IChatClient client)
Process a message that came over the socket Find the appropriate ICommandProcessorLocal instance in the registry, then invoke its process method
Parameters:
input - the raw message
client - the chat client to perform the callback on

decompose

public static java.lang.String[] decompose(java.lang.String input)
Helper function that breaks a server message down into an array


Copyright © 2000-2002 Taso Lyristis