java.lang.Object
org.apache.activemq.artemis.core.filter.impl.FilterImpl
All Implemented Interfaces:
Filter

public class FilterImpl extends Object implements Filter
This class implements an ActiveMQ Artemis filter

ActiveMQ Artemis filters have the same syntax as JMS 1.1 selectors, but the identifiers are different.

Valid identifiers that can be used are:

  • AMQPriority - the priority of the message
  • AMQTimestamp - the timestamp of the message
  • AMQDurable - "DURABLE" or "NON_DURABLE"
  • AMQExpiration - the expiration of the message
  • AMQSize - the encoded size of the full message in bytes
  • AMQUserID - the user specified ID string (if any)
  • Any other identifiers that appear in a filter expression represent header values for the message
String values must be set as SimpleString, not java.lang.String
  • Method Details

    • createFilter

      public static Filter createFilter(String filterStr) throws ActiveMQException
      Returns null if filterStr is null or an empty String and a valid filter else.
      Returns:
      null if filterStr is null or an empty String and a valid filter else
      Throws:
      ActiveMQException - if the string does not correspond to a valid filter
    • createFilter

      public static Filter createFilter(SimpleString filterStr) throws ActiveMQException
      Returns null if filterStr is null or an empty String and a valid filter else.
      Returns:
      null if filterStr is null or an empty String and a valid filter else
      Throws:
      ActiveMQException - if the string does not correspond to a valid filter
    • getFilterString

      public SimpleString getFilterString()
      Specified by:
      getFilterString in interface Filter
    • match

      public boolean match(Message message)
      Specified by:
      match in interface Filter
    • match

      public boolean match(Map<String,String> map)
      Specified by:
      match in interface Filter
    • match

      public boolean match(Filterable filterable)
      Specified by:
      match in interface Filter
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object