|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.indy.CommandEvent
Command
represents information about commands received
by a TCPServer
for an executing PeerThread
,
and handled using a CommandHandler
.
Command
provides properties that identify the Thread generating the command, and the CommandHandler used to service the command. In addition, TIdCommand also implements methods that allow assigning the response for the command, and a mechanism for sending the command reply using the
thread connection that generated the command request.
Command
instances are created in CommandHandler#check(String,PeerThread)
when a given command can be handled by the CommandHandlers
for the server, using the PeerThread
that is executed in the
TCPServer
context.
CommandHandler
,
CommandHandler#check(String,PeerThread)
,
TCPServer
,
PeerThread
,
RFCReply
Method Summary | |
CommandHandler |
getCommandHandler()
CommandHandler is a read-only CommandHandler
property that represents the command handler that
created the CommandEvent object instance. |
StringList |
getParams()
Returns the parameters associated with this Command
as a StringList . |
boolean |
getPerformReply()
Returns whether the RFCReply returned by
getReply() should be sent back to the peer
in reponse. |
java.lang.String |
getRawLine()
Gets the raw line that was sent to the server for this command. |
RFCReply |
getReply()
Gets the RFCReply associated with this command. |
StringList |
getResponse()
Gets the response attribute of this Command as a StringList |
PeerThread |
getThread()
Gets the PeerThread that is handling this command. |
java.lang.String |
getUnparsedParams()
Returns the parameters sent to the server as an unparsed string. |
void |
sendReply()
Forces the command to send a reply back to the client. |
void |
setPerformReply(boolean performReply)
Sets whether or not the RFCReply returned
by getReply() should be sent back to the peer. |
void |
setReply(RFCReply reply)
Sets the RFCReply to be sent back to the peer. |
void |
setResponse(StringList response)
Sets the IdStrings to use as a resopnse for this command |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public void setPerformReply(boolean performReply)
RFCReply
returned
by getReply()
should be sent back to the peer.performReply
- The new performReply valuegetPerformReply()
,
getReply()
,
RFCReply
public void setReply(RFCReply reply)
RFCReply
to be sent back to the peer.reply
- The new RFCReply
obect to use.getReply()
,
RFCReply
public void setResponse(StringList response)
IdStrings
to use as a resopnse for this commandresponse
- The new response valuepublic CommandHandler getCommandHandler()
CommandHandler
property that represents the command handler that
created the CommandEvent
object instance.
The CommandHandler
is assigned when the
object instance is created as the peer thread
is executed in CommandHandler#check(String,PeerThread)
.CommandEvent
handler.CommandHandler
public boolean getPerformReply()
RFCReply
returned by
getReply()
should be sent back to the peer
in reponse.getPeformReply
,
RFCReply
public StringList getParams()
Command
as a StringList
.
If the creating CommandHandler
had it's parseParams
property set to true
then the StringList
will contain the parameters tokenised using the CommandHandler's
command delimiter. Otherwise the list will just contain the unparsed
parameteters as a single string.
- Returns:
- A collection of strings representing the parameters sent with this command.
public java.lang.String getRawLine()
public RFCReply getReply()
RFCReply
associated with this command.RFCReply
object.public StringList getResponse()
Command
as a StringList
public PeerThread getThread()
PeerThread
that is handling this command.PeerThread
that is handling this command.public java.lang.String getUnparsedParams()
public void sendReply() throws IndyException
IndyException
- If an exception occurs whilst writing the reply to the socket.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |