Package org.apache.sshd.common.session
Interface ReservedSessionMessagesHandler
-
- All Superinterfaces:
java.util.EventListener,SshdEventListener
- All Known Implementing Classes:
ReservedSessionMessagesHandlerAdapter
public interface ReservedSessionMessagesHandler extends SshdEventListener
Provides a way to listen and handle theSSH_MSG_IGNOREandSSH_MSG_DEBUGmessages that are received by a session, as well as proprietary and/or extension messages.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default voidhandleDebugMessage(Session session, Buffer buffer)Invoked when anSSH_MSG_DEBUGpacket is receiveddefault voidhandleIgnoreMessage(Session session, Buffer buffer)Invoked when anSSH_MSG_IGNOREpacket is receiveddefault booleanhandleUnimplementedMessage(Session session, int cmd, Buffer buffer)Invoked when a packet with an un-implemented message is received - includingSSH_MSG_UNIMPLEMENTEDitselfdefault booleansendReservedHeartbeat(ConnectionService service)Invoked if the user configured usage of a proprietary heartbeat mechanism.
-
-
-
Method Detail
-
handleIgnoreMessage
default void handleIgnoreMessage(Session session, Buffer buffer) throws java.lang.Exception
Invoked when anSSH_MSG_IGNOREpacket is received- Parameters:
session- TheSessionthrough which the message was receivedbuffer- TheBuffercontaining the data- Throws:
java.lang.Exception- If failed to handle the message- See Also:
- RFC 4253 - section 11.2
-
handleDebugMessage
default void handleDebugMessage(Session session, Buffer buffer) throws java.lang.Exception
Invoked when anSSH_MSG_DEBUGpacket is received- Parameters:
session- TheSessionthrough which the message was receivedbuffer- TheBuffercontaining the data- Throws:
java.lang.Exception- If failed to handle the message- See Also:
- RFC 4253 - section 11.3
-
handleUnimplementedMessage
default boolean handleUnimplementedMessage(Session session, int cmd, Buffer buffer) throws java.lang.Exception
Invoked when a packet with an un-implemented message is received - includingSSH_MSG_UNIMPLEMENTEDitself- Parameters:
session- TheSessionthrough which the message was receivedcmd- The received (un-implemented) commandbuffer- TheBuffercontaining the data - positioned just beyond the command- Returns:
trueif message handled internally,falseif should return aSSH_MSG_UNIMPLEMENTEDreply (default behavior)- Throws:
java.lang.Exception- If failed to handle the message- See Also:
- RFC 4253 - section 11.4
-
sendReservedHeartbeat
default boolean sendReservedHeartbeat(ConnectionService service) throws java.lang.Exception
Invoked if the user configured usage of a proprietary heartbeat mechanism. Note: by default throwsUnsupportedOperationExceptionso users who configure a proprietary heartbeat mechanism option must provide an implementation for this method.- Parameters:
service- TheConnectionServicethrough which the heartbeat is being executed.- Returns:
truewhether heartbeat actually sent - Note: used mainly for debugging purposes.- Throws:
java.lang.Exception- If failed to send the heartbeat - Note: causes associated session termination.
-
-