Package io.gem.api
Class SshSession
java.lang.Object
io.gem.api.SshSession
Class SbkSsh.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSshSession
(ConnectionConfig conn, ExecutorService executor) This Constructor initializes all values. -
Method Summary
Modifier and TypeMethodDescriptioncopyDirectoryAsync
(String srcPath, String dstPath) It copies directory of sessions but throws ConnectException if it occurs.createSessionAsync
(long timeoutSeconds) This method Creates Sessions.runCommandAsync
(String cmd, Boolean isOutput, long timeoutSeconds) This method is responsible for running commands but throws ConnectException if it occurs.void
stop()
This method is responsible for closing session and stopping the client.
-
Field Details
-
connection
public SshConnection connection
.
-
-
Constructor Details
-
SshSession
This Constructor initializes all values.- Parameters:
conn
- SshConnectionexecutor
- ExecutorService
-
-
Method Details
-
createSessionAsync
This method Creates Sessions.- Parameters:
timeoutSeconds
- long- Returns:
- CompletableFuture
-
runCommandAsync
public CompletableFuture<SshResponse> runCommandAsync(String cmd, Boolean isOutput, long timeoutSeconds) throws ConnectException This method is responsible for running commands but throws ConnectException if it occurs.- Parameters:
cmd
- StringisOutput
- Is stdout output is requiredtimeoutSeconds
- long- Returns:
- CompletableFuture
- Throws:
ConnectException
- If connection exception occurs.
-
copyDirectoryAsync
public CompletableFuture<Void> copyDirectoryAsync(String srcPath, String dstPath) throws ConnectException It copies directory of sessions but throws ConnectException if it occurs.- Parameters:
srcPath
- StringdstPath
- String- Returns:
- CompletableFuture
- Throws:
ConnectException
- If connection exception occurs.
-
stop
public void stop()This method is responsible for closing session and stopping the client.
-