Package com.swiftmq.amqp
Class ProtocolHeader
- java.lang.Object
-
- com.swiftmq.amqp.ProtocolHeader
-
-
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
-
-
-
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 Idmajor
- Protocol major versionminor
- Protocol minor versionrevision
- 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 interfaceWritable
- 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 interfaceWritable
- 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 interfaceWritable
- Parameters:
out
- DataOutput- Throws:
java.io.IOException
- on error
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-