Class ProtonSaslHandler
- java.lang.Object
-
- org.apache.qpid.protonj2.engine.impl.sasl.ProtonSaslHandler
-
- All Implemented Interfaces:
EngineHandler
public final class ProtonSaslHandler extends java.lang.Object implements EngineHandler
Base class used for common portions of the SASL processing pipeline.
-
-
Constructor Summary
Constructors Constructor Description ProtonSaslHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
engineStarting(EngineHandlerContext context)
Called when the engine is started to allow handlers to prepare for use based on the configuration state at start of the engine.void
handlerAdded(EngineHandlerContext context)
Called when the handler is successfully added to theEnginePipeline
and will later be initialized before use.void
handleRead(EngineHandlerContext context, HeaderEnvelope header)
Handle the receipt of an incoming AMQP Header or SASL Header based on the current state of this handler.void
handleRead(EngineHandlerContext context, IncomingAMQPEnvelope frame)
Handle the receipt of an incoming AMQP envelope based on the current state of this handler.void
handleRead(EngineHandlerContext context, SASLEnvelope frame)
Handle the receipt of an incoming SASL performative based on the current state of this handler.void
handlerRemoved(EngineHandlerContext context)
Called when the handler is successfully removed to theEnginePipeline
.void
handleWrite(EngineHandlerContext context, HeaderEnvelope frame)
Handles write of AMQPHeader 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)
void
handleWrite(EngineHandlerContext context, OutgoingAMQPEnvelope frame)
Handles write of AMQP performative envelope 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)
void
handleWrite(EngineHandlerContext context, SASLEnvelope frame)
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)
boolean
isDone()
-
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
engineFailed, handleEngineStateChanged, handleRead, handleWrite
-
-
-
-
Method Detail
-
isDone
public boolean isDone()
- Returns:
- true if the SASL exchange has finished (succeed or failed).
-
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.
-
handlerRemoved
public void handlerRemoved(EngineHandlerContext context)
Description copied from interface:EngineHandler
Called when the handler is successfully removed to theEnginePipeline
.- Specified by:
handlerRemoved
in interfaceEngineHandler
- Parameters:
context
- The context that is assigned to this handler.
-
engineStarting
public void engineStarting(EngineHandlerContext context)
Description copied from interface:EngineHandler
Called when the engine is started to allow handlers to prepare for use based on the configuration state at start of the engine. A handler can fail the engine start by throwing an exception.- Specified by:
engineStarting
in interfaceEngineHandler
- Parameters:
context
- The context for this handler which can be used to forward the event to the next handler
-
handleRead
public void handleRead(EngineHandlerContext context, HeaderEnvelope header)
Description copied from interface:EngineHandler
Handle the receipt of an incoming AMQP Header or SASL Header 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 handlerheader
- The AMQP Header envelope that wraps the received header instance.
-
handleRead
public void handleRead(EngineHandlerContext context, SASLEnvelope frame)
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 handlerframe
- The SASL envelope that wraps the receivedSaslPerformative
.
-
handleRead
public void handleRead(EngineHandlerContext context, IncomingAMQPEnvelope frame)
Description copied from interface:EngineHandler
Handle the receipt of an incoming AMQP envelope 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 handlerframe
- The AMQP envelope that wraps the receivedPerformative
.
-
handleWrite
public void handleWrite(EngineHandlerContext context, HeaderEnvelope frame)
Description copied from interface:EngineHandler
Handles write of AMQPHeader 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.frame
- TheHeaderEnvelope
instance to write.
-
handleWrite
public void handleWrite(EngineHandlerContext context, OutgoingAMQPEnvelope frame)
Description copied from interface:EngineHandler
Handles write of AMQP performative envelope 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.frame
- TheOutgoingAMQPEnvelope
instance to write.
-
handleWrite
public void handleWrite(EngineHandlerContext context, SASLEnvelope frame)
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.frame
- TheSASLEnvelope
instance to write.
-
-