Class SshResponse

java.lang.Object
io.gem.api.SshResponse

public final class SshResponse extends Object
Mutable holder for SSH command execution streams and exit code.

Used by SshUtils.runCommand(org.apache.sshd.client.session.ClientSession, String, long, SshResponse) to channel stdout/stderr and record the return code.

  • Field Details

    • DEFAULT_DIAGNOSTIC_BYTES

      public static final int DEFAULT_DIAGNOSTIC_BYTES
      Maximum stdout or stderr bytes retained for one remote command.
      See Also:
    • errOutputStream

      public final OutputStream errOutputStream
      OutputStream errOutputStream.
    • stdOutputStream

      public final OutputStream stdOutputStream
      OutputStream stdOutputStream.
    • returnCode

      public int returnCode
      int returnCode.
  • Constructor Details

    • SshResponse

      public SshResponse(boolean stdout)
      Create response streams.
      Parameters:
      stdout - if true, allocate a buffer for stdout; otherwise discard to a null stream
    • SshResponse

      public SshResponse(boolean stdout, int diagnosticBytes)
      Create response streams with an explicit diagnostic limit.
      Parameters:
      stdout - if true, retain bounded stdout; otherwise discard stdout
      diagnosticBytes - maximum bytes retained independently for stdout and stderr