Package org.apache.sshd.common.channel
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 Summary
Fields Modifier and Type Field Description static ChannelListenerEMPTY
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description default voidchannelClosed(Channel channel, Throwable reason)Called to inform about a channel being closed.default voidchannelInitialized(Channel channel)Called to inform about initial setup of a channel via theChannel.init(org.apache.sshd.common.session.ConnectionService, org.apache.sshd.common.session.Session, long)method.default voidchannelOpenFailure(Channel channel, Throwable reason)Called to inform about the failure to open a channeldefault voidchannelOpenSuccess(Channel channel)Called to inform about a channel being successfully opened for a session.default voidchannelStateChanged(Channel channel, String hint)Called to inform that the channel state may have changed - e.g., received EOF, window adjustment, etc..static <L extends ChannelListener>
LvalidateListener(L listener)
-
-
-
Field Detail
-
EMPTY
static final ChannelListener EMPTY
-
-
Method Detail
-
channelInitialized
default void channelInitialized(Channel channel)
Called to inform about initial setup of a channel via theChannel.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 thechannelOpenSuccess(Channel)orchannelOpenFailure(Channel, Throwable)will be called- Parameters:
channel- The initializedChannel
-
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 openedChannel
-
channelOpenFailure
default void channelOpenFailure(Channel channel, Throwable reason)
Called to inform about the failure to open a channel- Parameters:
channel- The failedChannelreason- TheThrowablereason - Note: if thechannelOpenSuccess(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- TheChannelwhose state has changedhint- A "hint" as to the nature of the state change. it can be a request name or aSSH_MSG_CHANNEL_XXXcommand 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 whetherchannelOpenSuccess(Channel)orchannelOpenFailure(Channel, Throwable)have been called- Parameters:
channel- The referencedChannelreason- The reason why the channel is being closed - ifnullthen normal closure
-
validateListener
static <L extends ChannelListener> L validateListener(L listener)
-
-