org.hackystat.sensor.xmldata
Class XmlDataController

java.lang.Object
  extended by org.hackystat.sensor.xmldata.XmlDataController

public class XmlDataController
extends java.lang.Object

The class which parses the command-line arguments specified by the user, validates the created options and their parameters, and executes the options.

Author:
Austen Ito

Constructor Summary
XmlDataController()
          Constructs this controller with the classes that help manage the command-line arguments and message capabilities.
 
Method Summary
 void addOptionObject(Options option, java.lang.Object object)
          Adds a mapping of the specified option to the specified object.
 void execute()
          Executes all of the options specified by the user.
 void fireMessage(java.lang.String message)
          Displays the specified message.
 void fireMessage(java.lang.String message, java.lang.String verboseMessage)
          Displays the specified message is verbose mode is disabled or the verbose message if verbose mode is enabled.
 void fireVerboseMessage(java.lang.String message)
          Displays the specified message if verbose mode is enabled.
 java.lang.String getHost()
          Returns the SensorBase host stored in the sensor properties file.
 java.lang.Object getOptionObject(Options option)
          Returns the object mapped to the specified option.
 void processArguments(java.util.List<java.lang.String> arguments)
          Processes the command-line arguments and creates the objects that can be executed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlDataController

public XmlDataController()
Constructs this controller with the classes that help manage the command-line arguments and message capabilities.

Method Detail

addOptionObject

public void addOptionObject(Options option,
                            java.lang.Object object)
Adds a mapping of the specified option to the specified object. This allows options to use objects associated with other options during the option's execution phase.

Parameters:
option - the option that is associated with an object.
object - the object mapped to an option.

getOptionObject

public java.lang.Object getOptionObject(Options option)
Returns the object mapped to the specified option. If no object exists, null is returned. It is up to the calling object to determine the type of object returned.

Parameters:
option - the option that is the key of the requested object.
Returns:
the object mapped to the specified option.

processArguments

public void processArguments(java.util.List<java.lang.String> arguments)
Processes the command-line arguments and creates the objects that can be executed.

Parameters:
arguments - the specified list of command-line arguments.

execute

public void execute()
Executes all of the options specified by the user.


fireMessage

public void fireMessage(java.lang.String message)
Displays the specified message. The same message is displayed even if the verbose option is enabled.

Parameters:
message - the specified message to display.

fireVerboseMessage

public void fireVerboseMessage(java.lang.String message)
Displays the specified message if verbose mode is enabled.

Parameters:
message - the specified message to display.

fireMessage

public void fireMessage(java.lang.String message,
                        java.lang.String verboseMessage)
Displays the specified message is verbose mode is disabled or the verbose message if verbose mode is enabled.

Parameters:
message - the specified message.
verboseMessage - the specified verbose message.

getHost

public java.lang.String getHost()
Returns the SensorBase host stored in the sensor properties file.

Returns:
the SensorBase host string.