Package org.apache.qpid.jms.message
Class JmsMessagePropertyIntercepter
- java.lang.Object
-
- org.apache.qpid.jms.message.JmsMessagePropertyIntercepter
-
public class JmsMessagePropertyIntercepter extends java.lang.ObjectUtility 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 Constructor Description JmsMessagePropertyIntercepter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclearProperties(JmsMessage message, boolean excludeStandardJMSHeaders)For each of the currently configured message property intercepter instances clear or reset the value to its default.static java.util.Set<java.lang.String>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 java.lang.ObjectgetProperty(JmsMessage message, java.lang.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.static java.util.Set<java.lang.String>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, java.lang.String name)Static inspection method to determine if a named property exists for a given message.static voidsetProperty(JmsMessage message, java.lang.String name, java.lang.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.
-
-
-
Method Detail
-
getProperty
public static java.lang.Object getProperty(JmsMessage message, java.lang.String name) throws jakarta.jms.JMSException
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, java.lang.String name, java.lang.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, java.lang.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
public static java.util.Set<java.lang.String> getAllPropertyNames(JmsMessage message) 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.- 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 java.util.Set<java.lang.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.
-
-