Class SshResponse
java.lang.Object
io.gem.api.SshResponse
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum stdout or stderr bytes retained for one remote command.final OutputStreamOutputStream errOutputStream.intint returnCode.final OutputStreamOutputStream stdOutputStream. -
Constructor Summary
ConstructorsConstructorDescriptionSshResponse(boolean stdout) Create response streams.SshResponse(boolean stdout, int diagnosticBytes) Create response streams with an explicit diagnostic limit. -
Method Summary
-
Field Details
-
DEFAULT_DIAGNOSTIC_BYTES
public static final int DEFAULT_DIAGNOSTIC_BYTESMaximum stdout or stderr bytes retained for one remote command.- See Also:
-
errOutputStream
OutputStream errOutputStream. -
stdOutputStream
OutputStream stdOutputStream. -
returnCode
public int returnCodeint 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 stdoutdiagnosticBytes- maximum bytes retained independently for stdout and stderr
-