Interface ContextPathMatcher

All Known Implementing Classes:
DefaultContextPathMatcher, RestContextPathMatcher

public interface ContextPathMatcher
A matcher used for selecting the correct HttpServerChannelHandler to handle an incoming HttpRequest when you use multiple routes on the same port.

As when we do that, we need to multiplex and select the correct consumer route to process the HTTP request. To do that we need to match on the incoming HTTP request context-path from the request.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Whether the target context-path matches a regular url.
    boolean
    matchesRest(String path, boolean wildcard)
    Whether the target context-path matches a REST url.
    boolean
    matchMethod(String method, String restrict)
    Matches the given request HTTP method with the configured HTTP method of the consumer
  • Method Details

    • matches

      boolean matches(String path)
      Whether the target context-path matches a regular url.
      Parameters:
      path - the context-path from the incoming HTTP request
      Returns:
      true to match, false if not.
    • matchesRest

      boolean matchesRest(String path, boolean wildcard)
      Whether the target context-path matches a REST url.
      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

      boolean matchMethod(String method, String restrict)
      Matches the given request HTTP method with the configured HTTP method of the consumer
      Parameters:
      method - the request HTTP method
      restrict - the consumer configured HTTP restrict method
      Returns:
      true if matched, false otherwise