Class MessageImpl
java.lang.Object
org.apache.qpid.proton.message.impl.MessageImpl
- All Implemented Interfaces:
Message
,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
ConstructorsConstructorDescriptionApplication 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
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
(ByteBuffer buffer) 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.int
encode2
(byte[] data, int offset, int length) 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) toString()
-
Constructor Details
-
MessageImpl
public MessageImpl()Application code should useMessage.Factory.create()
instead.
-
-
Method Details
-
isDurable
public boolean isDurable() -
getDeliveryCount
public long getDeliveryCount()- Specified by:
getDeliveryCount
in interfaceMessage
-
getPriority
public short getPriority()- Specified by:
getPriority
in interfaceMessage
-
isFirstAcquirer
public boolean isFirstAcquirer()- Specified by:
isFirstAcquirer
in interfaceMessage
-
getTtl
public long getTtl() -
setDurable
public void setDurable(boolean durable) - Specified by:
setDurable
in interfaceMessage
-
setTtl
public void setTtl(long ttl) -
setDeliveryCount
public void setDeliveryCount(long deliveryCount) - Specified by:
setDeliveryCount
in interfaceMessage
-
setFirstAcquirer
public void setFirstAcquirer(boolean firstAcquirer) - Specified by:
setFirstAcquirer
in interfaceMessage
-
setPriority
public void setPriority(short priority) - Specified by:
setPriority
in interfaceMessage
-
getMessageId
- Specified by:
getMessageId
in interfaceMessage
-
getGroupSequence
public long getGroupSequence()- Specified by:
getGroupSequence
in interfaceMessage
-
getReplyToGroupId
- Specified by:
getReplyToGroupId
in interfaceMessage
-
getCreationTime
public long getCreationTime()- Specified by:
getCreationTime
in interfaceMessage
-
getAddress
- Specified by:
getAddress
in interfaceMessage
-
getUserId
public byte[] getUserId() -
getReplyTo
- Specified by:
getReplyTo
in interfaceMessage
-
getGroupId
- Specified by:
getGroupId
in interfaceMessage
-
getContentType
- Specified by:
getContentType
in interfaceMessage
-
getExpiryTime
public long getExpiryTime()- Specified by:
getExpiryTime
in interfaceMessage
-
getCorrelationId
- Specified by:
getCorrelationId
in interfaceMessage
-
getContentEncoding
- Specified by:
getContentEncoding
in interfaceMessage
-
getSubject
- Specified by:
getSubject
in interfaceMessage
-
setGroupSequence
public void setGroupSequence(long groupSequence) - Specified by:
setGroupSequence
in interfaceMessage
-
setUserId
public void setUserId(byte[] userId) -
setCreationTime
public void setCreationTime(long creationTime) - Specified by:
setCreationTime
in interfaceMessage
-
setSubject
- Specified by:
setSubject
in interfaceMessage
-
setGroupId
- Specified by:
setGroupId
in interfaceMessage
-
setAddress
- Specified by:
setAddress
in interfaceMessage
-
setExpiryTime
public void setExpiryTime(long absoluteExpiryTime) - Specified by:
setExpiryTime
in interfaceMessage
-
setReplyToGroupId
- Specified by:
setReplyToGroupId
in interfaceMessage
-
setContentEncoding
- Specified by:
setContentEncoding
in interfaceMessage
-
setContentType
- Specified by:
setContentType
in interfaceMessage
-
setReplyTo
- Specified by:
setReplyTo
in interfaceMessage
-
setCorrelationId
- Specified by:
setCorrelationId
in interfaceMessage
-
setMessageId
- Specified by:
setMessageId
in interfaceMessage
-
getHeader
-
getDeliveryAnnotations
- Specified by:
getDeliveryAnnotations
in interfaceMessage
-
getMessageAnnotations
- Specified by:
getMessageAnnotations
in interfaceMessage
-
getProperties
- Specified by:
getProperties
in interfaceMessage
-
getApplicationProperties
- Specified by:
getApplicationProperties
in interfaceMessage
-
getBody
-
setHeader
-
setDeliveryAnnotations
- Specified by:
setDeliveryAnnotations
in interfaceMessage
-
setMessageAnnotations
- Specified by:
setMessageAnnotations
in interfaceMessage
-
setProperties
- Specified by:
setProperties
in interfaceMessage
-
setApplicationProperties
- Specified by:
setApplicationProperties
in interfaceMessage
-
setBody
-
decode
public int decode(byte[] data, int offset, int length) Description copied from interface:Message
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
-
decode
Description copied from interface:Message
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.
- Specified by:
decode
in interfaceMessage
- Parameters:
buffer
- AReadableBuffer
that contains the complete message bytes.
-
encode
public int encode(byte[] data, int offset, int length) Description copied from interface:Message
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? -
encode2
public int encode2(byte[] data, int offset, int length) - Specified by:
encode2
in interfaceProtonJMessage
-
encode
Description copied from interface:Message
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.- Specified by:
encode
in interfaceMessage
- Specified by:
encode
in interfaceProtonJMessage
- Parameters:
buffer
- TheWritableBuffer
instance to encode the message contents into.- Returns:
- the number of bytes written to fully encode the message.
-
clear
public void clear() -
getError
-
toString
-