Class ProtocolHeader

java.lang.Object
com.swiftmq.amqp.ProtocolHeader
All Implemented Interfaces:
Writable

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

    • ProtocolHeader

      public ProtocolHeader(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 Details

    • getName

      public 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(DataInput in) throws IOException
      Throws:
      IOException
    • writeContent

      public void writeContent(DataOutput out) throws 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:
      IOException - on error
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object