From d42b40496dfd1a359bdc92811ed4fdad4ab27880 Mon Sep 17 00:00:00 2001 From: Matt Tucker Date: Fri, 24 Oct 2008 05:30:21 +0000 Subject: [PATCH] Formatting fixes. git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@10848 b35dd754-fafc-0310-a699-88a17e54d16e --- .../smackx/commands/AdHocCommandManager.java | 64 ++++++++++--------- 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/source/org/jivesoftware/smackx/commands/AdHocCommandManager.java b/source/org/jivesoftware/smackx/commands/AdHocCommandManager.java index 5b1ef4914..0bfad97e6 100755 --- a/source/org/jivesoftware/smackx/commands/AdHocCommandManager.java +++ b/source/org/jivesoftware/smackx/commands/AdHocCommandManager.java @@ -132,6 +132,7 @@ public class AdHocCommandManager { * command for the connection related to this command manager. The * name is the human readable name of the command. * The class is the class of the command + * * @param node the unique identifier of the command. * @param name the human readable name of the command. * @param clazz the class of the command. @@ -223,12 +224,13 @@ public class AdHocCommandManager { } /** + * */ private void init() { // Register the new instance and associate it with the connection @@ -358,19 +360,23 @@ public class AdHocCommandManager { * Process the AdHoc-Command packet that request the execution of some * action of a command. If this is the first request, this method checks, * before executing the command, if: - *
  • The requested command exists
  • - *
  • The requester has permissions to execute it
  • - *
  • The command has more than one stage, if so, it saves the command and - * session ID for further use
  • + * * *
    *
    * If this is not the first request, this method checks, before executing * the command, if: - *
  • The session ID of the request was stored
  • - *
  • The session life do not exceed the time out
  • - *
  • The action to execute is one of the available actions
  • - * + * + * * @param requestData * the packet to process. */ @@ -459,7 +465,8 @@ public class AdHocCommandManager { // Sends the response packet connection.sendPacket(response); - } catch (XMPPException e) { + } + catch (XMPPException e) { // If there is an exception caused by the next, complete, // prev or cancel method, then that error is returned to the // requester. @@ -548,20 +555,24 @@ public class AdHocCommandManager { // If it is the last stage then the command is // completed response.setStatus(Status.completed); - } else { + } + else { // Otherwise it is still executing response.setStatus(Status.executing); } - } else if (Action.complete.equals(action)) { + } + else if (Action.complete.equals(action)) { command.increaseStage(); command.complete(new Form(requestData.getForm())); response.setStatus(Status.completed); // Remove the completed session executingCommands.remove(sessionId); - } else if (Action.prev.equals(action)) { + } + else if (Action.prev.equals(action)) { command.decreaseStage(); command.prev(); - } else if (Action.cancel.equals(action)) { + } + else if (Action.cancel.equals(action)) { command.cancel(); response.setStatus(Status.canceled); // Remove the canceled session @@ -632,20 +643,17 @@ public class AdHocCommandManager { /** * Creates a new instance of a command to be used by a new execution request * - * @param commandNode - * the command node that identifies it. - * @param sessionID - * the session id of this execution. + * @param commandNode the command node that identifies it. + * @param sessionID the session id of this execution. * @return the command instance to execute. - * @throws XMPPException - * if there is problem creating the new instance + * @throws XMPPException if there is problem creating the new instance. */ private LocalCommand newInstanceOfCmd(String commandNode, String sessionID) - throws XMPPException { - // TODO Evaluate the possibility of using a factory for creating the new - // instances. + throws XMPPException + { + // TODO Evaluate the possibility of using a factory for creating the new instances. AdHocCommandInfo commandInfo = commands.get(commandNode); - LocalCommand command = null; + LocalCommand command; try { command = (LocalCommand) commandInfo.getCmdClass().newInstance(); command.setSessionID(sessionID); @@ -684,15 +692,13 @@ public class AdHocCommandManager { private static class AdHocCommandInfo { private String node; - private String name; - private String ownerJID; - private Class cmdClass; public AdHocCommandInfo(String node, String name, String ownerJID, - Class cmdClass) { + Class cmdClass) + { this.node = node; this.name = name; this.ownerJID = ownerJID; @@ -715,4 +721,4 @@ public class AdHocCommandManager { return ownerJID; } } -} +} \ No newline at end of file