org.apache.qpid.proton.message
Interface Message


public interface Message

Represents a Message within Proton. Create instances of Message using a MessageFactory implementation.


Field Summary
static short DEFAULT_PRIORITY
           
 
Method Summary
 void clear()
           
 int decode(byte[] data, int offset, int length)
          TODO describe what happens if the data does not represent a complete message.
 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.
 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()
           
 MessageFormat getMessageFormat()
           
 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 load(java.lang.Object data)
          Loads message body from the data.
 java.lang.Object parseAMQPFormat(java.lang.String value)
           
 java.lang.Object save()
          Return the message body in a format determined by getMessageFormat().
 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 setMessageFormat(MessageFormat format)
           
 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 toAMQPFormat(java.lang.Object value)
           
 

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.


encode

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. 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

load

void load(java.lang.Object data)
Loads message body from the data. TODO describe how the object is interpreted according to the MessageFormat.

See Also:
setMessageFormat(MessageFormat)

save

java.lang.Object save()
Return the message body in a format determined by getMessageFormat(). TODO describe the formatting process


toAMQPFormat

java.lang.String toAMQPFormat(java.lang.Object value)

parseAMQPFormat

java.lang.Object parseAMQPFormat(java.lang.String value)

setMessageFormat

void setMessageFormat(MessageFormat format)

getMessageFormat

MessageFormat getMessageFormat()

clear

void clear()

getError

MessageError getError()