Package org.apache.sshd.common.session
Interface ReservedSessionMessagesHandler
- All Superinterfaces:
EventListener
,SshdEventListener
- All Known Implementing Classes:
ReservedSessionMessagesHandlerAdapter
Provides a way to listen and handle the
SSH_MSG_IGNORE
and SSH_MSG_DEBUG
messages that are received
by a session, as well as proprietary and/or extension messages.-
Method Summary
Modifier and TypeMethodDescriptiondefault void
handleDebugMessage
(Session session, Buffer buffer) Invoked when anSSH_MSG_DEBUG
packet is receiveddefault void
handleIgnoreMessage
(Session session, Buffer buffer) Invoked when anSSH_MSG_IGNORE
packet is receiveddefault boolean
handleUnimplementedMessage
(Session session, int cmd, Buffer buffer) Invoked when a packet with an un-implemented message is received - includingSSH_MSG_UNIMPLEMENTED
itselfdefault boolean
sendReservedHeartbeat
(ConnectionService service) Invoked if the user configured usage of a proprietary heartbeat mechanism.
-
Method Details
-
handleIgnoreMessage
Invoked when anSSH_MSG_IGNORE
packet is received- Parameters:
session
- TheSession
through which the message was receivedbuffer
- TheBuffer
containing the data- Throws:
Exception
- If failed to handle the message- See Also:
-
handleDebugMessage
Invoked when anSSH_MSG_DEBUG
packet is received- Parameters:
session
- TheSession
through which the message was receivedbuffer
- TheBuffer
containing the data- Throws:
Exception
- If failed to handle the message- See Also:
-
handleUnimplementedMessage
default boolean handleUnimplementedMessage(Session session, int cmd, Buffer buffer) throws Exception Invoked when a packet with an un-implemented message is received - includingSSH_MSG_UNIMPLEMENTED
itself- Parameters:
session
- TheSession
through which the message was receivedcmd
- The received (un-implemented) commandbuffer
- TheBuffer
containing the data - positioned just beyond the command- Returns:
true
if message handled internally,false
if should return aSSH_MSG_UNIMPLEMENTED
reply (default behavior)- Throws:
Exception
- If failed to handle the message- See Also:
-
sendReservedHeartbeat
Invoked if the user configured usage of a proprietary heartbeat mechanism. Note: by default throwsUnsupportedOperationException
so users who configure a proprietary heartbeat mechanism option must provide an implementation for this method.- Parameters:
service
- TheConnectionService
through which the heartbeat is being executed.- Returns:
true
whether heartbeat actually sent - Note: used mainly for debugging purposes.- Throws:
Exception
- If failed to send the heartbeat - Note: causes associated session termination.
-