Package org.apache.qpid.jms.message
Class JmsMessagePropertyIntercepter
java.lang.Object
org.apache.qpid.jms.message.JmsMessagePropertyIntercepter
Utility class used to intercept calls to Message property gets and sets and map the
correct fields in the underlying JmsMessageFacade to the property name being operated on.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclearProperties(JmsMessage message, boolean excludeStandardJMSHeaders) For each of the currently configured message property intercepter instances clear or reset the value to its default.getAllPropertyNames(JmsMessage message) For each of the currently configured message property intercepter instance a string key value is inserted into an Set and returned.static ObjectgetProperty(JmsMessage message, String name) Static get method that takes a property name and gets the value either via a registered property get object or through the JmsMessageFacade getProperty method.getPropertyNames(JmsMessage message, boolean excludeStandardJMSHeaders) For each of the currently configured message property intercepter instance a string key value is inserted into an Set and returned if the property has a value and is available for a read operation.static booleanpropertyExists(JmsMessage message, String name) Static inspection method to determine if a named property exists for a given message.static voidsetProperty(JmsMessage message, String name, Object value) Static set method that takes a property name and sets the value either via a registered property set object or through the JmsMessageFacade setProperty method.
-
Constructor Details
-
JmsMessagePropertyIntercepter
public JmsMessagePropertyIntercepter()
-
-
Method Details
-
getProperty
Static get method that takes a property name and gets the value either via a registered property get object or through the JmsMessageFacade getProperty method.- Parameters:
message- the JmsMessage instance to read fromname- the property name that is being requested.- Returns:
- the correct value either mapped to an Message attribute of a Message property.
- Throws:
jakarta.jms.JMSException- if an error occurs while reading the defined property.
-
setProperty
public static void setProperty(JmsMessage message, String name, Object value) throws jakarta.jms.JMSException Static set method that takes a property name and sets the value either via a registered property set object or through the JmsMessageFacade setProperty method.- Parameters:
message- the JmsMessage instance to write to.name- the property name that is being written.value- the new value to assign for the named property.- Throws:
jakarta.jms.JMSException- if an error occurs while writing the defined property.
-
propertyExists
public static boolean propertyExists(JmsMessage message, String name) throws jakarta.jms.JMSException Static inspection method to determine if a named property exists for a given message.- Parameters:
message- the JmsMessage instance to read fromname- the property name that is being inspected.- Returns:
- true if the message contains the given property.
- Throws:
jakarta.jms.JMSException- if an error occurs while validating the defined property.
-
clearProperties
public static void clearProperties(JmsMessage message, boolean excludeStandardJMSHeaders) throws jakarta.jms.JMSException For each of the currently configured message property intercepter instances clear or reset the value to its default. Once complete the method will direct the given provider message facade to clear any message properties that might have been set.- Parameters:
message- the JmsMessage instance to read fromexcludeStandardJMSHeaders- whether the standard JMS header names should be excluded from the returned set- Throws:
jakarta.jms.JMSException- if an error occurs while validating the defined property.
-
getAllPropertyNames
For each of the currently configured message property intercepter instance a string key value is inserted into an Set and returned.- Parameters:
message- the JmsMessage instance to read property names from.- Returns:
- a
Set<String>containing the names of all intercepted properties. - Throws:
jakarta.jms.JMSException- if an error occurs while gathering the message property names.
-
getPropertyNames
public static Set<String> getPropertyNames(JmsMessage message, boolean excludeStandardJMSHeaders) throws jakarta.jms.JMSException For each of the currently configured message property intercepter instance a string key value is inserted into an Set and returned if the property has a value and is available for a read operation. The Set returned may be manipulated by the receiver without impacting the facade, and an empty set will be returned if there are no matching properties.- Parameters:
message- the JmsMessage instance to read fromexcludeStandardJMSHeaders- whether the standard JMS header names should be excluded from the returned set- Returns:
- a
Set<String>containing the names of all intercepted properties with a value. - Throws:
jakarta.jms.JMSException- if an error occurs while gathering the message property names.
-