Interface ServletResolveConsumerStrategy

    • Method Detail

      • resolve

        HttpConsumer resolve​(javax.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​(javax.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.