Class ProtonFrameDecodingHandler
java.lang.Object
org.apache.qpid.protonj2.engine.impl.ProtonFrameDecodingHandler
- All Implemented Interfaces:
EngineHandler
,SaslPerformative.SaslPerformativeHandler<EngineHandlerContext>
public class ProtonFrameDecodingHandler
extends Object
implements EngineHandler, SaslPerformative.SaslPerformativeHandler<EngineHandlerContext>
Handler used to parse incoming frame data input into the engine
-
Field Summary
Modifier and TypeFieldDescriptionstatic final byte
Frame type indicator for AMQP protocol frames.static final int
The specified encoding size for the frame size value of each encoded frame.static final byte
Frame type indicator for SASL protocol frames. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
engineFailed
(EngineHandlerContext context, EngineFailedException failure) Called when the engine has transitioned to a failed state and cannot process any additional input or output.void
handleOutcome
(SaslOutcome saslOutcome, EngineHandlerContext context) void
handlerAdded
(EngineHandlerContext context) Called when the handler is successfully added to theEnginePipeline
and will later be initialized before use.void
handleRead
(EngineHandlerContext context, ProtonBuffer buffer) Handle the read of new incoming bytes from a remote sender.void
handleRead
(EngineHandlerContext context, SASLEnvelope envelope) Handle the receipt of an incoming SASL performative based on the current state of this handler.void
handleWrite
(EngineHandlerContext context, SASLEnvelope envelope) Handles write of SaslPerformative either by directly writing it to the output target or by converting it to bytes and firing a write using theProtonBuffer
based API inEngineHandlerContext.fireWrite(ProtonBuffer, Runnable)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.qpid.protonj2.engine.EngineHandler
engineStarting, handleEngineStateChanged, handleRead, handleRead, handlerRemoved, handleWrite, handleWrite, handleWrite
Methods inherited from interface org.apache.qpid.protonj2.types.security.SaslPerformative.SaslPerformativeHandler
handleChallenge, handleInit, handleMechanisms, handleResponse
-
Field Details
-
AMQP_FRAME_TYPE
public static final byte AMQP_FRAME_TYPEFrame type indicator for AMQP protocol frames.- See Also:
-
SASL_FRAME_TYPE
public static final byte SASL_FRAME_TYPEFrame type indicator for SASL protocol frames.- See Also:
-
FRAME_SIZE_BYTES
public static final int FRAME_SIZE_BYTESThe specified encoding size for the frame size value of each encoded frame.- See Also:
-
-
Constructor Details
-
ProtonFrameDecodingHandler
public ProtonFrameDecodingHandler()
-
-
Method Details
-
handlerAdded
Description copied from interface:EngineHandler
Called when the handler is successfully added to theEnginePipeline
and will later be initialized before use.- Specified by:
handlerAdded
in interfaceEngineHandler
- Parameters:
context
- The context that is assigned to this handler.
-
engineFailed
Description copied from interface:EngineHandler
Called when the engine has transitioned to a failed state and cannot process any additional input or output. The handler can free and resources used for normal operations at this point as the engine is now considered shutdown.- Specified by:
engineFailed
in interfaceEngineHandler
- Parameters:
context
- The context for this handler which can be used to forward the event to the next handlerfailure
- The failure that triggered the engine to cease operations.
-
handleRead
Description copied from interface:EngineHandler
Handle the read of new incoming bytes from a remote sender. The handler should generally decode these bytes into an AMQP Performative or SASL Performative based on the current state of the connection and the handler in question.- Specified by:
handleRead
in interfaceEngineHandler
- Parameters:
context
- The context for this handler which can be used to forward the event to the next handlerbuffer
- The buffer containing the bytes that the engine handler should decode.
-
handleRead
Description copied from interface:EngineHandler
Handle the receipt of an incoming SASL performative based on the current state of this handler.- Specified by:
handleRead
in interfaceEngineHandler
- Parameters:
context
- The context for this handler which can be used to forward the event to the next handlerenvelope
- The SASL envelope that wraps the receivedSaslPerformative
.
-
handleWrite
Description copied from interface:EngineHandler
Handles write of SaslPerformative either by directly writing it to the output target or by converting it to bytes and firing a write using theProtonBuffer
based API inEngineHandlerContext.fireWrite(ProtonBuffer, Runnable)
- Specified by:
handleWrite
in interfaceEngineHandler
- Parameters:
context
- TheEngineHandlerContext
associated with thisEngineHandler
instance.envelope
- TheSASLEnvelope
instance to write.
-
handleOutcome
- Specified by:
handleOutcome
in interfaceSaslPerformative.SaslPerformativeHandler<EngineHandlerContext>
-