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 TypeMethodDescriptionmatch patterns extracted from when conditionmismatch patterns extracted from then conditionbooleanisMatch(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 urlparam- request context in consumer urlinvocation- request context in invocation, typically, service, method, arguments and attachmentsisWhenCondition- condition type- Returns:
- the matching result
-
getMatches
match patterns extracted from when condition- Returns:
-
getMismatches
mismatch patterns extracted from then condition- Returns:
-