Package io.gem.api

Class SshSession

java.lang.Object
io.gem.api.SshSession

public final class SshSession extends Object
Class SbkSsh.
  • Field Details

    • connection

      public final ConnectionConfig connection
      public SshConnection connection.
  • Constructor Details

    • SshSession

      public SshSession(ConnectionConfig conn, ExecutorService executor)
      This Constructor initializes all values.
      Parameters:
      conn - SshConnection
      executor - ExecutorService
  • Method Details

    • createSessionAsync

      public CompletableFuture<Void> createSessionAsync(long timeoutSeconds)
      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 - String
      isOutput - Is stdout output is required
      timeoutSeconds - 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 - String
      dstPath - String
      Returns:
      CompletableFuture
      Throws:
      ConnectException - If connection exception occurs.
    • stop

      public void stop()
      This method is responsible for closing session and stopping the client.