|
Smack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jivesoftware.smackx.commands.AdHocCommand
org.jivesoftware.smackx.commands.RemoteCommand
public class RemoteCommand
Represents a command that is in a remote location. Invoking one of the
execute, next,
prev, cancel or
complete actions results in executing that
action in the remote location. In response to that action the internal state
of the this command instance will change. For example, if the command is a
single stage command, then invoking the execute action will execute this
action in the remote location. After that the local instance will have a
state of "completed" and a form or notes that applies.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.jivesoftware.smackx.commands.AdHocCommand |
|---|
AdHocCommand.Action, AdHocCommand.SpecificErrorCondition, AdHocCommand.Status |
| Constructor Summary | |
|---|---|
protected |
RemoteCommand(Connection connection,
String node,
String jid)
Creates a new RemoteCommand that uses an specific connection to execute a command identified by node in the host identified by
jid |
| Method Summary | |
|---|---|
void |
cancel()
Cancels the execution of the command. |
void |
complete(Form form)
Completes the command execution with the information provided in the response. |
void |
execute()
Executes the command. |
void |
execute(Form form)
Executes the default action of the command with the information provided in the Form. |
String |
getOwnerJID()
Returns the full JID of the owner of this command. |
long |
getPacketReplyTimeout()
Returns the number of milliseconds to wait for a respone. |
void |
next(Form form)
Executes the next action of the command with the information provided in the response. |
void |
prev()
Goes to the previous stage. |
void |
setPacketReplyTimeout(long packetReplyTimeout)
Returns the number of milliseconds to wait for a respone. |
| Methods inherited from class org.jivesoftware.smackx.commands.AdHocCommand |
|---|
addActionAvailable, addNote, getActions, getExecuteAction, getForm, getName, getNode, getNotes, getRaw, getSpecificErrorCondition, getStatus, isValidAction, setExecuteAction, setForm, setName, setNode |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected RemoteCommand(Connection connection,
String node,
String jid)
node in the host identified by
jid
connection - the connection to use for the execution.node - the identifier of the command.jid - the JID of the host.| Method Detail |
|---|
public void cancel()
throws XMPPException
AdHocCommand
cancel in class AdHocCommandXMPPException - if there is a problem executing the command.
public void complete(Form form)
throws XMPPException
AdHocCommandresponse. This form must be the answer form of the
previous stage. This method will be only invoked for commands that have one
or more stages. If there is a problem executing the command it throws an
XMPPException.
complete in class AdHocCommandform - the form answer of the previous stage.
XMPPException - if there is a problem executing the command.
public void execute()
throws XMPPException
AdHocCommand
execute in class AdHocCommandXMPPException - if there is an error executing the command.
public void execute(Form form)
throws XMPPException
form - the form anwser of the previous stage.
XMPPException - if an error occurs.
public void next(Form form)
throws XMPPException
AdHocCommandresponse. This form must be the answer form of the
previous stage. This method will be only invoked for commands that have one
or more stages. If there is a problem executing the command it throws an
XMPPException.
next in class AdHocCommandform - the form answer of the previous stage.
XMPPException - if there is a problem executing the command.
public void prev()
throws XMPPException
AdHocCommand
prev in class AdHocCommandXMPPException - if there is a problem executing the command.public String getOwnerJID()
AdHocCommand
getOwnerJID in class AdHocCommandpublic long getPacketReplyTimeout()
default value
should be adjusted for commands that can take a long time to execute.
public void setPacketReplyTimeout(long packetReplyTimeout)
default value
should be adjusted for commands that can take a long time to execute.
packetReplyTimeout - the number of milliseconds to wait for responses.
|
Smack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||