Class RestContextPathMatcher

java.lang.Object
org.apache.camel.component.netty.http.DefaultContextPathMatcher
org.apache.camel.component.netty.http.RestContextPathMatcher
All Implemented Interfaces:
ContextPathMatcher

public class RestContextPathMatcher extends DefaultContextPathMatcher
A ContextPathMatcher that supports the Rest DSL.
  • Constructor Details

    • RestContextPathMatcher

      public RestContextPathMatcher(String rawPath, String path, String restrictMethod, boolean matchOnUriPrefix)
  • Method Details

    • matchesRest

      public boolean matchesRest(String path, boolean wildcard)
      Description copied from interface: ContextPathMatcher
      Whether the target context-path matches a REST url.
      Specified by:
      matchesRest in interface ContextPathMatcher
      Overrides:
      matchesRest in class DefaultContextPathMatcher
      Parameters:
      path - the context-path from the incoming HTTP request
      wildcard - whether to match strict or by wildcards
      Returns:
      true to match, false if not.
    • matchMethod

      public boolean matchMethod(String method, String restrict)
      Description copied from interface: ContextPathMatcher
      Matches the given request HTTP method with the configured HTTP method of the consumer
      Specified by:
      matchMethod in interface ContextPathMatcher
      Overrides:
      matchMethod in class DefaultContextPathMatcher
      Parameters:
      method - the request HTTP method
      restrict - the consumer configured HTTP restrict method
      Returns:
      true if matched, false otherwise
    • matchRestPath

      public boolean matchRestPath(String requestPath, String consumerPath, boolean wildcard)
      Matches the given request path with the configured consumer path
      Parameters:
      requestPath - the request path
      consumerPath - the consumer path which may use { } tokens
      Returns:
      true if matched, false otherwise
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class DefaultContextPathMatcher
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class DefaultContextPathMatcher