Package org.apache.qpid.protonj2.engine
Class HeaderEnvelope
- java.lang.Object
-
- org.apache.qpid.protonj2.engine.PerformativeEnvelope<AMQPHeader>
-
- org.apache.qpid.protonj2.engine.HeaderEnvelope
-
public class HeaderEnvelope extends PerformativeEnvelope<AMQPHeader>
Envelope type that carries AMQPHeader instances
-
-
Field Summary
Fields Modifier and Type Field Description static HeaderEnvelope
AMQP_HEADER_ENVELOPE
A singleton instance of an AMQP header that can be used to avoid additional allocations.static byte
HEADER_FRAME_TYPE
The frame type marker used when decoding or encoding AMQP Header frames.static HeaderEnvelope
SASL_HEADER_ENVELOPE
A singleton instance of an SASL header that can be used to avoid additional allocations.
-
Constructor Summary
Constructors Constructor Description HeaderEnvelope(AMQPHeader body)
Create an header envelope with the given AMQHeader body.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getMajor()
int
getMinor()
int
getProtocolId()
int
getRevision()
<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
isSaslHeader()
-
Methods inherited from class org.apache.qpid.protonj2.engine.PerformativeEnvelope
getBody, getChannel, getFrameType, getPayload, toString
-
-
-
-
Field Detail
-
HEADER_FRAME_TYPE
public static final byte HEADER_FRAME_TYPE
The frame type marker used when decoding or encoding AMQP Header frames.- See Also:
- Constant Field Values
-
SASL_HEADER_ENVELOPE
public static final HeaderEnvelope SASL_HEADER_ENVELOPE
A singleton instance of an SASL header that can be used to avoid additional allocations.
-
AMQP_HEADER_ENVELOPE
public static final HeaderEnvelope AMQP_HEADER_ENVELOPE
A singleton instance of an AMQP header that can be used to avoid additional allocations.
-
-
Constructor Detail
-
HeaderEnvelope
public HeaderEnvelope(AMQPHeader body)
Create an header envelope with the given AMQHeader body.- Parameters:
body
- The AMQP header instance that holds the header bytes.
-
-
Method Detail
-
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
public <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.- 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.
-
-