Package org.apache.qpid.proton.message
Interface Message
-
- All Known Subinterfaces:
ProtonJMessage
- All Known Implementing Classes:
MessageImpl
public interface MessageRepresents a Message within Proton. Create instances of Message usingMessage.Factory.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classMessage.Factory
-
Field Summary
Fields Modifier and Type Field Description static shortDEFAULT_PRIORITY
-
Method Summary
All Methods Instance Methods Abstract 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(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.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)
-
-
-
Field Detail
-
DEFAULT_PRIORITY
static final short DEFAULT_PRIORITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
isDurable
boolean isDurable()
-
getDeliveryCount
long getDeliveryCount()
-
getPriority
short getPriority()
-
isFirstAcquirer
boolean isFirstAcquirer()
-
getTtl
long getTtl()
-
setDurable
void setDurable(boolean durable)
-
setTtl
void setTtl(long ttl)
-
setDeliveryCount
void setDeliveryCount(long deliveryCount)
-
setFirstAcquirer
void setFirstAcquirer(boolean firstAcquirer)
-
setPriority
void setPriority(short priority)
-
getMessageId
java.lang.Object getMessageId()
-
getGroupSequence
long getGroupSequence()
-
getReplyToGroupId
java.lang.String getReplyToGroupId()
-
getCreationTime
long getCreationTime()
-
getAddress
java.lang.String getAddress()
-
getUserId
byte[] getUserId()
-
getReplyTo
java.lang.String getReplyTo()
-
getGroupId
java.lang.String getGroupId()
-
getContentType
java.lang.String getContentType()
-
getExpiryTime
long getExpiryTime()
-
getCorrelationId
java.lang.Object getCorrelationId()
-
getContentEncoding
java.lang.String getContentEncoding()
-
getSubject
java.lang.String getSubject()
-
setGroupSequence
void setGroupSequence(long groupSequence)
-
setUserId
void setUserId(byte[] userId)
-
setCreationTime
void setCreationTime(long creationTime)
-
setSubject
void setSubject(java.lang.String subject)
-
setGroupId
void setGroupId(java.lang.String groupId)
-
setAddress
void setAddress(java.lang.String to)
-
setExpiryTime
void setExpiryTime(long absoluteExpiryTime)
-
setReplyToGroupId
void setReplyToGroupId(java.lang.String replyToGroupId)
-
setContentEncoding
void setContentEncoding(java.lang.String contentEncoding)
-
setContentType
void setContentType(java.lang.String contentType)
-
setReplyTo
void setReplyTo(java.lang.String replyTo)
-
setCorrelationId
void setCorrelationId(java.lang.Object correlationId)
-
setMessageId
void setMessageId(java.lang.Object messageId)
-
getHeader
Header getHeader()
-
getDeliveryAnnotations
DeliveryAnnotations getDeliveryAnnotations()
-
getMessageAnnotations
MessageAnnotations getMessageAnnotations()
-
getProperties
Properties getProperties()
-
getApplicationProperties
ApplicationProperties getApplicationProperties()
-
getBody
Section getBody()
-
getFooter
Footer getFooter()
-
setHeader
void setHeader(Header header)
-
setDeliveryAnnotations
void setDeliveryAnnotations(DeliveryAnnotations deliveryAnnotations)
-
setMessageAnnotations
void setMessageAnnotations(MessageAnnotations messageAnnotations)
-
setProperties
void setProperties(Properties properties)
-
setApplicationProperties
void setApplicationProperties(ApplicationProperties applicationProperties)
-
setBody
void setBody(Section body)
-
setFooter
void setFooter(Footer footer)
-
decode
int decode(byte[] data, int offset, int length)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
void decode(ReadableBuffer buffer)
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.
- Parameters:
buffer- AReadableBufferthat contains the complete message bytes.
-
encode
int encode(byte[] data, int offset, int length)Encodes 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?- Returns:
- the number of bytes written to the byte array
-
encode
int encode(WritableBuffer buffer)
Encodes 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.- Parameters:
buffer- TheWritableBufferinstance to encode the message contents into.- Returns:
- the number of bytes written to fully encode the message.
-
clear
void clear()
-
getError
MessageError getError()
-
-