Package org.apache.qpid.proton.message
Interface Message
- All Known Subinterfaces:
ProtonJMessage
- All Known Implementing Classes:
MessageImpl
public interface Message
Represents a Message within Proton.
Create instances of Message using
Message.Factory
.-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 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.getBody()
long
long
getError()
long
long
short
long
getTtl()
byte[]
boolean
boolean
void
setAddress
(String to) void
setApplicationProperties
(ApplicationProperties applicationProperties) void
void
setContentEncoding
(String contentEncoding) void
setContentType
(String contentType) void
setCorrelationId
(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
void
setGroupId
(String groupId) void
setGroupSequence
(long groupSequence) void
void
setMessageAnnotations
(MessageAnnotations messageAnnotations) void
setMessageId
(Object messageId) void
setPriority
(short priority) void
setProperties
(Properties properties) void
setReplyTo
(String replyTo) void
setReplyToGroupId
(String replyToGroupId) void
setSubject
(String subject) void
setTtl
(long ttl) void
setUserId
(byte[] userId)
-
Field Details
-
DEFAULT_PRIORITY
static final short DEFAULT_PRIORITY- See Also:
-
-
Method Details
-
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
Object getMessageId() -
getGroupSequence
long getGroupSequence() -
getReplyToGroupId
String getReplyToGroupId() -
getCreationTime
long getCreationTime() -
getAddress
String getAddress() -
getUserId
byte[] getUserId() -
getReplyTo
String getReplyTo() -
getGroupId
String getGroupId() -
getContentType
String getContentType() -
getExpiryTime
long getExpiryTime() -
getCorrelationId
Object getCorrelationId() -
getContentEncoding
String getContentEncoding() -
getSubject
String getSubject() -
setGroupSequence
void setGroupSequence(long groupSequence) -
setUserId
void setUserId(byte[] userId) -
setCreationTime
void setCreationTime(long creationTime) -
setSubject
-
setGroupId
-
setAddress
-
setExpiryTime
void setExpiryTime(long absoluteExpiryTime) -
setReplyToGroupId
-
setContentEncoding
-
setContentType
-
setReplyTo
-
setCorrelationId
-
setMessageId
-
getHeader
Header getHeader() -
getDeliveryAnnotations
DeliveryAnnotations getDeliveryAnnotations() -
getMessageAnnotations
MessageAnnotations getMessageAnnotations() -
getProperties
Properties getProperties() -
getApplicationProperties
ApplicationProperties getApplicationProperties() -
getBody
Section getBody() -
setHeader
-
setDeliveryAnnotations
-
setMessageAnnotations
-
setProperties
-
setApplicationProperties
-
setBody
-
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
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
- AReadableBuffer
that contains the complete message bytes.
-
encode
int encode(byte[] data, int offset, int length) 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?- Returns:
- the number of bytes written to the byte array
-
encode
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.- Parameters:
buffer
- TheWritableBuffer
instance to encode the message contents into.- Returns:
- the number of bytes written to fully encode the message.
-
clear
void clear() -
getError
MessageError getError()
-