Interface ServletResolveConsumerStrategy

All Known Implementing Classes:
HttpRestServletResolveConsumerStrategy, HttpServletResolveConsumerStrategy

public interface ServletResolveConsumerStrategy
Strategy to resolve which consumer to service an incoming HttpServletRequest.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isHttpMethodAllowed(jakarta.servlet.http.HttpServletRequest request, String method, Map<String,HttpConsumer> consumers)
    Checks if the http request method (GET, POST, etc) would be allow among the registered consumers.
    resolve(jakarta.servlet.http.HttpServletRequest request, Map<String,HttpConsumer> consumers)
    Resolve the consumer to use.
  • Method Details

    • resolve

      HttpConsumer resolve(jakarta.servlet.http.HttpServletRequest request, Map<String,HttpConsumer> consumers)
      Resolve the consumer to use.
      Parameters:
      request - the http request
      consumers - the map of registered consumers
      Returns:
      the consumer to service the request, or null if no match, which sends back a HttpServletResponse.SC_NOT_FOUND to the client.
    • isHttpMethodAllowed

      boolean isHttpMethodAllowed(jakarta.servlet.http.HttpServletRequest request, String method, Map<String,HttpConsumer> consumers)
      Checks if the http request method (GET, POST, etc) would be allow among the registered consumers.
      Parameters:
      request - the http request
      method - the http method
      consumers - the map of registered consumers
      Returns:
      true if the method is allowed and can be serviced. Otherwise a HttpServletResponse.SC_METHOD_NOT_ALLOWED is returned to the client.