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
Modifier and TypeFieldDescriptionstatic final HeaderEnvelope
A singleton instance of an AMQP header that can be used to avoid additional allocations.static final byte
The frame type marker used when decoding or encoding AMQP Header frames.static final HeaderEnvelope
A singleton instance of an SASL header that can be used to avoid additional allocations. -
Constructor Summary
ConstructorDescriptionHeaderEnvelope
(AMQPHeader body) Create an header envelope with the given AMQHeader body. -
Method Summary
Modifier and TypeMethodDescriptionint
getMajor()
int
getMinor()
int
int
<E> void
invoke
(AMQPHeader.HeaderHandler<E> handler, E context) Invoke the correct handler based on whether this header is a SASL or AMQP header instance.boolean
Methods 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.HeaderHandler
that should be invoked based on the header type.context
- The context value to provide when signaling the header handler.
-