public interface ReservedSessionMessagesHandler extends SshdEventListener
SSH_MSG_IGNORE
and SSH_MSG_DEBUG
messages that are received
by a session, as well as proprietary and/or extension messages and behavior.Modifier and Type | Method and Description |
---|---|
default void |
handleDebugMessage(Session session,
Buffer buffer)
Invoked when an
SSH_MSG_DEBUG packet is received |
default void |
handleIgnoreMessage(Session session,
Buffer buffer)
Invoked when an
SSH_MSG_IGNORE packet is received |
default boolean |
handleUnimplementedMessage(Session session,
int cmd,
Buffer buffer)
Invoked when a packet with an un-implemented message is received - including
SSH_MSG_UNIMPLEMENTED itself |
default IoWriteFuture |
sendIdentification(Session session,
String version,
List<String> extraLines)
Send the initial version exchange identification in and independent manner
|
default IoWriteFuture |
sendKexInitRequest(Session session,
Map<KexProposalOption,String> proposal,
Buffer packet)
Invoked before sending the
SSH_MSG_KEXINIT packet |
default boolean |
sendReservedHeartbeat(ConnectionService service)
Invoked if the user configured usage of a proprietary heartbeat mechanism.
|
validateListener
default IoWriteFuture sendIdentification(Session session, String version, List<String> extraLines) throws Exception
session
- The Session
through which the version is exchange is being managedversion
- The version line that was resolved - Note: since this string is part of the KEX and is
cached in the calling session, any changes to it require updating the session's cached
value.extraLines
- Extra lines to be sent - valid only for server sessions. Note:/B> the handler may modify
these lines and return null
thus signaling the session to proceed with sending the
identificationIoWriteFuture
that can be used to wait for the data to be sent successfully. If
null
then the session will send the identification, otherwise it is assumed that the
handler has sent it.Exception
- if failed to handle the callbackdefault IoWriteFuture sendKexInitRequest(Session session, Map<KexProposalOption,String> proposal, Buffer packet) throws Exception
SSH_MSG_KEXINIT
packetsession
- The Session
through which the key exchange is being managedproposal
- The KEX proposal that was used to build the packetpacket
- The packet containing the fully encoded message - Caveat: this packet later serves as
part of the key generation, so care must be taken if manipulating it.null
IoWriteFuture
to signal that handler took care of the KEX packet
delivery.Exception
- if failed to handle the callbackdefault void handleIgnoreMessage(Session session, Buffer buffer) throws Exception
SSH_MSG_IGNORE
packet is receivedsession
- The Session
through which the message was receivedbuffer
- The Buffer
containing the dataException
- If failed to handle the messagedefault void handleDebugMessage(Session session, Buffer buffer) throws Exception
SSH_MSG_DEBUG
packet is receivedsession
- The Session
through which the message was receivedbuffer
- The Buffer
containing the dataException
- If failed to handle the messagedefault boolean handleUnimplementedMessage(Session session, int cmd, Buffer buffer) throws Exception
SSH_MSG_UNIMPLEMENTED
itselfsession
- The Session
through which the message was receivedcmd
- The received (un-implemented) commandbuffer
- The Buffer
containing the data - positioned just beyond the commandtrue
if message handled internally, false
if should return a
SSH_MSG_UNIMPLEMENTED
reply (default behavior)Exception
- If failed to handle the messagedefault boolean sendReservedHeartbeat(ConnectionService service) throws Exception
UnsupportedOperationException
so users who configure a proprietary heartbeat mechanism option must
provide an implementation for this method.service
- The ConnectionService
through which the heartbeat is being executed.true
whether heartbeat actually sent - Note: used mainly for debugging purposes.Exception
- If failed to send the heartbeat - Note: causes associated session termination.Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.