Class ProtocolHeader

  • All Implemented Interfaces:
    Writable

    public class ProtocolHeader
    extends java.lang.Object
    implements Writable
    Protocol header for AMQP and SASL version negotiation.
    Author:
    IIT Software GmbH, Bremen/Germany, (c) 2011, All Rights Reserved
    • Constructor Summary

      Constructors 
      Constructor Description
      ProtocolHeader()
      Constructs an empty ProtocolHeader to read it from a stream by readContent().
      ProtocolHeader​(java.lang.String name, int id, int major, int minor, int revision)
      Constructs a ProtocolHeader
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      AsyncCompletionCallback getCallback()
      Alternatively returns a callback which is triggered after writeContent has been called.
      int getId()
      Returns the protocol id.
      int getMajor()
      Return the major version.
      int getMinor()
      Returns the minor version.
      java.lang.String getName()
      Returns the protocol name.
      int getRevision()
      Returns the revision.
      Semaphore getSemaphore()
      Returns an optional semaphore which is triggered after writeContent has been called.
      void readContent​(java.io.DataInput in)  
      java.lang.String toString()  
      void writeContent​(java.io.DataOutput out)
      Write the content of this object to a DataOutput
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ProtocolHeader

        public ProtocolHeader​(java.lang.String name,
                              int id,
                              int major,
                              int minor,
                              int revision)
        Constructs a ProtocolHeader
        Parameters:
        name - Must be "AMQP"
        id - Protocol Id
        major - Protocol major version
        minor - Protocol minor version
        revision - Protocol revision
      • ProtocolHeader

        public ProtocolHeader()
        Constructs an empty ProtocolHeader to read it from a stream by readContent().
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the protocol name.
        Returns:
        protocol name
      • getId

        public int getId()
        Returns the protocol id.
        Returns:
        protocol id
      • getMajor

        public int getMajor()
        Return the major version.
        Returns:
        major version
      • getMinor

        public int getMinor()
        Returns the minor version.
        Returns:
        minor version
      • getRevision

        public int getRevision()
        Returns the revision.
        Returns:
        revision
      • getSemaphore

        public Semaphore getSemaphore()
        Description copied from interface: Writable
        Returns an optional semaphore which is triggered after writeContent has been called. Can be used to ensure an object has been written to a stream until processing continues.
        Specified by:
        getSemaphore in interface Writable
        Returns:
        Semaphore
      • getCallback

        public AsyncCompletionCallback getCallback()
        Description copied from interface: Writable
        Alternatively returns a callback which is triggered after writeContent has been called. Can be used to ensure an object has been written to a stream until processing continues.
        Specified by:
        getCallback in interface Writable
        Returns:
        callback
      • readContent

        public void readContent​(java.io.DataInput in)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • writeContent

        public void writeContent​(java.io.DataOutput out)
                          throws java.io.IOException
        Description copied from interface: Writable
        Write the content of this object to a DataOutput
        Specified by:
        writeContent in interface Writable
        Parameters:
        out - DataOutput
        Throws:
        java.io.IOException - on error
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object