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 TypeMethodDescriptionvoidclear()intdecode(byte[] data, int offset, int length) TODO describe what happens if the data does not represent a complete message.voiddecode(ByteBuffer buffer) 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.intencode2(byte[] data, int offset, int length) getBody()longlonggetError()longlongshortlonggetTtl()byte[]booleanbooleanvoidsetAddress(String to) voidsetApplicationProperties(ApplicationProperties applicationProperties) voidvoidsetContentEncoding(String contentEncoding) voidsetContentType(String contentType) voidsetCorrelationId(Object correlationId) voidsetCreationTime(long creationTime) voidsetDeliveryAnnotations(DeliveryAnnotations deliveryAnnotations) voidsetDeliveryCount(long deliveryCount) voidsetDurable(boolean durable) voidsetExpiryTime(long absoluteExpiryTime) voidsetFirstAcquirer(boolean firstAcquirer) voidvoidsetGroupId(String groupId) voidsetGroupSequence(long groupSequence) voidvoidsetMessageAnnotations(MessageAnnotations messageAnnotations) voidsetMessageId(Object messageId) voidsetPriority(short priority) voidsetProperties(Properties properties) voidsetReplyTo(String replyTo) voidsetReplyToGroupId(String replyToGroupId) voidsetSubject(String subject) voidsetTtl(long ttl) voidsetUserId(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:
getDeliveryCountin interfaceMessage
-
getPriority
public short getPriority()- Specified by:
getPriorityin interfaceMessage
-
isFirstAcquirer
public boolean isFirstAcquirer()- Specified by:
isFirstAcquirerin interfaceMessage
-
getTtl
public long getTtl() -
setDurable
public void setDurable(boolean durable) - Specified by:
setDurablein interfaceMessage
-
setTtl
public void setTtl(long ttl) -
setDeliveryCount
public void setDeliveryCount(long deliveryCount) - Specified by:
setDeliveryCountin interfaceMessage
-
setFirstAcquirer
public void setFirstAcquirer(boolean firstAcquirer) - Specified by:
setFirstAcquirerin interfaceMessage
-
setPriority
public void setPriority(short priority) - Specified by:
setPriorityin interfaceMessage
-
getMessageId
- Specified by:
getMessageIdin interfaceMessage
-
getGroupSequence
public long getGroupSequence()- Specified by:
getGroupSequencein interfaceMessage
-
getReplyToGroupId
- Specified by:
getReplyToGroupIdin interfaceMessage
-
getCreationTime
public long getCreationTime()- Specified by:
getCreationTimein interfaceMessage
-
getAddress
- Specified by:
getAddressin interfaceMessage
-
getUserId
public byte[] getUserId() -
getReplyTo
- Specified by:
getReplyToin interfaceMessage
-
getGroupId
- Specified by:
getGroupIdin interfaceMessage
-
getContentType
- Specified by:
getContentTypein interfaceMessage
-
getExpiryTime
public long getExpiryTime()- Specified by:
getExpiryTimein interfaceMessage
-
getCorrelationId
- Specified by:
getCorrelationIdin interfaceMessage
-
getContentEncoding
- Specified by:
getContentEncodingin interfaceMessage
-
getSubject
- Specified by:
getSubjectin interfaceMessage
-
setGroupSequence
public void setGroupSequence(long groupSequence) - Specified by:
setGroupSequencein interfaceMessage
-
setUserId
public void setUserId(byte[] userId) -
setCreationTime
public void setCreationTime(long creationTime) - Specified by:
setCreationTimein interfaceMessage
-
setSubject
- Specified by:
setSubjectin interfaceMessage
-
setGroupId
- Specified by:
setGroupIdin interfaceMessage
-
setAddress
- Specified by:
setAddressin interfaceMessage
-
setExpiryTime
public void setExpiryTime(long absoluteExpiryTime) - Specified by:
setExpiryTimein interfaceMessage
-
setReplyToGroupId
- Specified by:
setReplyToGroupIdin interfaceMessage
-
setContentEncoding
- Specified by:
setContentEncodingin interfaceMessage
-
setContentType
- Specified by:
setContentTypein interfaceMessage
-
setReplyTo
- Specified by:
setReplyToin interfaceMessage
-
setCorrelationId
- Specified by:
setCorrelationIdin interfaceMessage
-
setMessageId
- Specified by:
setMessageIdin interfaceMessage
-
getHeader
-
getDeliveryAnnotations
- Specified by:
getDeliveryAnnotationsin interfaceMessage
-
getMessageAnnotations
- Specified by:
getMessageAnnotationsin interfaceMessage
-
getProperties
- Specified by:
getPropertiesin interfaceMessage
-
getApplicationProperties
- Specified by:
getApplicationPropertiesin interfaceMessage
-
getBody
-
setHeader
-
setDeliveryAnnotations
- Specified by:
setDeliveryAnnotationsin interfaceMessage
-
setMessageAnnotations
- Specified by:
setMessageAnnotationsin interfaceMessage
-
setProperties
- Specified by:
setPropertiesin interfaceMessage
-
setApplicationProperties
- Specified by:
setApplicationPropertiesin interfaceMessage
-
setBody
-
decode
public int decode(byte[] data, int offset, int length) Description copied from interface:MessageTODO 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:MessageDecodes 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:
decodein interfaceMessage- Parameters:
buffer- AReadableBufferthat contains the complete message bytes.
-
encode
public int encode(byte[] data, int offset, int length) Description copied from interface:MessageEncodes 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? -
encode2
public int encode2(byte[] data, int offset, int length) - Specified by:
encode2in interfaceProtonJMessage
-
encode
Description copied from interface:MessageEncodes 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.- Specified by:
encodein interfaceMessage- Specified by:
encodein interfaceProtonJMessage- Parameters:
buffer- TheWritableBufferinstance to encode the message contents into.- Returns:
- the number of bytes written to fully encode the message.
-
clear
public void clear() -
getError
-
toString
-