Wildfire 3.2.4 Javadoc

org.jivesoftware.wildfire.commands.admin
Class GetServerStats

java.lang.Object
  extended by org.jivesoftware.wildfire.commands.AdHocCommand
      extended by org.jivesoftware.wildfire.commands.admin.GetServerStats

public class GetServerStats
extends AdHocCommand

Command that returns information about the server and some basic statistics. This command can only be executed by administrators or components of the server. TODO Use i18n

Author:
Gaston Dombiak

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jivesoftware.wildfire.commands.AdHocCommand
AdHocCommand.Action, AdHocCommand.Status
 
Constructor Summary
GetServerStats()
           
 
Method Summary
protected  void addStageInformation(SessionData data, org.dom4j.Element command)
          Adds to the command element the data form or notes required by the current stage.
 void execute(SessionData data, org.dom4j.Element command)
          Executes the command with the specified session data.
protected  List<AdHocCommand.Action> getActions(SessionData data)
          Returns a collection with the allowed actions based on the current stage as defined in the SessionData.
 String getCode()
          Returns the unique identifier for this command for the containing JID.
 String getDefaultLabel()
          Returns the default label used for describing this commmand.
protected  AdHocCommand.Action getExecuteAction(SessionData data)
          Returns which of the actions available for the current stage is considered the equivalent to "execute".
 int getMaxStages(SessionData data)
          Returns the max number of stages for this command.
 boolean hasPermission(JID requester)
          Returns if the requester can access this command.
 
Methods inherited from class org.jivesoftware.wildfire.commands.AdHocCommand
addNextStageInformation, addPreviousStageInformation, addStageActions, getLabel, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GetServerStats

public GetServerStats()
Method Detail

addStageInformation

protected void addStageInformation(SessionData data,
                                   org.dom4j.Element command)
Description copied from class: AdHocCommand
Adds to the command element the data form or notes required by the current stage. The current stage is specified in the SessionData. This method will never be invoked for commands that have no stages.

Specified by:
addStageInformation in class AdHocCommand
Parameters:
data - the gathered data through the command stages or null if the command does not have stages or the requester is requesting the execution for the first time.
command - the command element to be sent to the command requester.

execute

public void execute(SessionData data,
                    org.dom4j.Element command)
Description copied from class: AdHocCommand
Executes the command with the specified session data.

Specified by:
execute in class AdHocCommand
Parameters:
data - the gathered data through the command stages or null if the command does not have stages.
command - the command element to be sent to the command requester with a reported data result or note element with the answer of the execution.

getActions

protected List<AdHocCommand.Action> getActions(SessionData data)
Description copied from class: AdHocCommand
Returns a collection with the allowed actions based on the current stage as defined in the SessionData. Possible actions are: prev, next and complete. This method will never be invoked for commands that have no stages.

Specified by:
getActions in class AdHocCommand
Parameters:
data - the gathered data through the command stages or null if the command does not have stages or the requester is requesting the execution for the first time.
Returns:
a collection with the allowed actions based on the current stage as defined in the SessionData.

getCode

public String getCode()
Description copied from class: AdHocCommand
Returns the unique identifier for this command for the containing JID. The code will be used as the node in the disco#items or the node when executing the command.

Specified by:
getCode in class AdHocCommand
Returns:
the unique identifier for this command for the containing JID.

getDefaultLabel

public String getDefaultLabel()
Description copied from class: AdHocCommand
Returns the default label used for describing this commmand. This information is usually used when returning commands as disco#items. Admins can later use AdHocCommand.setLabel(String) to set a new label and reset to the default value at any time.

Specified by:
getDefaultLabel in class AdHocCommand
Returns:
the default label used for describing this commmand.

getExecuteAction

protected AdHocCommand.Action getExecuteAction(SessionData data)
Description copied from class: AdHocCommand
Returns which of the actions available for the current stage is considered the equivalent to "execute". When the requester sends his reply, if no action was defined in the command then the action will be assumed "execute" thus assuming the action returned by this method. This method will never be invoked for commands that have no stages.

Specified by:
getExecuteAction in class AdHocCommand
Parameters:
data - the gathered data through the command stages or null if the command does not have stages or the requester is requesting the execution for the first time.
Returns:
which of the actions available for the current stage is considered the equivalent to "execute".

getMaxStages

public int getMaxStages(SessionData data)
Description copied from class: AdHocCommand
Returns the max number of stages for this command. The number of stages may vary according to the collected data in previous stages. Therefore, a SessionData object is passed as a parameter. When the max number of stages has been reached then the command is ready to be executed.

Specified by:
getMaxStages in class AdHocCommand
Parameters:
data - the gathered data through the command stages or null if the command does not have stages or the requester is requesting the execution for the first time.
Returns:
the max number of stages for this command.

hasPermission

public boolean hasPermission(JID requester)
Returns if the requester can access this command. Only admins and components are allowed to execute this command.

Overrides:
hasPermission in class AdHocCommand
Parameters:
requester - the JID of the user requesting to execute this command.
Returns:
true if the requester can access this command.

Wildfire 3.2.4 Javadoc

Copyright © 2003-2007 Jive Software.