f00f.net.irc.martyr
Interface InCommand

All Superinterfaces:
Command
All Known Implementing Classes:
GenericInCommand, ModeCommand

public interface InCommand
extends Command

Defines commands that come from the server. Errors and replies are incoming commands.

See Also:
GenericCommand, GenericError, GenericReply

Method Summary
 java.lang.String getAttribute(java.lang.String key)
          Returns the attribute, or null if the attribute does not exist, or is not defined.
 java.util.Iterator getAttributeKeys()
          Returns an iterator of String objects over the attribute names for this command.
 java.lang.String getSourceString()
          Allows a third party to receive a copy of the raw string.
 State getState()
          Some commands, when received by the server, can only occur in one state.
 InCommand parse(java.lang.String prefix, java.lang.String identifier, java.lang.String params)
          Parses a string and produces a formed command object, if it can.
 void selfRegister(CommandRegister commandRegister)
          Every incoming command should know how to register itself with the command register.
 void setSourceString(java.lang.String str)
          Gives the command a copy of the raw string from the server.
 boolean updateClientState(ClientState state)
          Asks the command to ensure that information it knows about the state the server thinks the client is in matches what we have.
 
Methods inherited from interface f00f.net.irc.martyr.Command
getIrcIdentifier
 

Method Detail

getState

public State getState()
Some commands, when received by the server, can only occur in one state. Thus, when this command is received, the protocol should assume that it is in that state, and a state change may be triggered. A command can use the 'unknown' state to indicate it can be received in any state (for example, ping).

selfRegister

public void selfRegister(CommandRegister commandRegister)
Every incoming command should know how to register itself with the command register.

parse

public InCommand parse(java.lang.String prefix,
                       java.lang.String identifier,
                       java.lang.String params)
Parses a string and produces a formed command object, if it can. Should return null if it cannot form the command object. The identifier is usually ignored, except in the special case where commands can be identified by multiple identifiers. In that case, the behaviour of the command may change in sublte ways.

setSourceString

public void setSourceString(java.lang.String str)
Gives the command a copy of the raw string from the server. Called by IRCConnection after the command is parsed.

getSourceString

public java.lang.String getSourceString()
Allows a third party to receive a copy of the raw string.

updateClientState

public boolean updateClientState(ClientState state)
Asks the command to ensure that information it knows about the state the server thinks the client is in matches what we have. Returns true if state changes were made.

getAttributeKeys

public java.util.Iterator getAttributeKeys()
Returns an iterator of String objects over the attribute names for this command. Warning: Still new, support for this is not yet widespread. Should return all possible attribute keys, not just those that have a value in the current context.

getAttribute

public java.lang.String getAttribute(java.lang.String key)
Returns the attribute, or null if the attribute does not exist, or is not defined.


Copyright © 2000,2001,2002,2003 f00f networks.