Interface ConditionMatcher

All Known Implementing Classes:
AbstractConditionMatcher, ArgumentConditionMatcher, AttachmentConditionMatcher, UrlParamConditionMatcher

public interface ConditionMatcher
ConditionMatcher represents a specific match condition of a condition rule.

The following condition rule '=barinvalid input: '&arguments'[0]=hello* => region=hangzhou' consists of three ConditionMatchers: 1. UrlParamConditionMatcher represented by 'foo=bar' 2. ArgumentsConditionMatcher represented by 'arguments[0]=hello*' 3. UrlParamConditionMatcher represented by 'region=hangzhou'

It's easy to define your own matcher by extending ConditionMatcherFactory

  • Method Summary

    Modifier and Type
    Method
    Description
    match patterns extracted from when condition
    mismatch patterns extracted from then condition
    boolean
    isMatch(Map<String,String> sample, org.apache.dubbo.common.URL param, Invocation invocation, boolean isWhenCondition)
    Determines if the patterns of this matcher matches with request context.
  • Method Details

    • isMatch

      boolean isMatch(Map<String,String> sample, org.apache.dubbo.common.URL param, Invocation invocation, boolean isWhenCondition)
      Determines if the patterns of this matcher matches with request context.
      Parameters:
      sample - request context in provider url
      param - request context in consumer url
      invocation - request context in invocation, typically, service, method, arguments and attachments
      isWhenCondition - condition type
      Returns:
      the matching result
    • getMatches

      Set<String> getMatches()
      match patterns extracted from when condition
      Returns:
    • getMismatches

      Set<String> getMismatches()
      mismatch patterns extracted from then condition
      Returns: