Class MessageImpl
- java.lang.Object
-
- org.apache.qpid.proton.message.impl.MessageImpl
-
- All Implemented Interfaces:
Message
,ProtonJMessage
public class MessageImpl extends java.lang.Object implements ProtonJMessage
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.qpid.proton.message.Message
Message.Factory
-
-
Field Summary
-
Fields inherited from interface org.apache.qpid.proton.message.Message
DEFAULT_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description MessageImpl()
Application code should useMessage.Factory.create()
instead.MessageImpl(Header header, DeliveryAnnotations deliveryAnnotations, MessageAnnotations messageAnnotations, Properties properties, ApplicationProperties applicationProperties, Section body, Footer footer)
Application code should instead useMessage.Factory.create(Header, DeliveryAnnotations, MessageAnnotations, Properties, ApplicationProperties, Section, Footer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
int
decode(byte[] data, int offset, int length)
TODO describe what happens if the data does not represent a complete message.void
decode(java.nio.ByteBuffer buffer)
void
decode(ReadableBuffer buffer)
Decodes the Message from the givenReadableBuffer
.int
encode(byte[] data, int offset, int length)
Encodes up tolength
bytes of the message into the provided byte array, starting at positionoffset
.int
encode(WritableBuffer buffer)
Encodes the current Message contents into the givenWritableBuffer
instance.int
encode2(byte[] data, int offset, int length)
java.lang.String
getAddress()
ApplicationProperties
getApplicationProperties()
Section
getBody()
java.lang.String
getContentEncoding()
java.lang.String
getContentType()
java.lang.Object
getCorrelationId()
long
getCreationTime()
DeliveryAnnotations
getDeliveryAnnotations()
long
getDeliveryCount()
MessageError
getError()
long
getExpiryTime()
Footer
getFooter()
java.lang.String
getGroupId()
long
getGroupSequence()
Header
getHeader()
MessageAnnotations
getMessageAnnotations()
java.lang.Object
getMessageId()
short
getPriority()
Properties
getProperties()
java.lang.String
getReplyTo()
java.lang.String
getReplyToGroupId()
java.lang.String
getSubject()
long
getTtl()
byte[]
getUserId()
boolean
isDurable()
boolean
isFirstAcquirer()
void
setAddress(java.lang.String to)
void
setApplicationProperties(ApplicationProperties applicationProperties)
void
setBody(Section body)
void
setContentEncoding(java.lang.String contentEncoding)
void
setContentType(java.lang.String contentType)
void
setCorrelationId(java.lang.Object correlationId)
void
setCreationTime(long creationTime)
void
setDeliveryAnnotations(DeliveryAnnotations deliveryAnnotations)
void
setDeliveryCount(long deliveryCount)
void
setDurable(boolean durable)
void
setExpiryTime(long absoluteExpiryTime)
void
setFirstAcquirer(boolean firstAcquirer)
void
setFooter(Footer footer)
void
setGroupId(java.lang.String groupId)
void
setGroupSequence(long groupSequence)
void
setHeader(Header header)
void
setMessageAnnotations(MessageAnnotations messageAnnotations)
void
setMessageId(java.lang.Object messageId)
void
setPriority(short priority)
void
setProperties(Properties properties)
void
setReplyTo(java.lang.String replyTo)
void
setReplyToGroupId(java.lang.String replyToGroupId)
void
setSubject(java.lang.String subject)
void
setTtl(long ttl)
void
setUserId(byte[] userId)
java.lang.String
toString()
-
-
-
Constructor Detail
-
MessageImpl
public MessageImpl()
Application code should useMessage.Factory.create()
instead.
-
MessageImpl
public MessageImpl(Header header, DeliveryAnnotations deliveryAnnotations, MessageAnnotations messageAnnotations, Properties properties, ApplicationProperties applicationProperties, Section body, Footer footer)
Application code should instead useMessage.Factory.create(Header, DeliveryAnnotations, MessageAnnotations, Properties, ApplicationProperties, Section, Footer)
-
-
Method Detail
-
getDeliveryCount
public long getDeliveryCount()
- Specified by:
getDeliveryCount
in interfaceMessage
-
getPriority
public short getPriority()
- Specified by:
getPriority
in interfaceMessage
-
isFirstAcquirer
public boolean isFirstAcquirer()
- Specified by:
isFirstAcquirer
in interfaceMessage
-
setDurable
public void setDurable(boolean durable)
- Specified by:
setDurable
in interfaceMessage
-
setDeliveryCount
public void setDeliveryCount(long deliveryCount)
- Specified by:
setDeliveryCount
in interfaceMessage
-
setFirstAcquirer
public void setFirstAcquirer(boolean firstAcquirer)
- Specified by:
setFirstAcquirer
in interfaceMessage
-
setPriority
public void setPriority(short priority)
- Specified by:
setPriority
in interfaceMessage
-
getMessageId
public java.lang.Object getMessageId()
- Specified by:
getMessageId
in interfaceMessage
-
getGroupSequence
public long getGroupSequence()
- Specified by:
getGroupSequence
in interfaceMessage
-
getReplyToGroupId
public java.lang.String getReplyToGroupId()
- Specified by:
getReplyToGroupId
in interfaceMessage
-
getCreationTime
public long getCreationTime()
- Specified by:
getCreationTime
in interfaceMessage
-
getAddress
public java.lang.String getAddress()
- Specified by:
getAddress
in interfaceMessage
-
getReplyTo
public java.lang.String getReplyTo()
- Specified by:
getReplyTo
in interfaceMessage
-
getGroupId
public java.lang.String getGroupId()
- Specified by:
getGroupId
in interfaceMessage
-
getContentType
public java.lang.String getContentType()
- Specified by:
getContentType
in interfaceMessage
-
getExpiryTime
public long getExpiryTime()
- Specified by:
getExpiryTime
in interfaceMessage
-
getCorrelationId
public java.lang.Object getCorrelationId()
- Specified by:
getCorrelationId
in interfaceMessage
-
getContentEncoding
public java.lang.String getContentEncoding()
- Specified by:
getContentEncoding
in interfaceMessage
-
getSubject
public java.lang.String getSubject()
- Specified by:
getSubject
in interfaceMessage
-
setGroupSequence
public void setGroupSequence(long groupSequence)
- Specified by:
setGroupSequence
in interfaceMessage
-
setCreationTime
public void setCreationTime(long creationTime)
- Specified by:
setCreationTime
in interfaceMessage
-
setSubject
public void setSubject(java.lang.String subject)
- Specified by:
setSubject
in interfaceMessage
-
setGroupId
public void setGroupId(java.lang.String groupId)
- Specified by:
setGroupId
in interfaceMessage
-
setAddress
public void setAddress(java.lang.String to)
- Specified by:
setAddress
in interfaceMessage
-
setExpiryTime
public void setExpiryTime(long absoluteExpiryTime)
- Specified by:
setExpiryTime
in interfaceMessage
-
setReplyToGroupId
public void setReplyToGroupId(java.lang.String replyToGroupId)
- Specified by:
setReplyToGroupId
in interfaceMessage
-
setContentEncoding
public void setContentEncoding(java.lang.String contentEncoding)
- Specified by:
setContentEncoding
in interfaceMessage
-
setContentType
public void setContentType(java.lang.String contentType)
- Specified by:
setContentType
in interfaceMessage
-
setReplyTo
public void setReplyTo(java.lang.String replyTo)
- Specified by:
setReplyTo
in interfaceMessage
-
setCorrelationId
public void setCorrelationId(java.lang.Object correlationId)
- Specified by:
setCorrelationId
in interfaceMessage
-
setMessageId
public void setMessageId(java.lang.Object messageId)
- Specified by:
setMessageId
in interfaceMessage
-
getDeliveryAnnotations
public DeliveryAnnotations getDeliveryAnnotations()
- Specified by:
getDeliveryAnnotations
in interfaceMessage
-
getMessageAnnotations
public MessageAnnotations getMessageAnnotations()
- Specified by:
getMessageAnnotations
in interfaceMessage
-
getProperties
public Properties getProperties()
- Specified by:
getProperties
in interfaceMessage
-
getApplicationProperties
public ApplicationProperties getApplicationProperties()
- Specified by:
getApplicationProperties
in interfaceMessage
-
setDeliveryAnnotations
public void setDeliveryAnnotations(DeliveryAnnotations deliveryAnnotations)
- Specified by:
setDeliveryAnnotations
in interfaceMessage
-
setMessageAnnotations
public void setMessageAnnotations(MessageAnnotations messageAnnotations)
- Specified by:
setMessageAnnotations
in interfaceMessage
-
setProperties
public void setProperties(Properties properties)
- Specified by:
setProperties
in interfaceMessage
-
setApplicationProperties
public void setApplicationProperties(ApplicationProperties applicationProperties)
- Specified by:
setApplicationProperties
in interfaceMessage
-
decode
public int decode(byte[] data, int offset, int length)
Description copied from interface:Message
TODO describe what happens if the data does not represent a complete message. Currently this appears to leave the message in an unknown state.
-
decode
public void decode(java.nio.ByteBuffer buffer)
-
decode
public void decode(ReadableBuffer buffer)
Description copied from interface:Message
Decodes the Message from the givenReadableBuffer
.If the buffer given does not contain the fully encoded Message bytes for decode this method will throw an exception to indicate the buffer underflow condition and the message object will be left in an undefined state.
- Specified by:
decode
in interfaceMessage
- Parameters:
buffer
- AReadableBuffer
that contains the complete message bytes.
-
encode
public int encode(byte[] data, int offset, int length)
Description copied from interface:Message
Encodes up tolength
bytes of the message into the provided byte array, starting at positionoffset
. TODO describe what happens if length is smaller than the encoded form, Currently Proton-J throws an exception. What does Proton-C do?
-
encode2
public int encode2(byte[] data, int offset, int length)
- Specified by:
encode2
in interfaceProtonJMessage
-
encode
public int encode(WritableBuffer buffer)
Description copied from interface:Message
Encodes the current Message contents into the givenWritableBuffer
instance.This method attempts to encode all message data into the
WritableBuffer
and if the buffer has insufficient space it will throw an exception to indicate the buffer overflow condition. If successful the method returns the number of bytes written to the provided buffer to fully encode the message.- Specified by:
encode
in interfaceMessage
- Specified by:
encode
in interfaceProtonJMessage
- Parameters:
buffer
- TheWritableBuffer
instance to encode the message contents into.- Returns:
- the number of bytes written to fully encode the message.
-
getError
public MessageError getError()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-