Class AbstractConditionMatcher

java.lang.Object
org.apache.dubbo.rpc.cluster.router.condition.matcher.AbstractConditionMatcher
All Implemented Interfaces:
ConditionMatcher
Direct Known Subclasses:
ArgumentConditionMatcher, AttachmentConditionMatcher, UrlParamConditionMatcher

public abstract class AbstractConditionMatcher extends Object implements ConditionMatcher
The abstract implementation of ConditionMatcher, records the match and mismatch patterns of this matcher while at the same time provides the common match logics.
  • Field Details

    • logger

      public static final org.apache.dubbo.common.logger.ErrorTypeAwareLogger logger
    • DOES_NOT_FOUND_VALUE

      public static final String DOES_NOT_FOUND_VALUE
      See Also:
  • Constructor Details

    • AbstractConditionMatcher

      public AbstractConditionMatcher(String key, org.apache.dubbo.rpc.model.ModuleModel model)
  • Method Details

    • getSampleValueFromUrl

      public static String getSampleValueFromUrl(String conditionKey, Map<String,String> sample, org.apache.dubbo.common.URL param, Invocation invocation)
    • isMatch

      public boolean isMatch(Map<String,String> sample, org.apache.dubbo.common.URL param, Invocation invocation, boolean isWhenCondition)
      Description copied from interface: ConditionMatcher
      Determines if the patterns of this matcher matches with request context.
      Specified by:
      isMatch in interface ConditionMatcher
      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

      public Set<String> getMatches()
      Description copied from interface: ConditionMatcher
      match patterns extracted from when condition
      Specified by:
      getMatches in interface ConditionMatcher
      Returns:
    • getMismatches

      public Set<String> getMismatches()
      Description copied from interface: ConditionMatcher
      mismatch patterns extracted from then condition
      Specified by:
      getMismatches in interface ConditionMatcher
      Returns: