Interface ChannelListener

All Superinterfaces:
EventListener, SshdEventListener

public interface ChannelListener extends SshdEventListener
Provides a simple listener for client / server channels being established or torn down. Note: for server-side listeners, some of the established channels may be client - especially where connection proxy or forwarding is concerned
Author:
Apache MINA SSHD Project
  • Field Details

  • Method Details

    • channelInitialized

      default void channelInitialized(Channel channel)
      Called to inform about initial setup of a channel via the Channel.init(org.apache.sshd.common.session.ConnectionService, org.apache.sshd.common.session.Session, long) method. Note: this method is guaranteed to be called before either of the channelOpenSuccess(Channel) or channelOpenFailure(Channel, Throwable) will be called
      Parameters:
      channel - The initialized Channel
    • channelOpenSuccess

      default void channelOpenSuccess(Channel channel)
      Called to inform about a channel being successfully opened for a session. Note: when the call is made, the channel is known to be open but nothing beyond that.
      Parameters:
      channel - The newly opened Channel
    • channelOpenFailure

      default void channelOpenFailure(Channel channel, Throwable reason)
      Called to inform about the failure to open a channel
      Parameters:
      channel - The failed Channel
      reason - The Throwable reason - Note: if the channelOpenSuccess(Channel) notification throws an exception it will cause this method to be invoked
    • channelStateChanged

      default void channelStateChanged(Channel channel, String hint)
      Called to inform that the channel state may have changed - e.g., received EOF, window adjustment, etc..
      Parameters:
      channel - The Channel whose state has changed
      hint - A "hint" as to the nature of the state change. it can be a request name or a SSH_MSG_CHANNEL_XXX command or the name of an exception class
    • channelClosed

      default void channelClosed(Channel channel, Throwable reason)
      Called to inform about a channel being closed. Note: when the call is made there are no guarantees about the channel's actual state except that it either has been already closed or may be in the process of being closed. Note: this method is guaranteed to be called regardless of whether channelOpenSuccess(Channel) or channelOpenFailure(Channel, Throwable) have been called
      Parameters:
      channel - The referenced Channel
      reason - The reason why the channel is being closed - if null then normal closure
    • validateListener

      static <L extends ChannelListener> L validateListener(L listener)