Package org.apache.qpid.protonj2.engine
Class HeaderEnvelope
java.lang.Object
org.apache.qpid.protonj2.engine.PerformativeEnvelope<AMQPHeader>
org.apache.qpid.protonj2.engine.HeaderEnvelope
Envelope type that carries AMQPHeader instances
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HeaderEnvelopeA singleton instance of an AMQP header that can be used to avoid additional allocations.static final byteThe frame type marker used when decoding or encoding AMQP Header frames.static final HeaderEnvelopeA singleton instance of an SASL header that can be used to avoid additional allocations. -
Constructor Summary
ConstructorsConstructorDescriptionHeaderEnvelope(AMQPHeader body) Create an header envelope with the given AMQHeader body. -
Method Summary
Modifier and TypeMethodDescriptionintgetMajor()intgetMinor()intint<E> voidinvoke(AMQPHeader.HeaderHandler<E> handler, E context) Invoke the correct handler based on whether this header is a SASL or AMQP header instance.booleanMethods inherited from class org.apache.qpid.protonj2.engine.PerformativeEnvelope
getBody, getChannel, getFrameType, getPayload, toString
-
Field Details
-
HEADER_FRAME_TYPE
public static final byte HEADER_FRAME_TYPEThe frame type marker used when decoding or encoding AMQP Header frames.- See Also:
-
SASL_HEADER_ENVELOPE
A singleton instance of an SASL header that can be used to avoid additional allocations. -
AMQP_HEADER_ENVELOPE
A singleton instance of an AMQP header that can be used to avoid additional allocations.
-
-
Constructor Details
-
HeaderEnvelope
Create an header envelope with the given AMQHeader body.- Parameters:
body- The AMQP header instance that holds the header bytes.
-
-
Method Details
-
getProtocolId
public int getProtocolId()- Returns:
- the protocol id value contained in the header bytes.
-
getMajor
public int getMajor()- Returns:
- the major version number contained in the header bytes.
-
getMinor
public int getMinor()- Returns:
- the minor version number contained in the header bytes.
-
getRevision
public int getRevision()- Returns:
- the revision version number contained in the header bytes.
-
isSaslHeader
public boolean isSaslHeader()- Returns:
- true if the contained header bytes represents a SASL header.
-
invoke
Invoke the correct handler based on whether this header is a SASL or AMQP header instance.- Type Parameters:
E- The type of the context object that accompanies the invocation.- Parameters:
handler- TheAMQPHeader.HeaderHandlerthat should be invoked based on the header type.context- The context value to provide when signaling the header handler.
-