Package com.sshtools.client
Class AbstractSessionChannel
java.lang.Object
com.sshtools.synergy.ssh.ChannelNG<SshClientContext>
com.sshtools.client.AbstractSessionChannel
- All Implemented Interfaces:
com.sshtools.common.ssh.Channel
- Direct Known Subclasses:
SessionChannelNG
public abstract class AbstractSessionChannel
extends com.sshtools.synergy.ssh.ChannelNG<SshClientContext>
Implements the client side of the SSH Connection protocol session channel
-
Nested Class Summary
Nested classes/interfaces inherited from class com.sshtools.synergy.ssh.ChannelNG
com.sshtools.synergy.ssh.ChannelNG.ChannelInputStream
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
Fields inherited from class com.sshtools.synergy.ssh.ChannelNG
cache, con, connection, localWindow, remoteWindow
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractSessionChannel
(int maximumPacketSize, com.sshtools.common.util.UnsignedInteger32 initialWindowSize, com.sshtools.common.util.UnsignedInteger32 maximumWindowSpace, com.sshtools.common.util.UnsignedInteger32 minimumWindowSpace, boolean autoConsume) AbstractSessionChannel
(int maximumPacketSize, com.sshtools.common.util.UnsignedInteger32 initialWindowSize, com.sshtools.common.util.UnsignedInteger32 maximumWindowSpace, com.sshtools.common.util.UnsignedInteger32 minimumWindowSpace, com.sshtools.common.ssh.ChannelRequestFuture closeFuture, boolean autoConsume) -
Method Summary
Modifier and TypeMethodDescriptioncom.sshtools.common.ssh.RequestFuture
allocatePseudoTerminal
(String type) com.sshtools.common.ssh.RequestFuture
allocatePseudoTerminal
(String type, int cols, int rows) com.sshtools.common.ssh.RequestFuture
allocatePseudoTerminal
(String type, int cols, int rows, int width, int height, PseudoTerminalModes modes) com.sshtools.common.ssh.RequestFuture
allocatePseudoTerminal
(String type, int cols, int rows, PseudoTerminalModes modes) void
changeTerminalDimensions
(int cols, int rows, int width, int height) protected byte[]
com.sshtools.common.ssh.RequestFuture
executeCommand
(String cmd) com.sshtools.common.ssh.RequestFuture
executeCommand
(String cmd, String charset) int
int
int
boolean
boolean
protected void
protected void
protected void
protected void
protected void
protected void
protected void
onChannelRequest
(String requesttype, boolean wantreply, byte[] requestdata) protected void
protected void
protected byte[]
openChannel
(byte[] requestdata) com.sshtools.common.ssh.RequestFuture
setEnvironmentVariable
(String key, String val) void
setSingleSession
(boolean singleSession) com.sshtools.common.ssh.RequestFuture
Send a signal to the remote process.com.sshtools.common.ssh.RequestFuture
com.sshtools.common.ssh.RequestFuture
startSubsystem
(String subsystem) Methods inherited from class com.sshtools.synergy.ssh.ChannelNG
addEventListener, canClose, checkWindowSpace, clearIdleState, close, close, close, createCache, disposeCache, evaluateWindowSpace, getChannelType, getCloseFuture, getConnection, getConnectionProtocol, getContext, getInputStream, getLastActivity, getLocalId, getLocalPacket, getLocalWindow, getMaxiumRemotePacketSize, getMaxiumRemoteWindowSize, getOpenFuture, getOutputStream, getRemoteId, getRemotePacket, getRemoteWindow, getSessionIdentifier, getTimeout, haltIncomingData, isAutoConsume, isClosed, isClosing, isConnected, isIncomingDataHalted, isLocalEOF, isOpen, isRemoteEOF, log, log, log, log, logMessage, logMessage, onChannelData, onChannelOpenFailure, onExtendedData, onRemoteClose, onWindowAdjust, processChannelRequestResponse, registerExtendedDataType, resetIdleState, resumeIncomingData, sendChannelDataAndBlock, sendChannelDataAndBlock, sendChannelDataAndBlock, sendChannelDataAndBlock, sendChannelDataAndBlock, sendChannelDataAndBlock, sendChannelRequest, sendChannelRequest, sendData, sendEOF, sendExtendedData, sendExtendedData, sendRequestResponse, sendWindowAdjust, sendWindowAdjust, setTimeout
-
Field Details
-
EXITCODE_NOT_RECEIVED
public static final int EXITCODE_NOT_RECEIVED- See Also:
-
SSH_EXTENDED_DATA_STDERR
public static final int SSH_EXTENDED_DATA_STDERR- See Also:
-
-
Constructor Details
-
AbstractSessionChannel
public AbstractSessionChannel(int maximumPacketSize, com.sshtools.common.util.UnsignedInteger32 initialWindowSize, com.sshtools.common.util.UnsignedInteger32 maximumWindowSpace, com.sshtools.common.util.UnsignedInteger32 minimumWindowSpace, boolean autoConsume) -
AbstractSessionChannel
public AbstractSessionChannel(int maximumPacketSize, com.sshtools.common.util.UnsignedInteger32 initialWindowSize, com.sshtools.common.util.UnsignedInteger32 maximumWindowSpace, com.sshtools.common.util.UnsignedInteger32 minimumWindowSpace, com.sshtools.common.ssh.ChannelRequestFuture closeFuture, boolean autoConsume)
-
-
Method Details
-
isSingleSession
public boolean isSingleSession() -
setSingleSession
public void setSingleSession(boolean singleSession) -
onChannelFree
protected void onChannelFree()- Specified by:
onChannelFree
in classcom.sshtools.synergy.ssh.ChannelNG<SshClientContext>
-
createChannel
- Specified by:
createChannel
in classcom.sshtools.synergy.ssh.ChannelNG<SshClientContext>
- Throws:
IOException
-
openChannel
protected byte[] openChannel(byte[] requestdata) throws com.sshtools.common.nio.WriteOperationRequest, com.sshtools.common.ssh.ChannelOpenException - Specified by:
openChannel
in classcom.sshtools.synergy.ssh.ChannelNG<SshClientContext>
- Throws:
com.sshtools.common.nio.WriteOperationRequest
com.sshtools.common.ssh.ChannelOpenException
-
onChannelOpenConfirmation
protected void onChannelOpenConfirmation()- Specified by:
onChannelOpenConfirmation
in classcom.sshtools.synergy.ssh.ChannelNG<SshClientContext>
-
onChannelError
- Overrides:
onChannelError
in classcom.sshtools.synergy.ssh.ChannelNG<SshClientContext>
-
onChannelClosed
protected void onChannelClosed()- Specified by:
onChannelClosed
in classcom.sshtools.synergy.ssh.ChannelNG<SshClientContext>
-
onChannelOpen
protected void onChannelOpen()- Specified by:
onChannelOpen
in classcom.sshtools.synergy.ssh.ChannelNG<SshClientContext>
-
allocatePseudoTerminal
-
allocatePseudoTerminal
public com.sshtools.common.ssh.RequestFuture allocatePseudoTerminal(String type, int cols, int rows) -
allocatePseudoTerminal
public com.sshtools.common.ssh.RequestFuture allocatePseudoTerminal(String type, int cols, int rows, PseudoTerminalModes modes) -
changeTerminalDimensions
public void changeTerminalDimensions(int cols, int rows, int width, int height) -
signal
Send a signal to the remote process. A signal can be delivered to the remote process using this method, some systems may not implement signals. The signal name should be one of the following values:ABRT ALRM FPE HUP ILL INT KILL PIPE QUIT SEGV TERM USR1 USR2
- Parameters:
signal
-- Returns:
- future
- Throws:
IOException
-
allocatePseudoTerminal
public com.sshtools.common.ssh.RequestFuture allocatePseudoTerminal(String type, int cols, int rows, int width, int height, PseudoTerminalModes modes) -
setEnvironmentVariable
-
startShell
public com.sshtools.common.ssh.RequestFuture startShell() -
executeCommand
-
executeCommand
-
startSubsystem
-
onChannelClosing
protected void onChannelClosing()- Specified by:
onChannelClosing
in classcom.sshtools.synergy.ssh.ChannelNG<SshClientContext>
-
onChannelRequest
- Specified by:
onChannelRequest
in classcom.sshtools.synergy.ssh.ChannelNG<SshClientContext>
-
getExitCode
public int getExitCode() -
isFlowControlEnabled
public boolean isFlowControlEnabled() -
getExitSignalInfo
-
onRemoteEOF
protected void onRemoteEOF()- Specified by:
onRemoteEOF
in classcom.sshtools.synergy.ssh.ChannelNG<SshClientContext>
-
onLocalEOF
protected void onLocalEOF()- Specified by:
onLocalEOF
in classcom.sshtools.synergy.ssh.ChannelNG<SshClientContext>
-
getMaximumRemotePacketLength
public int getMaximumRemotePacketLength() -
getMaximumLocalPacketLength
public int getMaximumLocalPacketLength()
-