Interface SessionListener
- All Superinterfaces:
EventListener, org.apache.sshd.common.util.SshdEventListener
- All Known Implementing Classes:
SessionTimeoutListener
public interface SessionListener
extends org.apache.sshd.common.util.SshdEventListener
Represents an interface receiving session events.
- Author:
- Apache MINA SSHD Project
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault voidsessionClosed(Session session) A session has been closeddefault voidsessionCreated(Session session) A new session just been created.default voidsessionDisconnect(Session session, int reason, String msg, String language, boolean initiator) Invoked whenSSH_MSG_DISCONNECTmessage was sent/receiveddefault voidsessionEvent(Session session, SessionListener.Event event) An event has been triggereddefault voidsessionException(Session session, Throwable t) An exception was caught and the session will be closed (if not already so).default voidsessionNegotiationEnd(Session session, Map<org.apache.sshd.common.kex.KexProposalOption, String> clientProposal, Map<org.apache.sshd.common.kex.KexProposalOption, String> serverProposal, Map<org.apache.sshd.common.kex.KexProposalOption, String> negotiatedOptions, Throwable reason) Signals the end of the negotiation options handlingdefault voidsessionNegotiationOptionsCreated(Session session, Map<org.apache.sshd.common.kex.KexProposalOption, String> proposal) default voidsessionNegotiationStart(Session session, Map<org.apache.sshd.common.kex.KexProposalOption, String> clientProposal, Map<org.apache.sshd.common.kex.KexProposalOption, String> serverProposal) Signals the start of the negotiation options handlingdefault voidsessionPeerIdentificationLine(Session session, String line, List<String> extraLines) Successfully read a line as part of the initial peer identificationdefault voidsessionPeerIdentificationReceived(Session session, String version, List<String> extraLines) The peer's identification version was receiveddefault voidsessionPeerIdentificationSend(Session session, String version, List<String> extraLines) About to send identification to peerdefault voidsessionStarting(Session session) A new session is about to start.static <L extends SessionListener>
LvalidateListener(L listener)
-
Method Details
-
sessionCreated
-
sessionStarting
A new session is about to start. The session's filter chain is defined, and it will start the SSH protocol next by sending its SSH protocol identification. The listener has a last chance to modify the filter chain.This event could be used for instance to insert a proxy filter at the front of the filter chain.
- Parameters:
session- the startingSession
-
sessionPeerIdentificationSend
default void sessionPeerIdentificationSend(Session session, String version, List<String> extraLines) About to send identification to peer- Parameters:
session- TheSessioninstanceversion- The resolved identification versionextraLines- Extra data preceding the identification to be sent. Note: the list is modifiable only if this is a server session. The user may modify it based on the peer.- See Also:
-
sessionPeerIdentificationLine
Successfully read a line as part of the initial peer identification- Parameters:
session- TheSessioninstanceline- The data that was read so far - Note: might not be a full line if more packets are required for full identification data. Furthermore, it may be repeated data due to packets segmentation and re-assembly mechanismextraLines- Previous lines that were before this one - Note: it may be repeated data due to packets segmentation and re-assembly mechanism- See Also:
-
sessionPeerIdentificationReceived
default void sessionPeerIdentificationReceived(Session session, String version, List<String> extraLines) The peer's identification version was received- Parameters:
session- TheSessioninstanceversion- The retrieved identification versionextraLines- Extra data preceding the identification- See Also:
-
sessionNegotiationOptionsCreated
default void sessionNegotiationOptionsCreated(Session session, Map<org.apache.sshd.common.kex.KexProposalOption, String> proposal) - Parameters:
session- The referencedSessionproposal- The proposals that will be sent to the peer - Caveat emptor: the proposal is modifiable i.e., the handler can modify it before being sent
-
sessionNegotiationStart
default void sessionNegotiationStart(Session session, Map<org.apache.sshd.common.kex.KexProposalOption, String> clientProposal, Map<org.apache.sshd.common.kex.KexProposalOption, String> serverProposal) Signals the start of the negotiation options handling- Parameters:
session- The referencedSessionclientProposal- The client proposal options (un-modifiable)serverProposal- The server proposal options (un-modifiable)
-
sessionNegotiationEnd
default void sessionNegotiationEnd(Session session, Map<org.apache.sshd.common.kex.KexProposalOption, String> clientProposal, Map<org.apache.sshd.common.kex.KexProposalOption, String> serverProposal, Map<org.apache.sshd.common.kex.KexProposalOption, String> negotiatedOptions, Throwable reason) Signals the end of the negotiation options handling- Parameters:
session- The referencedSessionclientProposal- The client proposal options (un-modifiable)serverProposal- The server proposal options (un-modifiable)negotiatedOptions- The successfully negotiated options so far - even if exception occurred (un-modifiable)reason- Negotiation end reason -nullif successful
-
sessionEvent
An event has been triggered- Parameters:
session- The referencedSessionevent- The generatedSessionListener.Event
-
sessionException
An exception was caught and the session will be closed (if not already so). Note: the code makes no guarantee that at this stagesessionClosed(Session)will be called or perhaps has already been called- Parameters:
session- The referencedSessiont- The caught exception
-
sessionDisconnect
default void sessionDisconnect(Session session, int reason, String msg, String language, boolean initiator) Invoked whenSSH_MSG_DISCONNECTmessage was sent/received- Parameters:
session- The referencedSessionreason- The signaled reason codemsg- The provided description message (may be empty)language- The language tag indicator (may be empty)initiator- Whether the session is the sender or recipient of the message- See Also:
-
sessionClosed
-
validateListener
-