Class Channel

java.lang.Object
com.sshtools.j2ssh.connection.Channel
Direct Known Subclasses:
BindingChannel, IOChannel, SocketChannel, SubsystemChannel

public abstract class Channel extends Object
Version:
$Revision: 1.74 $
Author:
$author$
  • Field Details

    • localWindow

      protected ChannelDataWindow localWindow
    • remoteWindow

      protected ChannelDataWindow remoteWindow
    • connection

      protected ConnectionProtocol connection
    • localChannelId

      protected long localChannelId
    • localPacketSize

      protected long localPacketSize
    • remoteChannelId

      protected long remoteChannelId
    • remotePacketSize

      protected long remotePacketSize
    • state

      protected ChannelState state
  • Constructor Details

    • Channel

      public Channel()
      Creates a new Channel object.
  • Method Details

    • getChannelOpenData

      public abstract byte[] getChannelOpenData()
      Returns:
    • getChannelConfirmationData

      public abstract byte[] getChannelConfirmationData()
      Returns:
    • getChannelType

      public abstract String getChannelType()
      Returns:
    • getMinimumWindowSpace

      protected abstract int getMinimumWindowSpace()
      Returns:
    • getMaximumWindowSpace

      protected abstract int getMaximumWindowSpace()
      Returns:
    • getMaximumPacketSize

      protected abstract int getMaximumPacketSize()
      Returns:
    • onChannelData

      protected abstract void onChannelData(SshMsgChannelData msg) throws IOException
      Parameters:
      msg -
      Throws:
      IOException
    • processChannelData

      protected void processChannelData(SshMsgChannelData msg) throws IOException
      Parameters:
      msg -
      Throws:
      IOException
    • isClosed

      public boolean isClosed()
      Returns:
    • isOpen

      public boolean isOpen()
      Returns:
    • sendChannelData

      protected void sendChannelData(byte[] data) throws IOException
      Parameters:
      data -
      Throws:
      IOException
    • sendChannelExtData

      protected void sendChannelExtData(int type, byte[] data) throws IOException
      Parameters:
      type -
      data -
      Throws:
      IOException
    • onChannelExtData

      protected abstract void onChannelExtData(SshMsgChannelExtendedData msg) throws IOException
      Parameters:
      msg -
      Throws:
      IOException
    • processChannelData

      protected void processChannelData(SshMsgChannelExtendedData msg) throws IOException
      Parameters:
      msg -
      Throws:
      IOException
    • getLocalChannelId

      public long getLocalChannelId()
      Returns:
    • getLocalPacketSize

      public long getLocalPacketSize()
      Returns:
    • getLocalWindow

      public ChannelDataWindow getLocalWindow()
      Returns:
    • getRemoteChannelId

      public long getRemoteChannelId()
      Returns:
    • getRemotePacketSize

      public long getRemotePacketSize()
      Returns:
    • getRemoteWindow

      public ChannelDataWindow getRemoteWindow()
      Returns:
    • getState

      public ChannelState getState()
      Returns:
    • close

      public void close() throws IOException
      Throws:
      IOException
    • remoteClose

      protected void remoteClose() throws IOException
      Throws:
      IOException
    • finalizeClose

      protected void finalizeClose() throws IOException
      Throws:
      IOException
    • setLocalEOF

      public void setLocalEOF() throws IOException
      Throws:
      IOException
    • isLocalEOF

      public boolean isLocalEOF()
      Returns:
    • isRemoteEOF

      public boolean isRemoteEOF()
      Returns:
    • setRemoteEOF

      protected void setRemoteEOF() throws IOException
      Throws:
      IOException
    • addEventListener

      public void addEventListener(ChannelEventListener eventListener)
      Parameters:
      eventListener -
    • init

      protected void init(ConnectionProtocol connection, long localChannelId, long senderChannelId, long initialWindowSize, long maximumPacketSize) throws IOException
      Parameters:
      connection -
      localChannelId -
      senderChannelId -
      initialWindowSize -
      maximumPacketSize -
      Throws:
      IOException
    • open

      protected void open() throws IOException
      Throws:
      IOException
    • init

      protected void init(ConnectionProtocol connection, long localChannelId, long senderChannelId, long initialWindowSize, long maximumPacketSize, ChannelEventListener eventListener) throws IOException
      Parameters:
      connection -
      localChannelId -
      senderChannelId -
      initialWindowSize -
      maximumPacketSize -
      eventListener -
      Throws:
      IOException
    • onChannelClose

      protected abstract void onChannelClose() throws IOException
      Throws:
      IOException
    • onChannelEOF

      protected abstract void onChannelEOF() throws IOException
      Throws:
      IOException
    • onChannelOpen

      protected abstract void onChannelOpen() throws IOException
      Throws:
      IOException
    • onChannelRequest

      protected abstract void onChannelRequest(String requestType, boolean wantReply, byte[] requestData) throws IOException
      Parameters:
      requestType -
      wantReply -
      requestData -
      Throws:
      IOException
    • setName

      public void setName(String name)
      Parameters:
      name -
    • getName

      public String getName()
      Returns: