summaryrefslogtreecommitdiffstats
path: root/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api
diff options
context:
space:
mode:
Diffstat (limited to 'appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api')
-rw-r--r--appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src/main/java/org/onap/appc/adapter/ssh/SshAdapter.java30
-rw-r--r--appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src/main/java/org/onap/appc/adapter/ssh/SshConnection.java70
2 files changed, 55 insertions, 45 deletions
diff --git a/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src/main/java/org/onap/appc/adapter/ssh/SshAdapter.java b/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src/main/java/org/onap/appc/adapter/ssh/SshAdapter.java
index bf3f7f64e..91dc0ad49 100644
--- a/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src/main/java/org/onap/appc/adapter/ssh/SshAdapter.java
+++ b/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src/main/java/org/onap/appc/adapter/ssh/SshAdapter.java
@@ -28,14 +28,24 @@ package org.onap.appc.adapter.ssh;
*/
public interface SshAdapter {
- /**
- * Creates instance of SshConnection.
- *
- * @param host remote host to open SSH connection to
- * @param port remote SSH port
- * @param username SSH connection user name
- * @param password SSH connection password
- * @return instance of SshConnection
- */
- SshConnection getConnection(String host, int port, String username, String password);
+ /**
+ * Creates instance of SshConnection.
+ *
+ * @param host remote host to open SSH connection to
+ * @param port remote SSH port
+ * @param username SSH connection user name
+ * @param password SSH connection password
+ * @return instance of SshConnection
+ */
+ SshConnection getConnection(String host, int port, String username, String password);
+
+ /**
+ * Creates instance of SshConnection.
+ *
+ * @param host remote host to open SSH connection to
+ * @param port remote SSH port
+ * @param keyFile SSH connection key file location
+ * @return instance of SshConnection
+ */
+ SshConnection getConnection(String host, int port, String keyFile);
}
diff --git a/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src/main/java/org/onap/appc/adapter/ssh/SshConnection.java b/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src/main/java/org/onap/appc/adapter/ssh/SshConnection.java
index cd80a2e35..db67f00cd 100644
--- a/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src/main/java/org/onap/appc/adapter/ssh/SshConnection.java
+++ b/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src/main/java/org/onap/appc/adapter/ssh/SshConnection.java
@@ -30,45 +30,45 @@ import java.io.OutputStream;
*/
public interface SshConnection {
- /**
- * Connect to SSH server.
- */
- void connect();
+ /**
+ * Connect to SSH server.
+ */
+ void connect();
- /**
- * Connect to SSH Server using a retry mechanism
- */
- void connectWithRetry();
+ /**
+ * Connect to SSH Server using a retry mechanism
+ */
+ void connectWithRetry();
- /**
- * Disconnect from SSH server.
- */
- void disconnect();
+ /**
+ * Disconnect from SSH server.
+ */
+ void disconnect();
- /**
- * Exec remote command over SSH. Return command execution status.
- * Command output is written to out or err stream.
- *
- * @param cmd command to execute
- * @param out content of sysout will go to this stream
- * @param err content of syserr will go to this stream
- * @return command execution status
- */
- int execCommand(String cmd, OutputStream out, OutputStream err);
+ /**
+ * Exec remote command over SSH. Return command execution status.
+ * Command output is written to out or err stream.
+ *
+ * @param cmd command to execute
+ * @param out content of sysout will go to this stream
+ * @param err content of syserr will go to this stream
+ * @return command execution status
+ */
+ int execCommand(String cmd, OutputStream out, OutputStream err);
- /**
- * Exec remote command over SSH with pseudo-tty. Return command execution status.
- * Command output is written to out stream only as pseudo-tty writes to one stream only.
- *
- * @param cmd command to execute
- * @param out content of sysout will go to this stream
- * @return command execution status
- */
- int execCommandWithPty(String cmd, OutputStream out);
+ /**
+ * Exec remote command over SSH with pseudo-tty. Return command execution status.
+ * Command output is written to out stream only as pseudo-tty writes to one stream only.
+ *
+ * @param cmd command to execute
+ * @param out content of sysout will go to this stream
+ * @return command execution status
+ */
+ int execCommandWithPty(String cmd, OutputStream out);
- /**
- * Set the command execution timeout
- * @param timeout time in milliseconds
+ /**
+ * Set the command execution timeout
+ * @param timeout time in milliseconds
*/
- void setExecTimeout(long timeout);
+ void setExecTimeout(long timeout);
}