org.hackystat.sensor.xmldata.option
Class MigrationOption

java.lang.Object
  extended by org.hackystat.sensor.xmldata.option.AbstractOption
      extended by org.hackystat.sensor.xmldata.option.MigrationOption
All Implemented Interfaces:
Option

public class MigrationOption
extends AbstractOption

The option used to port Hackystat version 7 (v7) data to the Hackystat 8 sensorbase with the following steps:

 1. The user provides the Hackystat 7 user directory, the version 7
 account, the version 8 username, and version 8 password. 
 2. Then this option traverses the Hackystat 7 data directory and converts the information to
 valid Hackystat 8 data.  
 3. Finally, the converted data is sent to the Hackystat 8 sensorbase.
 

Author:
aito

Field Summary
static java.lang.String OPTION_NAME
          The name of this option, which is "-migration".
 
Constructor Summary
MigrationOption(XmlDataController controller, java.util.List<java.lang.String> parameters)
          Creates this option with the specified controller and parameters.
 
Method Summary
 void execute()
          Executes this option by converting all version 7 data found in the specified directory to version 8 compatiable data.
 boolean isValid()
          Returns true if the specified option parameters follows the convention:
 void process()
          Sets the variables used by the execute method.
 
Methods inherited from class org.hackystat.sensor.xmldata.option.AbstractOption
getController, getName, getParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPTION_NAME

public static final java.lang.String OPTION_NAME
The name of this option, which is "-migration".

See Also:
Constant Field Values
Constructor Detail

MigrationOption

public MigrationOption(XmlDataController controller,
                       java.util.List<java.lang.String> parameters)
Creates this option with the specified controller and parameters.

Parameters:
controller - the specified controller.
parameters - the specified parameters.
Method Detail

isValid

public boolean isValid()
Returns true if the specified option parameters follows the convention:
 [v7 directory] [v7 account] [v8 host] [v8 username] [v8 password]
 
 Ex:  -migration C:\foo ABCDEF http://localhost:9876/sensorbase austen@hawaii.edu fooPassword
 Note that the v7 directory does not include the v7 account name.
 

Specified by:
isValid in interface Option
Specified by:
isValid in class AbstractOption
Returns:
true if the option parameters are correct, false if not.

process

public void process()
Sets the variables used by the execute method.

Specified by:
process in interface Option
Overrides:
process in class AbstractOption

execute

public void execute()
Executes this option by converting all version 7 data found in the specified directory to version 8 compatiable data. The converted data is sent to the Hackystat 8 sensorbase.

Specified by:
execute in interface Option
Overrides:
execute in class AbstractOption