AdventNet CLI 2.0 API Specification

com.adventnet.cli.config
Class ConfigAPI

java.lang.Object
  |
  +--com.adventnet.cli.config.ConfigAPI

public class ConfigAPI
extends java.lang.Object

This class can be used for configuring all CLI based devices. The Cisco IOS application will use these APIs to perform the various configuration tasks. A configuration is nothing but a set of tasks to be executed in a sequence, to achieve a desired funtionality. It has APIs which can be invoked to add, delete, modify and run a configuration and also APIs to do similar kind of operations with a task. The configurations are initially defined in a XML file from where it is read.

A sample code snippet for invoking the ConfigAPI is as follows-

 
 public class Test{
   public static void main(String args[]){
       try{
           ConfigAPI capi = new ConfigAPI("ConfigDriver.xml");
           System.out.println(" main ********");

           Test tst =new Test();
           CLIProtocolOptions cliProtOpts = tst.getCLIProtocolOptions(args[0], 23);
           capi.openSession(cliProtOpts);
           Hashtable result = capi.runConfiguration("confName");
           // the result
           Iterator itor = result.values().iterator();
           while(itor.hasNext())
              System.out.println(" result "+itor.next());
           capi.closeSession(cliProtOpts.getID());
   }

   // code to get the CLIProtocolOptions
   public CLIProtocolOptions getCLIProtocolOptions(String remoteHost, int remotePort) 
   throws Exception
   {
       TelnetProtocolOptionsImpl protocolOptions = new TelnetProtocolOptionsImpl();
       protocolOptions.setRemoteHost(remoteHost);
       protocolOptions.setRemotePort(remotePort);
       protocolOptions.setLoginName("guest");
       protocolOptions.setPassword("guest");
       protocolOptions.setLoginPrompt("login:");
       protocolOptions.setPasswdPrompt("Password:");
	 protocolOptions.setPrompt("$");
       return protocolOptions;
   }
 }
 
 

Since:
CLI2.0

Constructor Summary
ConfigAPI()
          Creates a new ConfigAPI instance (default constructor).
ConfigAPI(java.lang.String confXml)
          Creates a new ConfigAPI instance.
 
Method Summary
 void addConfiguration(ConfigObject cobject)
          Adds the configuration to the existing list of configuration.
 void appendTask(java.lang.String configName, Task task)
          Appends the task to the end of the tasklist.
 void closeSession(java.lang.Object id)
          Closes the session established by the user and also removes the ExecutionInterface maintained for the session id.
 ConfigObject deleteConfiguration(java.lang.String configName)
          Deletes the configuration with the given name.
 Task deleteTask(java.lang.String configName, java.lang.String taskName)
          Deletes the task with the given name belonging the specified configuration.
 java.util.Hashtable getConfigList()
          Gets the configurations defined in the xml file, along with their tasks.
 ConfigObject getConfiguration(java.lang.String configName)
          Gets the configuration with the name passed to it.
 java.lang.String[] getConfigWithData(java.lang.String configName, TaskData[] data, java.lang.Object id)
          This API can be used when 'ready to run' cmd / script is required for a given configuration.
 java.lang.String getCurrentLoginLevel()
          Gets the loginLevel currently used for the session.
 java.lang.String getExecutionIfcClassName()
          Gets the name of the ExecutionInterface implementation class.
 ExecutionInterface getExecutionIfcInstance()
          Gets the ExecutionInterface implementation class instance.
 ExecutionInterface getExecutionInterface()
          Gets the ExecutionInterface implementation instance of the current session in the ConfigAPI.
 LoginLevel getLoginLevel(java.lang.String loginLevel)
          Gets the LoginLevel object with the given name.
 java.lang.String[] getParamsOfCommand(java.lang.String cmdName)
          Gets the parameters present in the command (both optional and compulsory ones).
 java.util.Hashtable getResultOfConfig(java.lang.String configName, java.lang.String[] configCmds)
          Executes the command and returns the result of the command as a string.
 java.lang.String getResultOfTask(java.lang.String taskName, java.lang.String taskCmd, java.lang.String configName)
          Returns the result after the execution of the command.
 java.lang.String getTaskCmd(java.lang.String taskName, java.lang.String configName, TaskData data, java.lang.Object id)
          Gets the command for the specified task name.
 Task getTaskOfConfig(java.lang.String configName, java.lang.String taskName)
          Gets the task belonging to the given configuration of the ConfigAPI.
 void insertTask(java.lang.String configName, Task task, java.lang.String beforeTask)
          Adds the task to the existing list of tasks for the specified configuration.
 void loadConfiguration(java.lang.String configXML)
          This method can be used for dynamically loading a xml file.
 void openSession(CLIProtocolOptions cliProtOpts)
          Opens a CLI Session with the remote host set in the CLIProtocolOptions.
 java.util.Hashtable runConfiguration(java.lang.String configName)
          Executes the configuration given to it.
 java.util.Hashtable runConfiguration(java.lang.String configName, TaskData[] data)
          Executes the configuration given to it.
 java.util.Hashtable runConfiguration(java.lang.String configName, TaskData[] data, java.lang.Object id)
          Executes the configuration for the session, whose ID is taken from the third argument of the API.
 java.lang.String runTask(java.lang.String taskName, java.lang.String configName, TaskData data)
          Executes the task in a configuration.
 java.lang.String runTask(java.lang.String taskName, java.lang.String configName, TaskData data, java.lang.Object id)
          Executes the task in a configuration.
 void saveChangesToXmlFile()
          Saves the changes made to the task or configuration to the xml file.
 void setCurrentLoginLevel(java.lang.String logLevelName)
          Sets the current login level as the given name.
 void setDataInterface(java.lang.String configName, DataInterface iface)
          Sets the DataInterface of the given configuration.
 void setExecutionIfcClassName(java.lang.String className)
          Sets the ExecutionInterface implementation classname.
 void setExecutionInterface(ExecutionInterface iface)
          Sets the Execution Interface implementation instance for the current session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigAPI

public ConfigAPI()
Creates a new ConfigAPI instance (default constructor).

ConfigAPI

public ConfigAPI(java.lang.String confXml)
          throws ConfigException
Creates a new ConfigAPI instance. It also instantiates the configXmlParser which parses the xml file passed to it.
Parameters:
confXml - the name of the Xml file that contains data for configuration.
Throws:
ConfigException - if an error occurs during instantiation or parsing.
Method Detail

getConfigList

public java.util.Hashtable getConfigList()
Gets the configurations defined in the xml file, along with their tasks. The configuration stores the tasks belonging to it, in the taskList.
Returns:
a Hashtable having the configuration name and configObject as the key-value pairs.

getExecutionIfcClassName

public java.lang.String getExecutionIfcClassName()
Gets the name of the ExecutionInterface implementation class. This will be used in the getExecutionIfcInstance() method for instantiation. It takes the default value as "com.adventnet.cli.config.ExecutionInterfaceImpl".
Returns:
the fully qualified classname as a string value.
See Also:
setExecutionIfcClassName(String), getExecutionInterface()

setExecutionIfcClassName

public void setExecutionIfcClassName(java.lang.String className)
Sets the ExecutionInterface implementation classname. The name passed should be the fully qualified classname.
Parameters:
className - the fully qualified classname as a String value.
See Also:
getExecutionIfcClassName(), setExecutionInterface(ExecutionInterface)

getConfiguration

public ConfigObject getConfiguration(java.lang.String configName)
                              throws ConfigException
Gets the configuration with the name passed to it. Returns the Config Object, if present with the given name.
Parameters:
configName - the configuration name.
Returns:
the ConfigObject with values as given in the conf file.
Throws:
ConfigException - if the configuration is null or doesn't exist.

loadConfiguration

public void loadConfiguration(java.lang.String configXML)
                       throws ConfigException
This method can be used for dynamically loading a xml file. The file will be read and will overwrite the contents previously read from the any other xml file, if any.
Parameters:
configXML - the name of the XML file to be loaded.
Throws:
ConfigException - if an error occurs while loading the configuration.

setDataInterface

public void setDataInterface(java.lang.String configName,
                             DataInterface iface)
                      throws ConfigException
Sets the DataInterface of the given configuration. Also modifies the xml file with the changed DataInterface value if saveChangesToXmlFile() method is invoked.
Parameters:
configName - the name of the configuration
iface - the DataInterface value to be set.
Throws:
ConfigException - if an error occurs while setting the DataInterface and changing it in the xml. Also if the configuration doesn't exist.

getExecutionInterface

public ExecutionInterface getExecutionInterface()
Gets the ExecutionInterface implementation instance of the current session in the ConfigAPI.
Returns:
the instance of ExecutionInterface implementation class.

setExecutionInterface

public void setExecutionInterface(ExecutionInterface iface)
Sets the Execution Interface implementation instance for the current session.
Parameters:
iface - the ExecutionInterface implementation class instance.

runConfiguration

public java.util.Hashtable runConfiguration(java.lang.String configName)
                                     throws ConfigException
Executes the configuration given to it. It takes the Data from the DataInterface given for the configuration. The DataInterface.getConfigData(ConfigObject) method of DataInterface is invoked for the data. Only if the data is available for the whole configuration, it proceeds further to run the configuration.

The execution of the task is decided based on the 'mandatory' and 'dataRequired' properties of the Task (command or script). These properties takes boolean value true(t) or false(f).

     Mandatory    DataRequired    Action
      f            f              skips the task (command/script task).
      f            t              if no data, skips the task. otherwise
                                  executes the task.
      t            f              executes the task with the cmd/script.
      t            t              if no data, throws exception. otherwise
                                  executes the task.
 

When the LoginLevel of the task differs from that of the configuration, this method will switch to the login level of the task before executing it. The LoginLevel will be switched only if its one of the levels/modes defined in the xml, if not it throws an exception. It also exits from the loginlevel after executing the task.

Parameters:
configName - the name of configuration to be run.
Returns:
a Hashtable of taskName and result pairs for all tasks in the configuration.
Throws:
ConfigException - if 1. no config with the given name exists. 2. if data is not available for the execution of the task.
See Also:
runConfiguration(String, TaskData[]), getConfigWithData(String, TaskData[], Object)

runConfiguration

public java.util.Hashtable runConfiguration(java.lang.String configName,
                                            TaskData[] data)
                                     throws ConfigException
Executes the configuration given to it. It takes the Data from the argument passed to the API. If data passed to the method is null, then it takes the Data from the DataInterface.getConfigData(ConfigObject) method of DataInterface. Only if the data is available for the whole configuration, it proceeds further to run the configuration.

The execution of the task is decided based on the 'mandatory' and 'dataRequired' properties of the Task (command or script). These properties takes boolean value true(t) or false(f).

     Mandatory    DataRequired    Action
      f            f              skips the task (command/script task).
      f            t              if no data, skips the task. otherwise
                                  executes the task.
      t            f              executes the task with the cmd/script.
      t            t              if no data, throws exception. otherwise
                                  executes the task.
 

It executes the configuration in the LoginLevel specified and exits the level after execution of the configuration. When the LoginLevel of the task differs from that of the configuration, this method will switch to the login level of the task before executing it. The LoginLevel will be switched only if its, one of the levels/modes defined in the xml, if not it throws an exception. It also exits from the loginlevel after executing the task.

Parameters:
configName - the name of configuration to be run.
data - a TaskData[] array having the data for all the tasks.
Returns:
a Hashtable of taskName and result pairs for all tasks in the configuration.
Throws:
ConfigException - if 1. no config with the given name exists. 2. if data is not available for the execution of the task.
See Also:
runConfiguration(String, TaskData[], Object), getConfigWithData(String, TaskData[], Object), getResultOfConfig(String, String[])

runConfiguration

public java.util.Hashtable runConfiguration(java.lang.String configName,
                                            TaskData[] data,
                                            java.lang.Object id)
                                     throws ConfigException
Executes the configuration for the session, whose ID is taken from the third argument of the API. When the ID is null, the configuration is run for the currently established session in the ConfigAPI. It takes the Data from the second argument passed to the API. If data passed to the method is null, then it takes the Data from the DataInterface.getConfigData(ConfigObject) method of DataInterface. Only if the data is available for the whole configuration, it proceeds further to run the configuration.

The execution of the task is decided based on the 'mandatory' and 'dataRequired' properties of the Task (command or script). These properties takes boolean value true(t) or false(f).

     Mandatory    DataRequired    Action
      f            f              skips the task (command/script task).
      f            t              if no data, skips the task. otherwise
                                  executes the task.
      t            f              executes the task with the cmd/script.
      t            t              if no data, throws exception. otherwise
                                  executes the task.
 

It executes the configuration in the LoginLevel specified and exits the level after execution of the configuration. When the LoginLevel of the task differs from that of the configuration, this method will switch to the login level of the task before executing it. The LoginLevel will be switched only if its, one of the levels specified in the xml file, if not it throws an exception. It also exits from the loginlevel after executing the task.

Parameters:
configName - the name of configuration to be run.
data - a TaskData[] array having the data for all the tasks.
Returns:
a Hashtable of taskName and result pairs for all tasks in the configuration.
Throws:
ConfigException - if 1. no config with the given name exists. 2. if data is not available for the execution of the task. 3. no execution Interface exists for the given session ID.
See Also:
runConfiguration(String, TaskData[], Object), getConfigWithData(String, TaskData[], Object), getResultOfConfig(String, String[])

getConfigWithData

public java.lang.String[] getConfigWithData(java.lang.String configName,
                                            TaskData[] data,
                                            java.lang.Object id)
                                     throws ConfigException
This API can be used when 'ready to run' cmd / script is required for a given configuration. The resulting String array will contain the commands with the parameters substitued. In the case of script it will have the arguments space separated and appended to the scriptName. The commands / scripts will be in the same order, as that of the tasks, present in the configuration. In case of tasks that are not mandatory, and which may be skipped due to insufficient data, there will be an empty string in the corresponding task position.

The user can later execute the tasks by invoking getResultOfConfig(String, String[]) API with the result obtained from this method. It executes the tasks for the session ID given to the method.

Parameters:
configName - the name of the configuration which it to be run.
data - the data for the configuration as a TaskData[] array.
id - the id of the connection.
Returns:
a String[] array containing the commands or scripts ready to be run, with the data substituted.
Throws:
ConfigException - 1. If data is insufficient for a command or script. 2. If no configuration with the given name exists. 3. If no ExecutionInterface exists for the given session id.

getResultOfConfig

public java.util.Hashtable getResultOfConfig(java.lang.String configName,
                                             java.lang.String[] configCmds)
                                      throws ConfigException
Executes the command and returns the result of the command as a string. The input should be a command or script, with the data or parameters substituted in it. The command/script with parameters, can also be obtained by first invoking the method getConfigWithData(String, TaskData[], Object) and feeding the output of the method as an input to this API.

When the LoginLevel of the task differs from that of the configuration, this method will switch to the login level of the task before executing it. It also exits from the loginlevel after executing the task.

It returns a hashtable which contains the taskName and the response corresponding to the task. If a task is skipped, then there would be no entry for the task in the hashtable.

Parameters:
configName - the name of the configuration.
configCmds - the commands to be executed with the parameters substituted in it.
Returns:
a Hashtable that contains taskName, response pairs for a task.
Throws:
ConfigException - if any abnormal situation occurs while executing the command or changing the login level.

addConfiguration

public void addConfiguration(ConfigObject cobject)
                      throws ConfigException
Adds the configuration to the existing list of configuration. It adds the configuration, only if it doesn't already exist.

Also note that the added configuration can be saved to the xml file, say ConfigDriver.xml, by invoking the method saveChangesToXmlFile().

Parameters:
cobject - configuration to be added.
Throws:
ConfigException - if 1. the configuration is null or configID is null. 2. the configuration already exists.

deleteConfiguration

public ConfigObject deleteConfiguration(java.lang.String configName)
                                 throws ConfigException
Deletes the configuration with the given name. Returns the deleted configuration, if it exists.

It also updates the xml file, removing the entry for the configuration from the file, if saveChangesToXmlFile() is invoked.

Parameters:
configName - name of the configuration to be deleted.
Returns:
the deleted configuration or null, if no configuration with the name exists.
Throws:
ConfigException - if an error occurs while deleting configuration.

insertTask

public void insertTask(java.lang.String configName,
                       Task task,
                       java.lang.String beforeTask)
                throws ConfigException
Adds the task to the existing list of tasks for the specified configuration. It is inserted after the task 'beforeTask'. If 'beforeTask' is null, it is inserted to the beginning of the list.

Also note that the added task is written into the xml file, if saveChangesToXmlFile() is invoked.

Parameters:
configName - an existing configuration to which the task should be added.
task - the task to be added.
beforeTask - the task before which the new task is to be added.
Throws:
ConfigException - if 1. 'beforeTask' doesn't exist. 2. the task to be added is null or already exists. 3. the configuration doesn't exist.

appendTask

public void appendTask(java.lang.String configName,
                       Task task)
                throws ConfigException
Appends the task to the end of the tasklist.
Parameters:
configName - a String value
task - a Task value
Throws:
ConfigException - if 1. the task is null or taskname is null. 2. the configuration is null or doesn't exist.

deleteTask

public Task deleteTask(java.lang.String configName,
                       java.lang.String taskName)
                throws ConfigException
Deletes the task with the given name belonging the specified configuration. It returns the deteled task if the operation is successful. If saveChangesToXmlFile() is invoked, it also updates the xml file, removing the entry for the task from the file.
Parameters:
configName - the configuration to which the task belongs.
taskName - the task to be deleted.
Returns:
the deleted task or null if no task with the name exists.
Throws:
ConfigException - if 1. the task is null or doesn't exist. 2. the configuration doesn't exist or is null.

saveChangesToXmlFile

public void saveChangesToXmlFile()
                          throws ConfigException
Saves the changes made to the task or configuration to the xml file. If any configuration or task is modified, the changes can be saved to the xml file for persistence, using this API.
Throws:
ConfigException - if an error occurs while saving the changes to the xml.

getCurrentLoginLevel

public java.lang.String getCurrentLoginLevel()
Gets the loginLevel currently used for the session. It takes the default value as the first login level specified in the xml file. The default value is set when a connection is opened to the device.
Returns:
the login level as a String value

setCurrentLoginLevel

public void setCurrentLoginLevel(java.lang.String logLevelName)
                          throws ConfigException
Sets the current login level as the given name. It can be used to change the login level of the session. It will also try to get the login name and password for the level, in case they are required and not given, by invoking the LoginInterface methods. It intern invokes ExecutionInterface.setLoginLevel(LoginLevel) method which should be implemented by the user incase the user wants to override the default implementation.
Parameters:
logLevelName - the login level for the device, one of those defined in the xml file.
Throws:
ConfigException - if 1. the user name or password are not given, when required. 2. if the given loginlevel doesn't exist.

openSession

public void openSession(CLIProtocolOptions cliProtOpts)
                 throws ConfigException
Opens a CLI Session with the remote host set in the CLIProtocolOptions. It uses the parameters in the CLIProtocolOptions for logging on to the device. It intern invokes ExecutionInterface.login(CLIProtocolOptions) method for opening a session to the remote host. It also maintains the ExecutionInterface corresponding to the Session ID.
Parameters:
cliProtOpts - the CLIProtocolOptions with the logging parameters set.
Throws:
ConfigException - if an error occurs while logging on to the remote host.

closeSession

public void closeSession(java.lang.Object id)
                  throws ConfigException
Closes the session established by the user and also removes the ExecutionInterface maintained for the session id.
Parameters:
id - the ID of the session.
Throws:
ConfigException - if an error occurs while closing the session.

getExecutionIfcInstance

public ExecutionInterface getExecutionIfcInstance()
                                           throws java.lang.Exception
Gets the ExecutionInterface implementation class instance. Creates a new instance of ExecutionInterface with getExecutionIfcClassName() as the class name.
Returns:
the instance of ExecutionInterface implementation class.
Throws:
if - an error occurs while creating instance.

getParamsOfCommand

public java.lang.String[] getParamsOfCommand(java.lang.String cmdName)
Gets the parameters present in the command (both optional and compulsory ones). The parameters will be prefixed with $(if compulsory) or #(if optional). In case the command itself contain a '$' or a '#', it should be prefixed with '$$' or '##', to indicate that the symbol is present in the command.
Parameters:
cmdName - the command.
Returns:
a String[] array containing the parameters. Returns null if the command is null or if the command has no parameters.

getLoginLevel

public LoginLevel getLoginLevel(java.lang.String loginLevel)
                         throws ConfigException
Gets the LoginLevel object with the given name. The name must be one among the LoginLevels defined in the xml file.
Parameters:
loginLevel - the name of the LoginLevel.
Returns:
a LoginLevel object, if defined for the name.
Throws:
ConfigException - if a login level doesn't exist with the given name or is null.

getTaskOfConfig

public Task getTaskOfConfig(java.lang.String configName,
                            java.lang.String taskName)
                     throws ConfigException
Gets the task belonging to the given configuration of the ConfigAPI.
Parameters:
configName - the name of the configuration.
taskName - the name of the task.
Returns:
the Task if it is one among the ones defined in the xml file.
Throws:
ConfigException - if 1. the configuration or task doesn't exist.

runTask

public java.lang.String runTask(java.lang.String taskName,
                                java.lang.String configName,
                                TaskData data)
                         throws ConfigException
Executes the task in a configuration. If data is null, it tries to take the data from DataInterface of the configuration. It invokes the DataInterface.getConfigCmdData(String, String) and DataInterface.getConfigScriptData(String, String) methods of the DataInterface for the command and script respectively.

The execution of the task is again determined by the 'dataRequired' and 'mandatory' properties of the task respectively which is similar as in the case of runConfiguration.

This API will switch to the login level of the task before executing it. The LoginLevel will be switched only if its, one of the levels defined in the xml, if not it throws an exception. It also exits from the loginlevel after executing the task.

Parameters:
taskName - the name of the task to be executed.
configName - the name of the configuration to which the task belongs.
data - the TaskData object from which data is taken for the command.
Returns:
the result after executing the task.
Throws:
ConfigException - if 1. the task doesn't exist. 2. the configuration doesn't exist. 3. the data is insufficient for the task.
See Also:
runConfiguration(String, TaskData[]), getTaskCmd(String, String, TaskData, Object), getResultOfTask(String, String, String)

runTask

public java.lang.String runTask(java.lang.String taskName,
                                java.lang.String configName,
                                TaskData data,
                                java.lang.Object id)
                         throws ConfigException
Executes the task in a configuration. This API can be used in case you want to run the task in a session other than the current session. The session ID of the session has to be passed as the third argument to the API.

It takes data for the task from the third argument. If data is null, it tries to take the data from DataInterface of the configuration. It invokes the DataInterface.getConfigCmdData(String, String) and DataInterface.getConfigScriptData(String, String) methods of the DataInterface for the command and script respectively.

The execution of the task is again determined by the 'dataRequired' and 'mandatory' properties of the task respectively which is similar as in the case of runConfiguration.

This API will switch to the login level of the task before executing it. The LoginLevel will be switched only if its, one of the levels defined in the xml file, if not it throws an exception. It also exits from the loginlevel after executing the task.

Parameters:
taskName - the name of the task to be executed.
configName - the name of the configuration to which the task belongs.
data - the TaskData object from which data is taken for the command.
id - the ID of the session, in which the task is to be executed.
Returns:
the result after executing the task.
Throws:
ConfigException - if 1. ExecutionInterface corresponding to the session id doesn't exist. 2. the task or configuration doesn't exist. 3. the data is insufficient.
See Also:
getTaskCmd(String, String, TaskData, Object), getResultOfTask(String, String, String), runConfiguration(String, TaskData[], Object)

getTaskCmd

public java.lang.String getTaskCmd(java.lang.String taskName,
                                   java.lang.String configName,
                                   TaskData data,
                                   java.lang.Object id)
                            throws ConfigException
Gets the command for the specified task name. The command is obtained with the parameters substituted in it. In the case of a script, a string with the scriptName and its arguments space separated, is returned.

It takes data for the task from the third argument. If data is null, it tries to take the data from DataInterface of the configuration. It invokes the DataInterface.getConfigCmdData(String, String) and DataInterface.getConfigScriptData(String, String) methods of the DataInterface for the command and script respectively.

Parameters:
taskName - the name of the task
configName - the name of the configuration to which the task belongs.
data - the TaskData object from which data is taken for the command.
id - the ID of the session, in which the task is to be executed.
Returns:
the command with the parameters substituted in it. In the case of script, the script name with its arguments.
Throws:
ConfigException - if 1. ExecutionInterface corresponding to the session id doesn't exist. 2. the task or configuration doesn't exist. 3. the data is insufficient for the task.
See Also:
runTask(String, String, TaskData, Object), getResultOfTask(String, String, String)

getResultOfTask

public java.lang.String getResultOfTask(java.lang.String taskName,
                                        java.lang.String taskCmd,
                                        java.lang.String configName)
                                 throws ConfigException
Returns the result after the execution of the command. The command or script to be passed should have all the parameters/arguments in it. The command/script with parameters, can also be obtained by first invoking the method getTaskCmd(String, String, TaskData, Object) and feeding the output of the method as an input to this API.

In case a LoginLevel is specified for the execution of the task, the task is executed after changing the login level. Note that the specified login level is also exited after the execution of the command.

The execution of the task is again determined by the 'dataRequired' and 'mandatory' properties of the task respectively which is similar as in the case of runTask() API.

Parameters:
taskName - the name of the task to be executed.
taskCmd - the command or script to be executed with the parameters.
configName - the name of the configuration to which the task belongs.
Returns:
the result after executing the task.
Throws:
ConfigException - if the task or configuration doesn't exist.
See Also:
getTaskCmd(String, String, TaskData, Object), runTask(String, String, TaskData, Object)

AdventNet CLI 2.0 API Specification