AdventNet CLI 2.0 API Specification

com.adventnet.cli.config
Interface ExecutionInterface

All Known Implementing Classes:
ExecutionInterfaceImpl

public interface ExecutionInterface

This is the interface that needs to be implemented when the user wants to execute a particular configuration. A configuration is nothing but a set of tasks to be executed. The user can specify the configuration in the ConfigDriver.Xml file. The methods in the ConfigAPI can be used to perform operations with a particular configuration.

Since:
CLI2.0

Method Summary
 void close()
          This method can be used for closing the session established by the user.
 java.lang.String executeCommand(CLIMessage requestMess)
          This method executes the command given to it.
 void executeScript(java.lang.String scriptFileName, java.lang.String[] args, java.lang.String scriptType)
          This method executes the file containing the script.
 void login(CLIProtocolOptions cliProtocolOptions)
          This is the method used for initially logging into a remoteHost with the CLIProtocolOptions.
 void setLoginLevel(LoginLevel loginLevel)
          Sets the loginLevel to be used for logging into a remote device.
 

Method Detail

executeCommand

public java.lang.String executeCommand(CLIMessage requestMess)
                                throws ExecutionException
This method executes the command given to it. It has to be implemented by the user.
Parameters:
requestMess - the command to be executed as CLIMessage.
Returns:
response of the command as a String value.
Throws:
ExecutionException - if an error occurs during the execution of the command.

executeScript

public void executeScript(java.lang.String scriptFileName,
                          java.lang.String[] args,
                          java.lang.String scriptType)
                   throws ExecutionException
This method executes the file containing the script. The script language of the script file is also to be given, for executing the script. This has to be implemented using the ScriptHandler APIs, and depending on the script language used.
Parameters:
scriptFileName - a String value
ScriptType - a String value
Throws:
ExecutionException - if an error occurs
See Also:
ScriptHandler

setLoginLevel

public void setLoginLevel(LoginLevel loginLevel)
                   throws ExecutionException
Sets the loginLevel to be used for logging into a remote device. This is also used for switching over from a login level to one of its sublevels and vice versa. The login parameters and login command is used for changing the login level.
Parameters:
loginLevel - the LoginLevel for logging into the device or to change the login level of the device.
Throws:
ExecutionException - if an error occurs during logging in.

login

public void login(CLIProtocolOptions cliProtocolOptions)
           throws ExecutionException
This is the method used for initially logging into a remoteHost with the CLIProtocolOptions. This should be implemented by the user.
Parameters:
cliProtocolOptions - the protocol specific options which has to be given by the user depending upon the protocol being used to communicate with the CLI device.
Throws:
ExecutionException - if an error occurs during logging in.

close

public void close()
           throws ExecutionException
This method can be used for closing the session established by the user.
Throws:
ExecutionException - if an error occurs

AdventNet CLI 2.0 API Specification