public class RemoteCommand extends AdHocCommand
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.AdHocCommand.Action, AdHocCommand.SpecificErrorCondition, AdHocCommand.Status
Modifier | Constructor and Description |
---|---|
protected |
RemoteCommand(org.jivesoftware.smack.XMPPConnection connection,
java.lang.String node,
org.jxmpp.jid.Jid jid)
Creates a new RemoteCommand that uses an specific connection to execute a
command identified by
node in the host identified by
jid |
Modifier and Type | Method and Description |
---|---|
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.
|
org.jxmpp.jid.Jid |
getOwnerJID()
Returns the full JID of the owner of this command.
|
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.
|
addActionAvailable, addNote, getActions, getExecuteAction, getForm, getName, getNode, getNotes, getRaw, getSpecificErrorCondition, getStatus, isCompleted, isValidAction, setExecuteAction, setForm, setName, setNode
protected RemoteCommand(org.jivesoftware.smack.XMPPConnection connection, java.lang.String node, org.jxmpp.jid.Jid 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.public void cancel() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
AdHocCommand
cancel
in class AdHocCommand
org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the remote entity.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if there is a problem executing the command.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void complete(Form form) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
AdHocCommand
response
. 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 AdHocCommand
form
- the form answer of the previous stage.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the remote entity.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if there is a problem executing the command.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void execute() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
AdHocCommand
execute
in class AdHocCommand
org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the remote entity.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if there is an error executing the command.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void execute(Form form) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
form
- the form answer of the previous stage.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if an error occurs.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the server.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void next(Form form) throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
AdHocCommand
response
. 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 AdHocCommand
form
- the form answer of the previous stage.org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the remote entity.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if there is a problem executing the command.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public void prev() throws org.jivesoftware.smack.SmackException.NoResponseException, org.jivesoftware.smack.XMPPException.XMPPErrorException, org.jivesoftware.smack.SmackException.NotConnectedException, java.lang.InterruptedException
AdHocCommand
prev
in class AdHocCommand
org.jivesoftware.smack.SmackException.NoResponseException
- if there was no response from the remote entity.org.jivesoftware.smack.XMPPException.XMPPErrorException
- if there is a problem executing the command.org.jivesoftware.smack.SmackException.NotConnectedException
- if the XMPP connection is not connected.java.lang.InterruptedException
- if the calling thread was interrupted.public org.jxmpp.jid.Jid getOwnerJID()
AdHocCommand
getOwnerJID
in class AdHocCommand