Class AMQPHeader

  • public final class AMQPHeader
    extends java.lang.Object
    Represents the AMQP protocol handshake packet that is sent during the initial exchange with a remote peer.
    • Constructor Detail

      • AMQPHeader

        public AMQPHeader()
      • AMQPHeader

        public AMQPHeader​(byte[] headerBytes)
      • AMQPHeader

        public AMQPHeader​(ProtonBuffer buffer,
                          boolean validate)
    • Method Detail

      • getAMQPHeader

        public static AMQPHeader getAMQPHeader()
      • getSASLHeader

        public static AMQPHeader getSASLHeader()
      • getProtocolId

        public int getProtocolId()
      • getMajor

        public int getMajor()
      • getMinor

        public int getMinor()
      • getRevision

        public int getRevision()
      • toArray

        public byte[] toArray()
      • toByteBuffer

        public java.nio.ByteBuffer toByteBuffer()
      • getByteAt

        public byte getByteAt​(int i)
      • hasValidPrefix

        public boolean hasValidPrefix()
      • isSaslHeader

        public boolean isSaslHeader()
      • hashCode

        public int hashCode()
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • validateByte

        public static void validateByte​(int index,
                                        byte value)
        Called to validate a byte according to a given index within the AMQP Header If the index is outside the range of the header size an IndexOutOfBoundsException will be thrown.
        index - The index in the header where the byte should be validated.
        value - The value to check validity of in the given index in the AMQP Header.
        java.lang.IllegalArgumentException - if the value is not valid for the index given in the AMQP header
        java.lang.IndexOutOfBoundsException - if the index value is greater than the AMQP header size.
      • invoke

        public <E> void invoke​(AMQPHeader.HeaderHandler<E> handler,
                               E context)
        Provide this AMQP Header with a handler that will process the given AMQP header depending on the protocol type the correct handler method is invoked.
        Type Parameters:
        E - The type that will be passed as the context for this event
        handler - The AMQPHeader.HeaderHandler instance to use to process the header.
        context - A context object to pass along with the header.