Package org.apache.camel.support
Class RestConsumerContextPathMatcher
- java.lang.Object
-
- org.apache.camel.support.RestConsumerContextPathMatcher
-
public final class RestConsumerContextPathMatcher extends Object
A context path matcher when using rest-dsl that allows components to reuse the same matching logic. The component should use thematchBestPath(String, String, java.util.List)
with the request details and the matcher returns the best matched, or null if none could be determined. TheRestConsumerContextPathMatcher.ConsumerPath
is used for the components to provide the details to the matcher.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
RestConsumerContextPathMatcher.ConsumerPath<T>
Consumer path details which must be implemented and provided by the components.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RestConsumerContextPathMatcher.ConsumerPath
matchBestPath(String requestMethod, String requestPath, List<RestConsumerContextPathMatcher.ConsumerPath> consumerPaths)
Finds the best matching of the list of consumer paths that should service the incoming request.static boolean
matchPath(String requestPath, String consumerPath, boolean matchOnUriPrefix)
Does the incoming request match the given consumer path (ignore case)
-
-
-
Method Detail
-
matchPath
public static boolean matchPath(String requestPath, String consumerPath, boolean matchOnUriPrefix)
Does the incoming request match the given consumer path (ignore case)- Parameters:
requestPath
- the incoming request context pathconsumerPath
- a consumer pathmatchOnUriPrefix
- whether to use the matchOnPrefix option- Returns:
- true if matched, false otherwise
-
matchBestPath
public static RestConsumerContextPathMatcher.ConsumerPath matchBestPath(String requestMethod, String requestPath, List<RestConsumerContextPathMatcher.ConsumerPath> consumerPaths)
Finds the best matching of the list of consumer paths that should service the incoming request.- Parameters:
requestMethod
- the incoming request HTTP methodrequestPath
- the incoming request context pathconsumerPaths
- the list of consumer context path details- Returns:
- the best matched consumer, or null if none could be determined.
-
-