com.adventnet.cli.config
Interface DataInterface
- public interface DataInterface
The data for a configuration can optionally
be given with the help of this interface.
In the case of ConfigAPI.runConfiguration(String, TaskData[]) API,
the getConfigData() method of this interface will be invoked for
getting data. The
ConfigAPI.runTask(String, String, TaskData) API , invokes the
getConfigCmdData() and getConfigScriptData() methods for
getting the data for command and script tasks respectively.
- Since:
- CLI2.0
|
Method Summary |
java.util.Properties |
getConfigCmdData(java.lang.String configID,
java.lang.String cmdName)
This method will be invoked by the runTask() API. |
TaskData[] |
getConfigData(ConfigObject configObj)
This method will be invoked by the runConfiguration() API of
ConfigAPI, when no data is given to it. |
java.lang.String[] |
getConfigScriptData(java.lang.String configID,
java.lang.String scriptName)
This method will be invoked by the runTask() API when a script is to be
run. |
getConfigData
public TaskData[] getConfigData(ConfigObject configObj)
throws DataException
- This method will be invoked by the runConfiguration() API of
ConfigAPI, when no data is given to it. The data for all the tasks in
the given configuration will be returned from this method, if needed.
- Parameters:
configObj - the configuration for which data is to be obtained.- Returns:
- the
TaskData[] array containing data for the tasks. - Throws:
- DataException - if an error occurs while getting data.
getConfigCmdData
public java.util.Properties getConfigCmdData(java.lang.String configID,
java.lang.String cmdName)
throws DataException
- This method will be invoked by the runTask() API. This method can be
used to get the data for a command in a configuration.
- Parameters:
configID - the name of the configuration.cmdName - the command for which the data is to be obtained. This
corresponds to the TASKVALUE attribute of CMDTASK tag of the xml file.- Returns:
- the parameters for the command as a
Properties
object. - Throws:
- DataException - if an error occurs while getting data for the
command.
getConfigScriptData
public java.lang.String[] getConfigScriptData(java.lang.String configID,
java.lang.String scriptName)
throws DataException
- This method will be invoked by the runTask() API when a script is to be
run. Hence it can be used for getting data for running a script in a
configuration.
- Parameters:
configID - the configuration to which the script belongs.scriptName - the name of file containing the script. This
corresponds to the TASKVALUE attribute of SCRIPTTASK tag of the
xml file.- Returns:
- the arguments for the script as a
String[] array. - Throws:
- DataException - if an error occurs while getting data for the
script.