public class AmqpJmsMessageFacade extends Object implements JmsMessageFacade
| Modifier and Type | Field and Description |
|---|---|
protected AmqpConnection |
connection |
| Constructor and Description |
|---|
AmqpJmsMessageFacade() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
applicationPropertyExists(String key) |
JmsMessage |
asJmsMessage() |
void |
clearBody()
Clears the contents of this Message.
|
void |
clearProperties()
Clears any Message properties that exist for this Message instance.
|
AmqpJmsMessageFacade |
copy()
Create a new instance and perform a deep copy of this object's
contents.
|
protected void |
copyInto(AmqpJmsMessageFacade target) |
io.netty.buffer.ByteBuf |
encodeMessage()
Encodes the protocol level Message instance for transmission.
|
void |
filterTracingAnnotations(BiConsumer<String,Object> filter)
Allows the tracing layer to filter out tracing related details from the full
set of message annotations that a message might be carrying.
|
long |
getAmqpTimeToLiveOverride() |
Object |
getApplicationProperty(String key) |
Set<String> |
getApplicationPropertyNames(Set<String> propertyNames) |
org.apache.qpid.proton.amqp.Symbol |
getContentType()
The annotation value for the JMS Message content type.
|
String |
getCorrelationId()
Returns the correlation ID set on this message if one exists, null otherwise.
|
byte[] |
getCorrelationIdBytes()
Gets the set correlation ID of the message in raw bytes form.
|
int |
getDeliveryCount()
Returns the current delivery count of the Message as set in the underlying
message instance.
|
long |
getDeliveryTime()
Returns the set delivery time for this message.
|
JmsDestination |
getDestination()
Gets the Destination value that was assigned to this message at the time it was
sent.
|
long |
getExpiration()
Returns the set expiration time for this message.
|
String |
getGroupId()
Gets the Group ID that this message is assigned to.
|
int |
getGroupSequence()
Gets the assigned group sequence of this message.
|
byte |
getJmsMsgType() |
String |
getMessageId()
Returns the message ID set on this message if one exists, null otherwise.
|
int |
getPriority()
Returns the assigned priority value of this message in JMS ranged scoping.
|
Object |
getProperty(String key)
Returns the property stored in the message accessed via the given key/
|
Set<String> |
getPropertyNames()
Returns a set of all the property names that have been set in this message.
|
Object |
getProviderMessageIdObject()
Returns the underlying providers message ID object for this message if one
exists, null otherwise.
|
int |
getRedeliveryCount()
Returns the current redelivery count of the Message as set in the underlying
message instance.
|
JmsDestination |
getReplyTo()
Gets the Destination where replies for this Message are to be sent to.
|
String |
getReplyToGroupId() |
long |
getTimestamp()
Gets the time stamp assigned to the message when it was sent.
|
Object |
getTracingAnnotation(String key)
Gets some trace specific message annotation that was previously applied to
the given message either locally or by a remote peer.
|
Object |
getTracingContext(String key)
Gets some trace related context from the message for use by the tracing
implementation.
|
String |
getType()
Returns the JMSType value as defined by the provider or set by the sending client.
|
String |
getUserId()
Returns the ID of the user that sent this message if available.
|
byte[] |
getUserIdBytes()
Gets the set user ID of the message in raw bytes form.
|
boolean |
hasAmqpTimeToLiveOverride() |
boolean |
hasBody()
Returns true if the underlying message has a body, false if the body is empty.
|
void |
initialize(AmqpConnection connection)
Initialize the state of this message for send.
|
void |
initialize(AmqpConsumer consumer)
Initialize the state of this message for receive.
|
protected void |
initializeEmptyBody()
Used to indicate that a Message object should empty the body element and make
any other internal updates to reflect the message now has no body value.
|
boolean |
isDeliveryTimeTransmitted()
Returns whether the delivery time is being transmitted, i.e.
|
boolean |
isPersistent() |
boolean |
isRedelivered()
Used to quickly check if a message has been redelivered.
|
void |
onDispatch()
Called before a message is dispatched to its intended consumer to allow for
any necessary processing of message data such as setting read-only state etc.
|
void |
onSend(long producerTtl)
Called before a message is sent to allow a Message instance to move the
contents from a logical data structure to a binary form for transmission, or
other processing such as setting proper message headers etc.
|
boolean |
propertyExists(String key) |
Object |
removeTracingAnnotation(String key)
Remove some trace specific message annotation that was previously applied to
the given message either locally or by a remote peer.
|
Object |
removeTracingContext(String key)
Removes some trace related context from the message.
|
void |
setAmqpTimeToLiveOverride(Long ttl)
Sets a value which will be used to override any ttl value that may otherwise be set
based on the expiration value when sending the underlying AMQP message.
|
void |
setApplicationProperty(String key,
Object value) |
void |
setContentType(org.apache.qpid.proton.amqp.Symbol value) |
void |
setCorrelationId(String correlationId)
Sets the correlation ID for this message.
|
void |
setCorrelationIdBytes(byte[] correlationId)
Sets the correlation ID of the message in raw byte form.
|
void |
setDeliveryCount(int deliveryCount)
Sets the delivery count on the message.
|
void |
setDeliveryTime(long deliveryTime,
boolean transmit)
Sets an desired delivery time on this message.
|
void |
setDestination(JmsDestination destination)
Sets the Destination that this message is being sent to.
|
void |
setExpiration(long expiration)
Sets an expiration time on this message.
|
void |
setGroupId(String groupId)
Sets the Group ID to use for this message.
|
void |
setGroupSequence(int groupSequence)
Sets the group sequence value for this message.
|
void |
setMessageId(String messageId)
Sets the message ID for this message.
|
void |
setPersistent(boolean value)
Sets the persistent flag on this message.
|
void |
setPriority(int priority)
Sets the message priority for this message using a JMS priority scoped value.
|
void |
setProperty(String key,
Object value)
Sets the message property value using the supplied key to identify the value
that should be set or updated.
|
void |
setProviderMessageIdObject(Object messageId)
Sets the underlying providers message ID object for this message, or
clears it if the provided value is null.
|
void |
setRedelivered(boolean redelivered)
Used to set the redelivered state of a message.
|
void |
setRedeliveryCount(int redeliveryCount)
Used to update the message redelivery after a local redelivery of the Message
has been performed.
|
void |
setReplyTo(JmsDestination replyTo)
Sets the Destination where replies to this Message are to be sent.
|
void |
setReplyToGroupId(String replyToGroupId) |
void |
setTimestamp(long timestamp)
Sets the time stamp value of this message.
|
Object |
setTracingAnnotation(String key,
Object value)
Sets some trace specific message annotation that was previously applied to
the given message either locally or by a remote peer.
|
Object |
setTracingContext(String key,
Object value)
Sets some trace related context from the message for use by the tracing
implementation.
|
void |
setType(String type)
Sets the String value used to define the Message JMSType by the client.
|
void |
setUserId(String userId)
Sets the User ID for the connection that is being used to send this message.
|
void |
setUserIdBytes(byte[] userId)
Sets the user ID of the message in raw byte form.
|
protected AmqpConnection connection
public void initialize(AmqpConnection connection)
connection - The connection that this message is linked to.public void initialize(AmqpConsumer consumer)
consumer - The consumer that this message was read from.protected void initializeEmptyBody()
public byte getJmsMsgType()
public org.apache.qpid.proton.amqp.Symbol getContentType()
public void setContentType(org.apache.qpid.proton.amqp.Symbol value)
public boolean propertyExists(String key) throws javax.jms.JMSException
propertyExists in interface JmsMessageFacadekey - The property name that is being searched for.javax.jms.JMSException - if an error occurs while accessing the Message properties.public boolean applicationPropertyExists(String key) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic Set<String> getPropertyNames()
getPropertyNames in interface JmsMessageFacadepublic Set<String> getApplicationPropertyNames(Set<String> propertyNames)
public Object getProperty(String key) throws javax.jms.JMSException
JmsMessageFacadegetProperty in interface JmsMessageFacadekey - the key used to access the given property.javax.jms.JMSException - if an error occurs while accessing the Message properties.public Object getApplicationProperty(String key) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic void setProperty(String key, Object value) throws javax.jms.JMSException
JmsMessageFacadesetProperty in interface JmsMessageFacadekey - the key that identifies the message property.value - the value that is to be stored in the message.javax.jms.JMSException - if an error occurs while accessing the Message properties.public void setApplicationProperty(String key, Object value) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic void onSend(long producerTtl)
throws javax.jms.JMSException
JmsMessageFacadeonSend in interface JmsMessageFacadeproducerTtl - the time to live value configured on the producer when sent.javax.jms.JMSException - if an error occurs while preparing the message for send.public void onDispatch()
throws javax.jms.JMSException
JmsMessageFacadeonDispatch in interface JmsMessageFacadejavax.jms.JMSException - if an error occurs while preparing the message for dispatch.public void clearBody()
JmsMessageFacadeclearBody in interface JmsMessageFacadepublic void clearProperties()
throws javax.jms.JMSException
JmsMessageFacadeclearProperties in interface JmsMessageFacadejavax.jms.JMSException - if an error occurs while accessing the message properties.public AmqpJmsMessageFacade copy() throws javax.jms.JMSException
JmsMessageFacadecopy in interface JmsMessageFacadejavax.jms.JMSException - if an error occurs while copying the message.protected void copyInto(AmqpJmsMessageFacade target)
public String getMessageId()
JmsMessageFacadegetMessageId in interface JmsMessageFacadepublic Object getProviderMessageIdObject()
JmsMessageFacadegetProviderMessageIdObject in interface JmsMessageFacadepublic void setProviderMessageIdObject(Object messageId)
JmsMessageFacadesetProviderMessageIdObject in interface JmsMessageFacademessageId - The message ID to set on this message, or null to clear.public void setMessageId(String messageId) throws IdConversionException
JmsMessageFacadesetMessageId in interface JmsMessageFacademessageId - The message ID to set on this message, or null to clear.IdConversionExceptionpublic long getTimestamp()
JmsMessageFacadegetTimestamp in interface JmsMessageFacadepublic void setTimestamp(long timestamp)
JmsMessageFacadesetTimestamp in interface JmsMessageFacadetimestamp - the time that the message was sent by the provider.public String getCorrelationId()
JmsMessageFacadegetCorrelationId in interface JmsMessageFacadepublic void setCorrelationId(String correlationId) throws IdConversionException
JmsMessageFacadesetCorrelationId in interface JmsMessageFacadecorrelationId - The correlation ID to set on this message, or null to clear.IdConversionExceptionpublic byte[] getCorrelationIdBytes()
throws javax.jms.JMSException
JmsMessageFacadegetCorrelationIdBytes in interface JmsMessageFacadejavax.jms.JMSException - if an error occurs while accessing the property.public void setCorrelationIdBytes(byte[] correlationId)
JmsMessageFacadesetCorrelationIdBytes in interface JmsMessageFacadecorrelationId - the byte array to use to set the message correlation ID.public boolean isPersistent()
isPersistent in interface JmsMessageFacadepublic void setPersistent(boolean value)
JmsMessageFacadesetPersistent in interface JmsMessageFacadevalue - true if the message is to be marked as persistent.public int getDeliveryCount()
JmsMessageFacadegetDeliveryCount in interface JmsMessageFacadepublic void setDeliveryCount(int deliveryCount)
JmsMessageFacadesetDeliveryCount in interface JmsMessageFacadedeliveryCount - the new delivery count to assign the Message.public int getRedeliveryCount()
JmsMessageFacadegetRedeliveryCount in interface JmsMessageFacadepublic void setRedeliveryCount(int redeliveryCount)
JmsMessageFacadesetRedeliveryCount in interface JmsMessageFacaderedeliveryCount - the new redelivery count to assign the Message.public boolean isRedelivered()
JmsMessageFacadeisRedelivered in interface JmsMessageFacadepublic void setRedelivered(boolean redelivered)
JmsMessageFacadesetRedelivered in interface JmsMessageFacaderedelivered - true if the message is to be marked as redelivered, false otherwise.public String getType()
JmsMessageFacadegetType in interface JmsMessageFacadepublic void setType(String type)
JmsMessageFacadesetType in interface JmsMessageFacadetype - the JMSType value the client assigns to this message.public int getPriority()
JmsMessageFacadegetPriority in interface JmsMessageFacadepublic void setPriority(int priority)
JmsMessageFacadesetPriority in interface JmsMessageFacadepriority - the new priority value to set on this message.public long getExpiration()
JmsMessageFacadegetExpiration in interface JmsMessageFacadepublic void setExpiration(long expiration)
JmsMessageFacadesetExpiration in interface JmsMessageFacadeexpiration - the time that this message should be considered as expired.public long getDeliveryTime()
JmsMessageFacadegetDeliveryTime in interface JmsMessageFacadepublic void setDeliveryTime(long deliveryTime,
boolean transmit)
JmsMessageFacadesetDeliveryTime in interface JmsMessageFacadedeliveryTime - the earliest time that the message should be made available for delivery.transmit - whether to transmit an annotation containing the value (if non-zero)public boolean isDeliveryTimeTransmitted()
JmsMessageFacadeisDeliveryTimeTransmitted in interface JmsMessageFacadepublic void setAmqpTimeToLiveOverride(Long ttl) throws javax.jms.MessageFormatException
ttl - the value to use, in range 0 <= x <= 2^32 - 1javax.jms.MessageFormatException - if the TTL value is not in the allowed range.public boolean hasAmqpTimeToLiveOverride()
public long getAmqpTimeToLiveOverride()
public JmsDestination getDestination()
JmsMessageFacadegetDestination in interface JmsMessageFacadepublic void setDestination(JmsDestination destination)
JmsMessageFacadesetDestination in interface JmsMessageFacadedestination - the destination that this message is being sent to.public JmsDestination getReplyTo()
JmsMessageFacadegetReplyTo in interface JmsMessageFacadepublic void setReplyTo(JmsDestination replyTo)
JmsMessageFacadesetReplyTo in interface JmsMessageFacadereplyTo - the Destination where replies should be sent, or null to clear.public void setReplyToGroupId(String replyToGroupId)
public String getReplyToGroupId()
public String getUserId()
JmsMessageFacadegetUserId in interface JmsMessageFacadepublic void setUserId(String userId)
JmsMessageFacadesetUserId in interface JmsMessageFacadeuserId - the user ID that sent this message or null to clear.public byte[] getUserIdBytes()
JmsMessageFacadegetUserIdBytes in interface JmsMessageFacadepublic void setUserIdBytes(byte[] userId)
JmsMessageFacadesetUserIdBytes in interface JmsMessageFacadeuserId - the byte array to use to set the message user ID.public String getGroupId()
JmsMessageFacadegetGroupId in interface JmsMessageFacadepublic void setGroupId(String groupId)
JmsMessageFacadesetGroupId in interface JmsMessageFacadegroupId - the Group ID that this message is assigned to.public int getGroupSequence()
JmsMessageFacadegetGroupSequence in interface JmsMessageFacadepublic void setGroupSequence(int groupSequence)
JmsMessageFacadesetGroupSequence in interface JmsMessageFacadegroupSequence - the group sequence value to assign this message.public boolean hasBody()
JmsMessageFacadehasBody in interface JmsMessageFacadepublic JmsMessage asJmsMessage()
public io.netty.buffer.ByteBuf encodeMessage()
JmsMessageFacadeencodeMessage in interface JmsMessageFacadepublic Object getTracingContext(String key)
TraceableMessageAllows the Tracing implementation to store context data into the message without the message needing to know what the types or structure of that data is.
getTracingContext in interface TraceableMessagekey - The name of the context element to be looked up.public Object setTracingContext(String key, Object value)
TraceableMessageAllows the Tracing implementation to store context data into the message without the message needing to know what the types or structure of that data is.
setTracingContext in interface TraceableMessagekey - The key that the tracing context element should be stored under.value - The value to store under the given key.public Object removeTracingContext(String key)
TraceableMessageremoveTracingContext in interface TraceableMessagekey - The key of the tracing context element that should be cleared.public Object getTracingAnnotation(String key)
TraceableMessagegetTracingAnnotation in interface TraceableMessagekey - The name of the tracing annotation data to retrieve.public Object setTracingAnnotation(String key, Object value)
TraceableMessagesetTracingAnnotation in interface TraceableMessagekey - The name of the tracing annotation data to store the trace data under.value - The value to store under the given key.public Object removeTracingAnnotation(String key)
TraceableMessageremoveTracingAnnotation in interface TraceableMessagekey - The name of the tracing annotation data to remove.public void filterTracingAnnotations(BiConsumer<String,Object> filter)
TraceableMessagefilterTracingAnnotations in interface TraceableMessagefilter - The filter used to consume tracing related message annotations of interest.Copyright © 2013–2019 The Apache Software Foundation. All rights reserved.