Package dev.galasa.ipnetwork
Interface ICommandShell
- All Known Implementing Classes:
SSHClient
public interface ICommandShell
-
Method Summary
Modifier and TypeMethodDescriptionvoidconnect()voidissueCommand(String command) issueCommand(String command, boolean newShell) Issue a command using SSH.issueCommand(String command, boolean newShell, long timeout) Issue a command using SSHissueCommand(String command, long timeout) Issue a command using SSH.issueCommandToShell(String command) Issue a command using SSH shell.issueCommandToShell(String command, boolean newShell) Issue a command using SSH shell.issueCommandToShell(String command, boolean newShell, long timeout) Issue a command using SSH shell - not valid for Rexec implementation - equivalent toissueCommand(String, long)for Telnet implementationissueCommandToShell(String command, long timeout) Issue a command using SSH shell.voidreportResultStrings(boolean report) Ask the shell to log the result strings for all shell commandsvoidvoidsetChangePromptCommand(String command) Define the right command used to change the shell promptvoidsetRemoveAnsiEscapeCodes(boolean remoteAnsiEscapeCodes) Instruct the command shell to remove ANSI escape codes from the output of commands to the shell
-
Method Details
-
issueCommand
- Throws:
IpNetworkManagerException
-
issueCommand
Issue a command using SSH. Equivalent toissueCommand(String, boolean, long)- Parameters:
command- - command to issuetimeout- - time (in milliseconds) to wait with no new output appearing before timing out- Returns:
- the output of the command (stdout and stderr)
- Throws:
SSHExceptionIpNetworkManagerException
-
issueCommand
Issue a command using SSH. Equivalent toissueCommand(String, boolean, long)- Parameters:
command- - command to issuenewShell- - if true will start a new- Returns:
- the output of the command (stdout and stderr)
- Throws:
SSHExceptionIpNetworkManagerException
-
issueCommand
String issueCommand(String command, boolean newShell, long timeout) throws IpNetworkManagerException Issue a command using SSH- Parameters:
command- - command to issuenewShell- - if true will start a newtimeout- - time (in milliseconds) to wait with no new output appearing before timing out- Returns:
- the output of the command (stdout and stderr)
- Throws:
SSHExceptionIpNetworkManagerException
-
connect
- Throws:
IpNetworkManagerException
-
disconnect
- Throws:
IpNetworkManagerException
-
restartShell
- Throws:
IpNetworkManagerException
-
setChangePromptCommand
Define the right command used to change the shell prompt -
issueCommandToShell
Issue a command using SSH shell. Equivalent toissueCommandToShell(String, boolean, long)- not valid for Rexec implementation - equivalent toissueCommand(String, long)for Telnet implementation- Parameters:
command- - command to issue- Returns:
- the output of the command (stdout and stderr)
- Throws:
IpNetworkManagerException
-
issueCommandToShell
Issue a command using SSH shell. Equivalent toissueCommandToShell(String, boolean, long)- not valid for Rexec implementation - equivalent toissueCommand(String, long)for Telnet implementation- Parameters:
command- - command to issue - if true will start a new- Returns:
- the output of the command (stdout and stderr)
- Throws:
IpNetworkManagerException
-
issueCommandToShell
Issue a command using SSH shell. Equivalent toissueCommandToShell(String, boolean, long)- not valid for Rexec implementation - equivalent toissueCommand(String, long)for Telnet implementation- Parameters:
command- - command to issuenewShell- - if true will start a new- Returns:
- the output of the command (stdout and stderr)
- Throws:
IpNetworkManagerException
-
issueCommandToShell
String issueCommandToShell(String command, boolean newShell, long timeout) throws IpNetworkManagerException Issue a command using SSH shell - not valid for Rexec implementation - equivalent toissueCommand(String, long)for Telnet implementation- Parameters:
command- - command to issuenewShell- - if true will start a newtimeout- - time (in milliseconds) to wait with no new output appearing before timing out- Returns:
- the output of the command
- Throws:
IpNetworkManagerException
-
reportResultStrings
void reportResultStrings(boolean report) Ask the shell to log the result strings for all shell commands- Parameters:
report- whether the shell should log the results of the shell commands
-
setRemoveAnsiEscapeCodes
void setRemoveAnsiEscapeCodes(boolean remoteAnsiEscapeCodes) Instruct the command shell to remove ANSI escape codes from the output of commands to the shell
-