Class JmsMessagePropertyIntercepter

java.lang.Object
org.apache.qpid.jms.message.JmsMessagePropertyIntercepter

public class JmsMessagePropertyIntercepter extends Object
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    clearProperties(JmsMessage message, boolean excludeStandardJMSHeaders)
    For each of the currently configured message property intercepter instances clear or reset the value to its default.
    static Set<String>
    For each of the currently configured message property intercepter instance a string key value is inserted into an Set and returned.
    static Object
    getProperty(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.
    static Set<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 boolean
    Static inspection method to determine if a named property exists for a given message.
    static void
    setProperty(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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JmsMessagePropertyIntercepter

      public JmsMessagePropertyIntercepter()
  • Method Details

    • getProperty

      public static Object getProperty(JmsMessage message, 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 from
      name - 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 from
      name - 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 from
      excludeStandardJMSHeaders - 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 Set<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 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 from
      excludeStandardJMSHeaders - 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.