1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02:00

Javadoc cleanup.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@10879 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Matt Tucker 2008-11-13 18:34:03 +00:00 committed by matt
parent a631b163e8
commit 18d38845e9
3 changed files with 59 additions and 59 deletions

View file

@ -25,21 +25,20 @@ import org.jivesoftware.smackx.packet.AdHocCommandData;
/**
* 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:
* <li>Node code</li>
* <li>Node name</li>
* <li>Session ID</li>
* <li>Current Stage</li>
* <li>Available actions</li>
* <li>Default action</li>
* <p>
* provides some useful tools:<ul>
* <li>Node</li>
* <li>Name</li>
* <li>Session ID</li>
* <li>Current Stage</li>
* <li>Available actions</li>
* <li>Default action</li>
* </ul><p/>
* 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.
*
* @author Gabriel Guardincerri
*
*/
public abstract class LocalCommand extends AdHocCommand {
@ -73,8 +72,7 @@ public abstract class LocalCommand extends AdHocCommand {
* The sessionID is an unique identifier of an execution request. This is
* automatically handled and should not be called.
*
* @param sessionID
* the unique session id of this execution
* @param sessionID the unique session id of this execution
*/
public void setSessionID(String sessionID) {
this.sessionID = sessionID;
@ -114,20 +112,43 @@ public abstract class LocalCommand extends AdHocCommand {
return creationDate;
}
/**
* Returns true if the current stage is the last one. If it is then the
* execution of some action will complete the execution of the command.
* Commands that don't have multiple stages can always return <tt>true</tt>.
*
* @return true if the command is in the last stage.
*/
public abstract boolean isLastStage();
/**
* Returns true if the specified requester has permission to execute all the
* stages of this action. This is checked when the first request is received,
* if the permission is grant then the requester will be able to execute
* all the stages of the command. It is not checked again during the
* execution.
*
* @param jid the JID to check permissions on.
* @return true if the user has permission to execute this action.
*/
public abstract boolean hasPermission(String jid);
/**
* Returns the currently executing stage number. The first stage number is
* 0. During the execution of the first action this method will answer 0.
*
* @return the current stage number.
*/
public int getCurrentStage() {
return currenStage;
}
@Override
void setData(AdHocCommandData data) {
data.setSessionID(sessionID);
super.setData(data);
}
/**
* Returns true if the current stage is the last one. If it is then the
* execution of some action will complete the execution of the command.
*
* @return true if the command is in the last stage.
*/
public abstract boolean isLastStage();
/**
* Increase the current stage number. This is automatically handled and should
* not be called.
@ -145,26 +166,4 @@ public abstract class LocalCommand extends AdHocCommand {
void decrementStage() {
currenStage--;
}
/**
* Returns the currently executing stage number. The first stage number is
* 0. During the execution of the first action this method will answer 0.
*
* @return the current stage number.
*/
public int getCurrentStage() {
return currenStage;
}
/**
* Returns true if the specified requester has permission to execute all the
* stages of this action. This is checked when the first request is received,
* if the permission is grant then the requester will be able to execute
* all the stages of the command. It is not checked again during the
* execution.
*
* @param jid the JID to check permissions on.
* @return true if the user has permission to execute this action
*/
public abstract boolean hasPermission(String jid);
}
}