|
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.LocalCommand
public abstract class LocalCommand
Represents a command that can be executed locally from a remote location. This class must be extended to implement an specific ad-hoc command. This class provides some useful and common useful:
To implement a new command extend this class and implement all the abstract methods. When implementing the actions remember that they could be invoked several times, and that you must use the current stage number to know what to do.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jivesoftware.smackx.commands.AdHocCommand |
---|
AdHocCommand.Action, AdHocCommand.SpecificErrorCondition, AdHocCommand.Status |
Constructor Summary | |
---|---|
LocalCommand()
|
Method Summary | |
---|---|
long |
getCreationStamp()
Returns the time in milliseconds since this command was executed for first time. |
int |
getCurrentStage()
Returns the currently executing stage number. |
String |
getOwnerJID()
Gets the full JID of the owner of this command. |
String |
getSessionID()
Returns the session ID of this execution. |
abstract boolean |
hasPermission(String jid)
Returns if the specified requester has permission to execute all the stages of this action. |
abstract boolean |
isLastStage()
Returns if the current stage is the last one. |
void |
setOwnerJID(String ownerJID)
Sets the JID of the command host. |
void |
setSessionID(String sessionID)
The sessionID is an unique identifier of an execution request. |
Methods inherited from class org.jivesoftware.smackx.commands.AdHocCommand |
---|
addActionAvailable, addNote, cancel, complete, execute, getActions, getExecuteAction, getForm, getName, getNode, getNotes, getSpecificErrorConditionFrom, getStatus, isValidAction, next, prev, setExecuteAction, setForm, setName, setNode |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LocalCommand()
Method Detail |
---|
public void setSessionID(String sessionID)
sessionID
- the unique session id of this executionpublic String getSessionID()
public void setOwnerJID(String ownerJID)
ownerJID
- the JID of the owner.public String getOwnerJID()
AdHocCommand
getOwnerJID
in class AdHocCommand
public long getCreationStamp()
public abstract boolean isLastStage()
public int getCurrentStage()
public abstract boolean hasPermission(String jid)
jid
- the JID to check permissions on.
|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |