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 voidclear()intdecode(byte[] data, int offset, int length)TODO describe what happens if the data does not represent a complete message.voiddecode(java.nio.ByteBuffer buffer)voiddecode(ReadableBuffer buffer)Decodes the Message from the givenReadableBuffer.intencode(byte[] data, int offset, int length)Encodes up tolengthbytes of the message into the provided byte array, starting at positionoffset.intencode(WritableBuffer buffer)Encodes the current Message contents into the givenWritableBufferinstance.intencode2(byte[] data, int offset, int length)java.lang.StringgetAddress()ApplicationPropertiesgetApplicationProperties()SectiongetBody()java.lang.StringgetContentEncoding()java.lang.StringgetContentType()java.lang.ObjectgetCorrelationId()longgetCreationTime()DeliveryAnnotationsgetDeliveryAnnotations()longgetDeliveryCount()MessageErrorgetError()longgetExpiryTime()FootergetFooter()java.lang.StringgetGroupId()longgetGroupSequence()HeadergetHeader()MessageAnnotationsgetMessageAnnotations()java.lang.ObjectgetMessageId()shortgetPriority()PropertiesgetProperties()java.lang.StringgetReplyTo()java.lang.StringgetReplyToGroupId()java.lang.StringgetSubject()longgetTtl()byte[]getUserId()booleanisDurable()booleanisFirstAcquirer()voidsetAddress(java.lang.String to)voidsetApplicationProperties(ApplicationProperties applicationProperties)voidsetBody(Section body)voidsetContentEncoding(java.lang.String contentEncoding)voidsetContentType(java.lang.String contentType)voidsetCorrelationId(java.lang.Object correlationId)voidsetCreationTime(long creationTime)voidsetDeliveryAnnotations(DeliveryAnnotations deliveryAnnotations)voidsetDeliveryCount(long deliveryCount)voidsetDurable(boolean durable)voidsetExpiryTime(long absoluteExpiryTime)voidsetFirstAcquirer(boolean firstAcquirer)voidsetFooter(Footer footer)voidsetGroupId(java.lang.String groupId)voidsetGroupSequence(long groupSequence)voidsetHeader(Header header)voidsetMessageAnnotations(MessageAnnotations messageAnnotations)voidsetMessageId(java.lang.Object messageId)voidsetPriority(short priority)voidsetProperties(Properties properties)voidsetReplyTo(java.lang.String replyTo)voidsetReplyToGroupId(java.lang.String replyToGroupId)voidsetSubject(java.lang.String subject)voidsetTtl(long ttl)voidsetUserId(byte[] userId)java.lang.StringtoString()
-
-
-
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:
getDeliveryCountin interfaceMessage
-
getPriority
public short getPriority()
- Specified by:
getPriorityin interfaceMessage
-
isFirstAcquirer
public boolean isFirstAcquirer()
- Specified by:
isFirstAcquirerin interfaceMessage
-
setDurable
public void setDurable(boolean durable)
- Specified by:
setDurablein interfaceMessage
-
setDeliveryCount
public void setDeliveryCount(long deliveryCount)
- Specified by:
setDeliveryCountin interfaceMessage
-
setFirstAcquirer
public void setFirstAcquirer(boolean firstAcquirer)
- Specified by:
setFirstAcquirerin interfaceMessage
-
setPriority
public void setPriority(short priority)
- Specified by:
setPriorityin interfaceMessage
-
getMessageId
public java.lang.Object getMessageId()
- Specified by:
getMessageIdin interfaceMessage
-
getGroupSequence
public long getGroupSequence()
- Specified by:
getGroupSequencein interfaceMessage
-
getReplyToGroupId
public java.lang.String getReplyToGroupId()
- Specified by:
getReplyToGroupIdin interfaceMessage
-
getCreationTime
public long getCreationTime()
- Specified by:
getCreationTimein interfaceMessage
-
getAddress
public java.lang.String getAddress()
- Specified by:
getAddressin interfaceMessage
-
getReplyTo
public java.lang.String getReplyTo()
- Specified by:
getReplyToin interfaceMessage
-
getGroupId
public java.lang.String getGroupId()
- Specified by:
getGroupIdin interfaceMessage
-
getContentType
public java.lang.String getContentType()
- Specified by:
getContentTypein interfaceMessage
-
getExpiryTime
public long getExpiryTime()
- Specified by:
getExpiryTimein interfaceMessage
-
getCorrelationId
public java.lang.Object getCorrelationId()
- Specified by:
getCorrelationIdin interfaceMessage
-
getContentEncoding
public java.lang.String getContentEncoding()
- Specified by:
getContentEncodingin interfaceMessage
-
getSubject
public java.lang.String getSubject()
- Specified by:
getSubjectin interfaceMessage
-
setGroupSequence
public void setGroupSequence(long groupSequence)
- Specified by:
setGroupSequencein interfaceMessage
-
setCreationTime
public void setCreationTime(long creationTime)
- Specified by:
setCreationTimein interfaceMessage
-
setSubject
public void setSubject(java.lang.String subject)
- Specified by:
setSubjectin interfaceMessage
-
setGroupId
public void setGroupId(java.lang.String groupId)
- Specified by:
setGroupIdin interfaceMessage
-
setAddress
public void setAddress(java.lang.String to)
- Specified by:
setAddressin interfaceMessage
-
setExpiryTime
public void setExpiryTime(long absoluteExpiryTime)
- Specified by:
setExpiryTimein interfaceMessage
-
setReplyToGroupId
public void setReplyToGroupId(java.lang.String replyToGroupId)
- Specified by:
setReplyToGroupIdin interfaceMessage
-
setContentEncoding
public void setContentEncoding(java.lang.String contentEncoding)
- Specified by:
setContentEncodingin interfaceMessage
-
setContentType
public void setContentType(java.lang.String contentType)
- Specified by:
setContentTypein interfaceMessage
-
setReplyTo
public void setReplyTo(java.lang.String replyTo)
- Specified by:
setReplyToin interfaceMessage
-
setCorrelationId
public void setCorrelationId(java.lang.Object correlationId)
- Specified by:
setCorrelationIdin interfaceMessage
-
setMessageId
public void setMessageId(java.lang.Object messageId)
- Specified by:
setMessageIdin interfaceMessage
-
getDeliveryAnnotations
public DeliveryAnnotations getDeliveryAnnotations()
- Specified by:
getDeliveryAnnotationsin interfaceMessage
-
getMessageAnnotations
public MessageAnnotations getMessageAnnotations()
- Specified by:
getMessageAnnotationsin interfaceMessage
-
getProperties
public Properties getProperties()
- Specified by:
getPropertiesin interfaceMessage
-
getApplicationProperties
public ApplicationProperties getApplicationProperties()
- Specified by:
getApplicationPropertiesin interfaceMessage
-
setDeliveryAnnotations
public void setDeliveryAnnotations(DeliveryAnnotations deliveryAnnotations)
- Specified by:
setDeliveryAnnotationsin interfaceMessage
-
setMessageAnnotations
public void setMessageAnnotations(MessageAnnotations messageAnnotations)
- Specified by:
setMessageAnnotationsin interfaceMessage
-
setProperties
public void setProperties(Properties properties)
- Specified by:
setPropertiesin interfaceMessage
-
setApplicationProperties
public void setApplicationProperties(ApplicationProperties applicationProperties)
- Specified by:
setApplicationPropertiesin interfaceMessage
-
decode
public int decode(byte[] data, int offset, int length)Description copied from interface:MessageTODO 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:MessageDecodes 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:
decodein interfaceMessage- Parameters:
buffer- AReadableBufferthat contains the complete message bytes.
-
encode
public int encode(byte[] data, int offset, int length)Description copied from interface:MessageEncodes up tolengthbytes 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:
encode2in interfaceProtonJMessage
-
encode
public int encode(WritableBuffer buffer)
Description copied from interface:MessageEncodes the current Message contents into the givenWritableBufferinstance.This method attempts to encode all message data into the
WritableBufferand 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:
encodein interfaceMessage- Specified by:
encodein interfaceProtonJMessage- Parameters:
buffer- TheWritableBufferinstance 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:
toStringin classjava.lang.Object
-
-