Class HeaderEnvelope


public class HeaderEnvelope extends PerformativeEnvelope<AMQPHeader>
Envelope type that carries AMQPHeader instances
  • Field Details

    • HEADER_FRAME_TYPE

      public static final byte HEADER_FRAME_TYPE
      The frame type marker used when decoding or encoding AMQP Header frames.
      See Also:
    • 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 Details

    • 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 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

      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 - The AMQPHeader.HeaderHandler that should be invoked based on the header type.
      context - The context value to provide when signaling the header handler.