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
Fields Modifier and Type Field Description static byte
AMQP_FRAME_TYPE
Frame type indicator for AMQP protocol frames.static int
FRAME_SIZE_BYTES
The specified encoding size for the frame size value of each encoded frame.static byte
SASL_FRAME_TYPE
Frame type indicator for SASL protocol frames.
-
Constructor Summary
Constructors Constructor Description ProtonFrameDecodingHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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 Detail
-
AMQP_FRAME_TYPE
public static final byte AMQP_FRAME_TYPE
Frame type indicator for AMQP protocol frames.- See Also:
- Constant Field Values
-
SASL_FRAME_TYPE
public static final byte SASL_FRAME_TYPE
Frame type indicator for SASL protocol frames.- See Also:
- Constant Field Values
-
FRAME_SIZE_BYTES
public static final int FRAME_SIZE_BYTES
The specified encoding size for the frame size value of each encoded frame.- See Also:
- Constant Field Values
-
-
Method Detail
-
handlerAdded
public void handlerAdded(EngineHandlerContext context)
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
public void engineFailed(EngineHandlerContext context, EngineFailedException failure)
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
public void handleRead(EngineHandlerContext context, ProtonBuffer buffer)
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
public void handleRead(EngineHandlerContext context, SASLEnvelope envelope)
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
public void handleWrite(EngineHandlerContext context, SASLEnvelope envelope)
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
public void handleOutcome(SaslOutcome saslOutcome, EngineHandlerContext context)
- Specified by:
handleOutcome
in interfaceSaslPerformative.SaslPerformativeHandler<EngineHandlerContext>
-
-