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

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     

    Fields inherited from class com.sshtools.synergy.ssh.ChannelNG

    cache, con, connection, localWindow, remoteWindow
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractSessionChannel(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 Type
    Method
    Description
    com.sshtools.common.ssh.RequestFuture
     
    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
     
    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
     
    void
    setSingleSession(boolean singleSession)
     
    com.sshtools.common.ssh.RequestFuture
    signal(String signal)
    Send a signal to the remote process.
    com.sshtools.common.ssh.RequestFuture
     
    com.sshtools.common.ssh.RequestFuture
     

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 class com.sshtools.synergy.ssh.ChannelNG<SshClientContext>
    • createChannel

      protected byte[] createChannel() throws IOException
      Specified by:
      createChannel in class com.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 class com.sshtools.synergy.ssh.ChannelNG<SshClientContext>
      Throws:
      com.sshtools.common.nio.WriteOperationRequest
      com.sshtools.common.ssh.ChannelOpenException
    • onChannelOpenConfirmation

      protected void onChannelOpenConfirmation()
      Specified by:
      onChannelOpenConfirmation in class com.sshtools.synergy.ssh.ChannelNG<SshClientContext>
    • onChannelError

      protected void onChannelError(Throwable e)
      Overrides:
      onChannelError in class com.sshtools.synergy.ssh.ChannelNG<SshClientContext>
    • onChannelClosed

      protected void onChannelClosed()
      Specified by:
      onChannelClosed in class com.sshtools.synergy.ssh.ChannelNG<SshClientContext>
    • onChannelOpen

      protected void onChannelOpen()
      Specified by:
      onChannelOpen in class com.sshtools.synergy.ssh.ChannelNG<SshClientContext>
    • allocatePseudoTerminal

      public com.sshtools.common.ssh.RequestFuture allocatePseudoTerminal(String type)
    • 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

      public com.sshtools.common.ssh.RequestFuture signal(String 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

      public com.sshtools.common.ssh.RequestFuture setEnvironmentVariable(String key, String val)
    • startShell

      public com.sshtools.common.ssh.RequestFuture startShell()
    • executeCommand

      public com.sshtools.common.ssh.RequestFuture executeCommand(String cmd)
    • executeCommand

      public com.sshtools.common.ssh.RequestFuture executeCommand(String cmd, String charset)
    • startSubsystem

      public com.sshtools.common.ssh.RequestFuture startSubsystem(String subsystem)
    • onChannelClosing

      protected void onChannelClosing()
      Specified by:
      onChannelClosing in class com.sshtools.synergy.ssh.ChannelNG<SshClientContext>
    • onChannelRequest

      protected void onChannelRequest(String requesttype, boolean wantreply, byte[] requestdata)
      Specified by:
      onChannelRequest in class com.sshtools.synergy.ssh.ChannelNG<SshClientContext>
    • getExitCode

      public int getExitCode()
    • isFlowControlEnabled

      public boolean isFlowControlEnabled()
    • getExitSignalInfo

      public String getExitSignalInfo()
    • onRemoteEOF

      protected void onRemoteEOF()
      Specified by:
      onRemoteEOF in class com.sshtools.synergy.ssh.ChannelNG<SshClientContext>
    • onLocalEOF

      protected void onLocalEOF()
      Specified by:
      onLocalEOF in class com.sshtools.synergy.ssh.ChannelNG<SshClientContext>
    • getMaximumRemotePacketLength

      public int getMaximumRemotePacketLength()
    • getMaximumLocalPacketLength

      public int getMaximumLocalPacketLength()