Interface Channel

    • Method Detail

      • getId

        int getId()
        Returns:
        Local channel identifier
      • getRecipient

        int getRecipient()
        Returns:
        Remote channel identifier
      • getLocalWindow

        Window getLocalWindow()
      • getRemoteWindow

        Window getRemoteWindow()
      • handleClose

        void handleClose()
                  throws IOException
        Invoked when SSH_MSG_CHANNEL_CLOSE received
        Throws:
        IOException - If failed to handle the message
      • handleWindowAdjust

        void handleWindowAdjust​(Buffer buffer)
                         throws IOException
        Invoked when SSH_MSG_CHANNEL_WINDOW_ADJUST received
        Parameters:
        buffer - The rest of the message data Buffer after decoding the channel identifiers
        Throws:
        IOException - If failed to handle the message
      • handleRequest

        void handleRequest​(Buffer buffer)
                    throws IOException
        Invoked when SSH_MSG_CHANNEL_REQUEST received
        Parameters:
        buffer - The rest of the message data Buffer after decoding the channel identifiers
        Throws:
        IOException - If failed to handle the message
      • handleData

        void handleData​(Buffer buffer)
                 throws IOException
        Invoked when SSH_MSG_CHANNEL_DATA received
        Parameters:
        buffer - The rest of the message data Buffer after decoding the channel identifiers
        Throws:
        IOException - If failed to handle the message
      • handleExtendedData

        void handleExtendedData​(Buffer buffer)
                         throws IOException
        Invoked when SSH_MSG_CHANNEL_EXTENDED_DATA received
        Parameters:
        buffer - The rest of the message data Buffer after decoding the channel identifiers
        Throws:
        IOException - If failed to handle the message
      • handleEof

        void handleEof()
                throws IOException
        Invoked when SSH_MSG_CHANNEL_EOF received
        Throws:
        IOException - If failed to handle the message
      • handleSuccess

        void handleSuccess()
                    throws IOException
        Invoked when SSH_MSG_CHANNEL_SUCCESS received
        Throws:
        IOException - If failed to handle the message
      • handleFailure

        void handleFailure()
                    throws IOException
        Invoked when SSH_MSG_CHANNEL_FAILURE received
        Throws:
        IOException - If failed to handle the message
      • init

        void init​(ConnectionService service,
                  Session session,
                  int id)
           throws IOException
        Invoked when the local channel is initial created
        Parameters:
        service - The ConnectionService through which the channel is initialized
        session - The Session associated with the channel
        id - The locally assigned channel identifier
        Throws:
        IOException - If failed to process the initialization
      • open

        OpenFuture open​(int recipient,
                        long rwSize,
                        long packetSize,
                        Buffer buffer)
        For a server channel, this method will actually open the channel
        Parameters:
        recipient - Recipient identifier
        rwSize - Read/Write window size (uint32)
        packetSize - Preferred maximum packet size (uint32)
        buffer - Incoming Buffer that triggered the call. Note: the buffer's read position is exactly after the information that read to this call was decoded
        Returns:
        An OpenFuture for the channel open request
      • handleOpenSuccess

        void handleOpenSuccess​(int recipient,
                               long rwSize,
                               long packetSize,
                               Buffer buffer)
                        throws IOException
        For a client channel, this method will be called internally by the session when the confirmation has been received.
        Parameters:
        recipient - Recipient identifier
        rwSize - Read/Write window size (uint32)
        packetSize - Preferred maximum packet size (uint32)
        buffer - Incoming Buffer that triggered the call. Note: the buffer's read position is exactly after the information that read to this call was decoded
        Throws:
        IOException - If failed to handle the success
      • handleOpenFailure

        void handleOpenFailure​(Buffer buffer)
                        throws IOException
        For a client channel, this method will be called internally by the session when the server has rejected this channel opening.
        Parameters:
        buffer - Incoming Buffer that triggered the call. Note: the buffer's read position is exactly after the information that read to this call was decoded
        Throws:
        IOException - If failed to handle the success
      • resolveAttribute

        default <T> T resolveAttribute​(AttributeRepository.AttributeKey<T> key)
        Description copied from interface: AttributeRepository
        Attempts to resolve the associated value by going up the store's hierarchy (if any)
        Specified by:
        resolveAttribute in interface AttributeRepository
        Type Parameters:
        T - The generic attribute type
        Parameters:
        key - The key of the attribute; must not be null.
        Returns:
        null if there is no value associated with the specified key either in this repository or any of its ancestors (if any available)