public interface Message
Message.Factory
.Modifier and Type | Interface and Description |
---|---|
static class |
Message.Factory |
Modifier and Type | Field and Description |
---|---|
static short |
DEFAULT_PRIORITY |
Modifier and Type | Method and 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(ReadableBuffer buffer)
Decodes the Message from the given
ReadableBuffer . |
int |
encode(byte[] data,
int offset,
int length)
Encodes up to
length bytes of the message into the provided byte array,
starting at position offset . |
int |
encode(WritableBuffer buffer)
Encodes the current Message contents into the given
WritableBuffer instance. |
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) |
static final short DEFAULT_PRIORITY
boolean isDurable()
long getDeliveryCount()
short getPriority()
boolean isFirstAcquirer()
long getTtl()
void setDurable(boolean durable)
void setTtl(long ttl)
void setDeliveryCount(long deliveryCount)
void setFirstAcquirer(boolean firstAcquirer)
void setPriority(short priority)
java.lang.Object getMessageId()
long getGroupSequence()
java.lang.String getReplyToGroupId()
long getCreationTime()
java.lang.String getAddress()
byte[] getUserId()
java.lang.String getReplyTo()
java.lang.String getGroupId()
java.lang.String getContentType()
long getExpiryTime()
java.lang.Object getCorrelationId()
java.lang.String getContentEncoding()
java.lang.String getSubject()
void setGroupSequence(long groupSequence)
void setUserId(byte[] userId)
void setCreationTime(long creationTime)
void setSubject(java.lang.String subject)
void setGroupId(java.lang.String groupId)
void setAddress(java.lang.String to)
void setExpiryTime(long absoluteExpiryTime)
void setReplyToGroupId(java.lang.String replyToGroupId)
void setContentEncoding(java.lang.String contentEncoding)
void setContentType(java.lang.String contentType)
void setReplyTo(java.lang.String replyTo)
void setCorrelationId(java.lang.Object correlationId)
void setMessageId(java.lang.Object messageId)
Header getHeader()
DeliveryAnnotations getDeliveryAnnotations()
MessageAnnotations getMessageAnnotations()
Properties getProperties()
ApplicationProperties getApplicationProperties()
Section getBody()
Footer getFooter()
void setHeader(Header header)
void setDeliveryAnnotations(DeliveryAnnotations deliveryAnnotations)
void setMessageAnnotations(MessageAnnotations messageAnnotations)
void setProperties(Properties properties)
void setApplicationProperties(ApplicationProperties applicationProperties)
void setBody(Section body)
void setFooter(Footer footer)
int decode(byte[] data, int offset, int length)
void decode(ReadableBuffer buffer)
ReadableBuffer
.
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.
buffer
- A ReadableBuffer
that contains the complete message bytes.int encode(byte[] data, int offset, int length)
length
bytes of the message into the provided byte array,
starting at position offset
.
TODO describe what happens if length is smaller than the encoded form, Currently
Proton-J throws an exception. What does Proton-C do?int encode(WritableBuffer buffer)
WritableBuffer
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.
buffer
- The WritableBuffer
instance to encode the message contents into.void clear()
MessageError getError()