Class CorrelationRuleFilter

java.lang.Object
com.azure.messaging.servicebus.administration.models.RuleFilter
com.azure.messaging.servicebus.administration.models.CorrelationRuleFilter

public class CorrelationRuleFilter extends RuleFilter
Represents the correlation rule filter expression. It holds a set of conditions that are matched against one or more of an arriving message's user and system properties. A common use case is to match against the message's:

A match exists when an arriving message's value for a property is equal to the value specified in the correlation filter. For string expressions, the comparison is case-sensitive. When specifying multiple match properties, the filter combines them as a logical AND condition, meaning all conditions must match for the filter to match.

This provides an efficient shortcut for declarations of filters that deal only with correlation equality. In this case the cost of the lexigraphical analysis of the expression can be avoided. Not only will correlation filters be optimized at declaration time, but they will also be optimized at runtime. Correlation filter matching can be reduced to a hashtable lookup, which aggregates the complexity of the set of defined correlation filters to O(1).

See Also:
  • Constructor Details

    • CorrelationRuleFilter

      public CorrelationRuleFilter()
      Initializes a new instance of CorrelationRuleFilter with default values.
    • CorrelationRuleFilter

      public CorrelationRuleFilter(String correlationId)
      Initializes a new instance of CorrelationRuleFilter with default values with the specified correlation identifier.
      Parameters:
      correlationId - The identifier for the correlation.
      Throws:
      IllegalArgumentException - If correlationId is an empty string.
      NullPointerException - If correlationId is null.
  • Method Details

    • getContentType

      public String getContentType()
      Gets the content type of the message.
      Returns:
      The content type of the message.
    • setContentType

      public CorrelationRuleFilter setContentType(String contentType)
      Sets the content type of the message.
      Parameters:
      contentType - The content type of the message.
      Returns:
      The updated CorrelationRuleFilter itself.
    • getCorrelationId

      public String getCorrelationId()
      Gets the correlation identifier.
      Returns:
      The correlation identifier.
    • setCorrelationId

      public CorrelationRuleFilter setCorrelationId(String correlationId)
      Sets the correlation identifier.
      Parameters:
      correlationId - The correlation identifier.
      Returns:
      The updated CorrelationRuleFilter itself.
    • getLabel

      public String getLabel()
      Gets the application specific label.
      Returns:
      The application specific label.
    • setLabel

      public CorrelationRuleFilter setLabel(String label)
      Sets the application specific label.
      Parameters:
      label - The application specific label.
      Returns:
      The updated CorrelationRuleFilter itself.
    • getMessageId

      public String getMessageId()
      Gets the identifier for the message.
      Returns:
      The identifier for the message.
    • setMessageId

      public CorrelationRuleFilter setMessageId(String messageId)
      Sets the identifier for the message.
      Parameters:
      messageId - The identifier for the message.
      Returns:
      The updated CorrelationRuleFilter itself.
    • getProperties

      public Map<String,Object> getProperties()
      Gets application specific properties of the message.
      Returns:
      The application specific properties of the message.
    • getReplyTo

      public String getReplyTo()
      Gets the address of the queue or subscription to reply to.
      Returns:
      The address of the queue or subscription to reply to.
    • setReplyTo

      public CorrelationRuleFilter setReplyTo(String replyTo)
      Sets the address of the queue or subscription to reply to.
      Parameters:
      replyTo - The address of the queue or subscription to reply to.
      Returns:
      The updated CorrelationRuleFilter itself.
    • getReplyToSessionId

      public String getReplyToSessionId()
      Gets the session identifier to reply to.
      Returns:
      The session identifier to reply to.
    • setReplyToSessionId

      public CorrelationRuleFilter setReplyToSessionId(String replyToSessionId)
      Sets the session identifier to reply to. Max size of replyToSessionId is 128.
      Parameters:
      replyToSessionId - The session identifier to reply to.
      Returns:
      The updated CorrelationRuleFilter itself.
    • getSessionId

      public String getSessionId()
      Gets the session identifier.
      Returns:
      The session identifier.
    • setSessionId

      public CorrelationRuleFilter setSessionId(String sessionId)
      Sets the session identifier. Max size of sessionId is 128 chars.
      Parameters:
      sessionId - The session identifier.
      Returns:
      The updated CorrelationRuleFilter itself.
    • getTo

      public String getTo()
      Gets the address to send to.
      Returns:
      The address to send to.
    • setTo

      public CorrelationRuleFilter setTo(String to)
      Sets the address to send to.
      Parameters:
      to - The address to send to.
      Returns:
      The updated CorrelationRuleFilter itself.
    • toString

      public String toString()
      Converts the value of the current instance to its equivalent string representation.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the current instance.
    • equals

      public boolean equals(Object other)
      Compares this RuleFilter to the specified object. The result is true if and only if the argument is not null and is a CorrelationRuleFilter object that with the same parameters as this object.
      Overrides:
      equals in class Object
      Parameters:
      other - - the object to which the current CorrelationRuleFilter should be compared.
      Returns:
      True, if the passed object is a CorrelationRuleFilter with the same parameter values, False otherwise.
    • hashCode

      public int hashCode()
      Returns a hash code for this CorrelationRuleFilter.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this object.