summaryrefslogtreecommitdiffstats
path: root/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src
diff options
context:
space:
mode:
authorGanesh Chandrasekaran <ganesh.c@samsung.com>2018-07-20 16:32:46 +0900
committerPatrick Brady <pb071s@att.com>2018-07-26 21:47:39 +0000
commit14175c4605745183a09dcd0fdc72c0d4e8a05b20 (patch)
tree0fa5e27c0207cc3da30f4acf3af9bc1020bff4aa /appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src
parentfdf7e648663e5770a431e9ba8088be6c3bbf1f5a (diff)
API to support getConnection with SSH KeyFile
Issue-ID: APPC-1097 Change-Id: Ic9baa3e43be55bc20aa974898c164cc8a590a78a Signed-off-by: Ganesh Chandrasekaran <ganesh.c@samsung.com>
Diffstat (limited to 'appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/src')
-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);
}