com.adventnet.cli.config
Class ExecutionInterfaceImpl
java.lang.Object
|
+--com.adventnet.cli.config.ExecutionInterfaceImpl
- public class ExecutionInterfaceImpl
- extends java.lang.Object
- implements ExecutionInterface
This is the default implementation of ExecutionInterface using the CLI
APIs.
- Since:
- CLI2.0
- See Also:
ExecutionInterface
|
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 using the CLI APIs. |
void |
executeScript(java.lang.String scriptFileName,
java.lang.String[] args,
java.lang.String scriptType)
Executes the script file given to the method. |
void |
login(CLIProtocolOptions cliProtocolOptions)
This is the method used for initially logging into a remoteHost
with the CLIProtocolOptions. |
void |
setLoginLevel(LoginLevel logLevel)
Sets the loginLevel to be used for logging into a remote device. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
ExecutionInterfaceImpl
public ExecutionInterfaceImpl()
- Creates a new
ExecutionInterfaceImpl instance.
executeCommand
public java.lang.String executeCommand(CLIMessage requestMess)
throws ExecutionException
- This method executes the command given to it using the CLI APIs.
The syncSend() method is used for sending the command, which
blocks until the response is received.
- Specified by:
- executeCommand in interface ExecutionInterface
- Parameters:
command - the command to be executed as a CLIMessage.- Returns:
- the response received after executing the command.
- Throws:
- ExecutionException - if an error occurs while executing the
command.
executeScript
public void executeScript(java.lang.String scriptFileName,
java.lang.String[] args,
java.lang.String scriptType)
throws ExecutionException
- Executes the script file given to the method. This intern invokes the
ScriptHandler.executeScriptFromFile(String, String[], String)
method for running the file containing the script.
- Specified by:
- executeScript in interface ExecutionInterface
- Parameters:
scriptFileName - the file containing the script.scriptType - the script language of the script like python etc.- Throws:
- ExecutionException - if an error occurs while running script.
- See Also:
ScriptHandler,
RunScriptInterface
setLoginLevel
public void setLoginLevel(LoginLevel logLevel)
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. This is implemented using
the CLI APIs.
- Specified by:
- setLoginLevel in interface ExecutionInterface
- Parameters:
logLevel - the LoginLevel for logging into the
device or to change the login level of the device.- Throws:
- ExecutionException - if an error occurs during the logging in
process.
login
public void login(CLIProtocolOptions cliProtocolOptions)
throws ExecutionException
- This is the method used for initially logging into a remoteHost
with the CLIProtocolOptions. It also opens a session to
enable the user for sending commands to the device.
- Specified by:
- login in interface ExecutionInterface
- 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.
- Specified by:
- close in interface ExecutionInterface
- Throws:
- ExecutionException - if an error occurs while closing the session.