|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.indy.CommandHandler
Provides the basis for TCPServer
command handling.
Constructor Summary | |
CommandHandler(CommandHandlers collection)
Constructs a new instance. |
Method Summary | |
void |
addCommandListener(CommandHandlerListener l)
Registers an IdCommandListener instance to be informed of
events from this handler. |
protected void |
doCommand(CommandEvent command)
Calls all CommandListener 's CommandListener#onCommand() method. |
char |
getCmdDelimiter()
Gets the command delimiter for this command handler |
java.lang.String |
getCommand()
Gets the command attribute of the IdCommandHandler object |
CommandHandlers |
getCommandHandlers()
Returns the containing collection of this command handler. |
char |
getParamDelimiter()
Gets the paramDelimiter attribute of the IdCommandHandler object |
int |
getReplyExceptionCode()
Gets the replyExceptionCode attribute of the CommandHandler object |
RFCReply |
getReplyNormal()
Gets the replyNormal attribute of the CommandHandler object |
StringList |
getResponse()
Gets the response attribute of the CommandHandler object |
int |
getTag()
Gets the tag attribute of the CommandHandler object |
boolean |
isDisconnected()
Gets the disconnect attribute of the CommandHandler object |
boolean |
isEnabled()
Gets the enabled attribute of the IdCommandHandler object |
boolean |
isParseParams()
Gets the parseParams attribute of the CommandHandler object |
void |
removeCommandListener(CommandHandlerListener l)
Unregisters an IdCommandListener instance. |
void |
setCmdDelimiter(char cmdDelimiter)
Sets the command delimiter for this handler object. |
void |
setCommand(java.lang.String command)
Sets command string that this handler is associated with. |
void |
setDisconnect(boolean disconnect)
Sets whether this handler should disconnect from the client when it has finished. |
void |
setEnabled(boolean enabled)
Enables / disables this handler. |
void |
setParamDelimiter(char paramDelimiter)
Sets the parameter delimiter for this handler. |
void |
setParseParams(boolean parseParams)
Sets whether this handler should attempt to parse the parameters sent to it. |
void |
setReplyExceptionCode(int replyExceptionCode)
Sets the numerical code for this handler to use if an exception is encountered during processing (e.g. |
void |
setReplyNormal(RFCReply replyNormal)
Sets the standard RFCReply object to use as a response to this command |
void |
setResponse(StringList response)
Sets the StringList that form the textual reponse for this command handler. |
void |
setTag(int tag)
Sets the tag attribute of the CommandHandler object |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CommandHandler(CommandHandlers collection)
CommandHandlers
collection.collection
- The CommandHandlers
collection that contains this handler.Method Detail |
public void setCmdDelimiter(char cmdDelimiter)
cmdDelimiter
- The new delimiter valuepublic void setDisconnect(boolean disconnect)
disconnect
- The new disconnect valuepublic void setEnabled(boolean enabled)
enabled
- true
to enable the handler, false
to disable.public void setCommand(java.lang.String command)
command
- The new command valuepublic void setParamDelimiter(char paramDelimiter)
paramDelimiter
- The new parameter delimiter.public void setParseParams(boolean parseParams)
parseParams
- true
to enable parsing, false
to disable.public void setReplyExceptionCode(int replyExceptionCode)
replyExceptionCode
- The numerical reply for exception conditionspublic void setReplyNormal(RFCReply replyNormal)
RFCReply
object to use as a response to this commandreplyNormal
- The new replyNormal valuepublic void setResponse(StringList response)
StringList
that form the textual reponse for this command handler.response
- The new response valuepublic void setTag(int tag)
CommandHandler
objecttag
- The new tag valuepublic CommandHandlers getCommandHandlers()
public char getCmdDelimiter()
public boolean isDisconnected()
CommandHandler
objectpublic boolean isEnabled()
public java.lang.String getCommand()
public char getParamDelimiter()
public boolean isParseParams()
CommandHandler
objectpublic int getReplyExceptionCode()
CommandHandler
objectpublic RFCReply getReplyNormal()
CommandHandler
objectpublic StringList getResponse()
public int getTag()
protected void doCommand(CommandEvent command) throws IndyException
CommandListener
's CommandListener#onCommand()
method.command
- The IdCommand
object to pass.IdException
- If an exception is thrown by the IdCommandListenerpublic void removeCommandListener(CommandHandlerListener l)
IdCommandListener
instance.l
- The listener to remove.public void addCommandListener(CommandHandlerListener l)
IdCommandListener
instance to be informed of
events from this handler.l
- The listener to add.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |