Package com.swiftmq.amqp
Class ProtocolHeader
java.lang.Object
com.swiftmq.amqp.ProtocolHeader
- All Implemented Interfaces:
Writable
Protocol header for AMQP and SASL version negotiation.
- Author:
- IIT Software GmbH, Bremen/Germany, (c) 2011, All Rights Reserved
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty ProtocolHeader to read it from a stream by readContent().ProtocolHeader
(String name, int id, int major, int minor, int revision) Constructs a ProtocolHeader -
Method Summary
Modifier and TypeMethodDescriptionboolean
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.getName()
Returns the protocol name.int
Returns the revision.Returns an optional semaphore which is triggered after writeContent has been called.void
readContent
(DataInput in) toString()
void
writeContent
(DataOutput out) Write the content of this object to a DataOutput
-
Constructor Details
-
ProtocolHeader
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 Details
-
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
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
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
- Throws:
IOException
-
writeContent
Description copied from interface:Writable
Write the content of this object to a DataOutput- Specified by:
writeContent
in interfaceWritable
- Parameters:
out
- DataOutput- Throws:
IOException
- on error
-
equals
-
toString
-