public interface SessionListener extends SshdEventListener
Modifier and Type | Interface and Description |
---|---|
static class |
SessionListener.Event |
Modifier and Type | Method and Description |
---|---|
default void |
sessionClosed(Session session)
A session has been closed
|
default void |
sessionCreated(Session session)
A new session just been created
|
default void |
sessionDisconnect(Session session,
int reason,
java.lang.String msg,
java.lang.String language,
boolean initiator)
Invoked when
SSH_MSG_DISCONNECT message was sent/received |
default void |
sessionEvent(Session session,
SessionListener.Event event)
An event has been triggered
|
default void |
sessionException(Session session,
java.lang.Throwable t)
An exception was caught and the session will be closed
(if not already so).
|
default void |
sessionNegotiationEnd(Session session,
java.util.Map<KexProposalOption,java.lang.String> clientProposal,
java.util.Map<KexProposalOption,java.lang.String> serverProposal,
java.util.Map<KexProposalOption,java.lang.String> negotiatedOptions,
java.lang.Throwable reason)
Signals the end of the negotiation options handling
|
default void |
sessionNegotiationStart(Session session,
java.util.Map<KexProposalOption,java.lang.String> clientProposal,
java.util.Map<KexProposalOption,java.lang.String> serverProposal)
Signals the start of the negotiation options handling
|
static <L extends SessionListener> |
validateListener(L listener) |
validateListener
default void sessionCreated(Session session)
session
- The created Session
default void sessionNegotiationStart(Session session, java.util.Map<KexProposalOption,java.lang.String> clientProposal, java.util.Map<KexProposalOption,java.lang.String> serverProposal)
session
- The referenced Session
clientProposal
- The client proposal options (un-modifiable)serverProposal
- The server proposal options (un-modifiable)default void sessionNegotiationEnd(Session session, java.util.Map<KexProposalOption,java.lang.String> clientProposal, java.util.Map<KexProposalOption,java.lang.String> serverProposal, java.util.Map<KexProposalOption,java.lang.String> negotiatedOptions, java.lang.Throwable reason)
session
- The referenced Session
clientProposal
- 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 - null
if successfuldefault void sessionEvent(Session session, SessionListener.Event event)
session
- The referenced Session
event
- The generated SessionListener.Event
default void sessionException(Session session, java.lang.Throwable t)
sessionClosed(Session)
will be called
or perhaps has already been calledsession
- The referenced Session
t
- The caught exceptiondefault void sessionDisconnect(Session session, int reason, java.lang.String msg, java.lang.String language, boolean initiator)
SSH_MSG_DISCONNECT
message was sent/receivedsession
- The referenced Session
reason
- 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 messagedefault void sessionClosed(Session session)
session
- The closed Session
static <L extends SessionListener> L validateListener(L listener)