public class SSHConnectionManager extends java.lang.Object implements RemoteConnectionManager
| Constructor and Description |
|---|
SSHConnectionManager(HadoopClusterParameters hadoop_cluster) |
SSHConnectionManager(java.lang.String host,
java.lang.String user,
java.lang.String password) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String[] |
executeCommand(java.lang.String command)
Execute the command in the remote host.
|
java.lang.String[] |
executeCommand(java.lang.String command,
java.lang.String input)
Execute the command in the remote host.
|
java.lang.String[] |
executeCommandASynchronously(java.lang.String command)
Execute the command in the remote host.
|
java.lang.String[] |
executeCommandASynchronously(java.lang.String command,
java.lang.String input)
Execute the command in the remote host.
|
java.lang.String |
getFileFromRemoteHost(java.lang.String local_file,
java.lang.String remote_file)
Get the remote file and store it in the local host
|
boolean |
hasAccess()
Check if the connection information is valid and the user has access to the specified cluster with the provided password
|
java.lang.String |
sendFileToRemoteHost(java.lang.String local_file,
java.lang.String remote_file)
Send the local file to the remote host
|
public SSHConnectionManager(HadoopClusterParameters hadoop_cluster)
public SSHConnectionManager(java.lang.String host,
java.lang.String user,
java.lang.String password)
public boolean hasAccess()
hasAccess in interface RemoteConnectionManagerpublic java.lang.String[] executeCommand(java.lang.String command)
executeCommand in interface RemoteConnectionManagercommand - shell command to executepublic java.lang.String[] executeCommand(java.lang.String command,
java.lang.String input)
executeCommand in interface RemoteConnectionManagercommand - shell command to executeinput - Standard inputpublic java.lang.String[] executeCommandASynchronously(java.lang.String command)
executeCommandASynchronously in interface RemoteConnectionManagercommand - shell command to executepublic java.lang.String[] executeCommandASynchronously(java.lang.String command,
java.lang.String input)
executeCommandASynchronously in interface RemoteConnectionManagercommand - shell command to executeinput - Standard inputpublic java.lang.String getFileFromRemoteHost(java.lang.String local_file,
java.lang.String remote_file)
getFileFromRemoteHost in interface RemoteConnectionManagerlocal_file - Local pathremote_file - Remote pathpublic java.lang.String sendFileToRemoteHost(java.lang.String local_file,
java.lang.String remote_file)
sendFileToRemoteHost in interface RemoteConnectionManagerlocal_file - Local pathremote_file - Remote path