com.lyrisoft.chat.server.remote.command
Class CommandBase

java.lang.Object
  |
  +--com.lyrisoft.chat.server.remote.command.CommandBase
All Implemented Interfaces:
ICommandProcessorRemote
Direct Known Subclasses:
BroadcastPing, EmoteRoom, EmoteUser, Hello, Help, Ignore, Invite, JoinRoom, Kick, Kill, Op, PartRoom, Ping, Pong, RemoteClientMessage, Rooms, SayToRoom, SayToUser, SetVersion, Shutdown, SignOff, SignOn, Stats, UnIgnore, UnInvite, UnknownCommand, Users, UsersInRoom, Whois

public abstract class CommandBase
extends java.lang.Object
implements ICommandProcessorRemote


Field Summary
protected  int _access
           
protected  java.lang.String _help
           
protected  java.lang.String _usage
           
 
Constructor Summary
CommandBase()
           
 
Method Summary
 int accessRequired()
          Return the minimum access level required to carry out this command.
 java.lang.String getHelp()
          Get a help line about this command
 java.lang.String getUsage(java.lang.String myName)
          Construct a usage line (e.g., "usage: /msg [user] [message]") The reason we pass name here is because this object doesn't have a particular name.
 void setAccessRequired(int access)
           
 void setHelp(java.lang.String help)
           
 void setUsage(java.lang.String usage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.lyrisoft.chat.server.remote.command.ICommandProcessorRemote
process, processDistributed
 

Field Detail

_help

protected java.lang.String _help

_access

protected int _access

_usage

protected java.lang.String _usage
Constructor Detail

CommandBase

public CommandBase()
Method Detail

setHelp

public void setHelp(java.lang.String help)
Specified by:
setHelp in interface ICommandProcessorRemote

getHelp

public java.lang.String getHelp()
Description copied from interface: ICommandProcessorRemote
Get a help line about this command
Specified by:
getHelp in interface ICommandProcessorRemote
Following copied from interface: com.lyrisoft.chat.server.remote.command.ICommandProcessorRemote
Returns:
a short blurb about what this command does, or null if this command should not show up in a help message

setAccessRequired

public void setAccessRequired(int access)
Specified by:
setAccessRequired in interface ICommandProcessorRemote

accessRequired

public int accessRequired()
Description copied from interface: ICommandProcessorRemote
Return the minimum access level required to carry out this command. Access levels are defined as constants in IAuthenticator.
Specified by:
accessRequired in interface ICommandProcessorRemote
Following copied from interface: com.lyrisoft.chat.server.remote.command.ICommandProcessorRemote
Returns:
the minimum access level required to carry out this command.
See Also:
IAuthenticator

setUsage

public void setUsage(java.lang.String usage)
Specified by:
setUsage in interface ICommandProcessorRemote

getUsage

public java.lang.String getUsage(java.lang.String myName)
Description copied from interface: ICommandProcessorRemote
Construct a usage line (e.g., "usage: /msg [user] [message]") The reason we pass name here is because this object doesn't have a particular name. The name is really determined by the CommandProcessorRemote class. A command could possibly have aliases, or it's name may change. To play it safe then, we will pass the name here in order to derive the usage string. Note: the output of this command might not be completely accurate. The output should reflect what the user has to type, not the actual parameters according to the protocol. (The client program knows how to add implicit paramaters, such as the time argument for ping)
Specified by:
getUsage in interface ICommandProcessorRemote
Following copied from interface: com.lyrisoft.chat.server.remote.command.ICommandProcessorRemote
Parameters:
name - the name to use in constructing the usage line
Returns:
the usage line


Copyright © 2000-2002 Taso Lyristis