Interface HttpRules

All Known Subinterfaces:
HttpRouting.Builder

public interface HttpRules
HTTP Routing rules, used by both HttpRouting.Builder and by HttpService.routing(HttpRules).
  • Method Details

    • register

      HttpRules register(HttpService... service)
      Register a service on the current path.
      Parameters:
      service - service to register
      Returns:
      updated rules
    • register

      default HttpRules register(Supplier<? extends HttpService> service)
      Register a service on the current path.
      Parameters:
      service - service to register
      Returns:
      updated rules
    • register

      default HttpRules register(Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2)
      Register two services on the current path.
      Parameters:
      service1 - first service to register
      service2 - second service to register
      Returns:
      updated rules
    • register

      default HttpRules register(Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2, Supplier<? extends HttpService> service3)
      Register three services on the current path.
      Parameters:
      service1 - first service to register
      service2 - second service to register
      service3 - third service to register
      Returns:
      updated rules
    • register

      default HttpRules register(Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2, Supplier<? extends HttpService> service3, Supplier<? extends HttpService> service4)
      Register four services on the current path.
      Parameters:
      service1 - first service to register
      service2 - second service to register
      service3 - third service to register
      service4 - fourth service to register
      Returns:
      updated rules
    • register

      default HttpRules register(Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2, Supplier<? extends HttpService> service3, Supplier<? extends HttpService> service4, Supplier<? extends HttpService> service5)
      Register five services on the current path.
      Parameters:
      service1 - first service to register
      service2 - second service to register
      service3 - third service to register
      service4 - fourth service to register
      service5 - fifth service to register
      Returns:
      updated rules
    • register

      default HttpRules register(List<Supplier<? extends HttpService>> services)
      Register services on the current path.
      Parameters:
      services - services to register
      Returns:
      updated rules
    • register

      HttpRules register(String pathPattern, HttpService... service)
      Register a service on sub-path of the current path.
      Parameters:
      pathPattern - URI path pattern
      service - service to register
      Returns:
      updated rules
    • register

      default HttpRules register(String pathPattern, Supplier<? extends HttpService> service)
      Register a service on sub-path of the current path.
      Parameters:
      pathPattern - URI path pattern
      service - service to register
      Returns:
      updated rules
    • register

      default HttpRules register(String pathPattern, Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2)
      Register two services on sub-path of the current path.
      Parameters:
      pathPattern - URI path pattern
      service1 - first service to register
      service2 - second service to register
      Returns:
      updated rules
    • register

      default HttpRules register(String pathPattern, Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2, Supplier<? extends HttpService> service3)
      Register three services on sub-path of the current path.
      Parameters:
      pathPattern - URI path pattern
      service1 - first service to register
      service2 - second service to register
      service3 - third service to register
      Returns:
      updated rules
    • register

      default HttpRules register(String pathPattern, Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2, Supplier<? extends HttpService> service3, Supplier<? extends HttpService> service4)
      Register four services on sub-path of the current path.
      Parameters:
      pathPattern - URI path pattern
      service1 - first service to register
      service2 - second service to register
      service3 - third service to register
      service4 - fourth service to register
      Returns:
      updated rules
    • register

      default HttpRules register(String pathPattern, Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2, Supplier<? extends HttpService> service3, Supplier<? extends HttpService> service4, Supplier<? extends HttpService> service5)
      Register five services on sub-path of the current path.
      Parameters:
      pathPattern - URI path pattern
      service1 - first service to register
      service2 - second service to register
      service3 - third service to register
      service4 - fourth service to register
      service5 - fifth service to register
      Returns:
      updated rules
    • register

      default HttpRules register(String pathPattern, List<Supplier<? extends HttpService>> services)
      Register services on sub-path of the current path.
      Parameters:
      pathPattern - URI path pattern
      services - services to register
      Returns:
      updated rules
    • route

      HttpRules route(HttpRoute route)
      Add a route. This allows also protocol version specific routing.
      Parameters:
      route - route to add
      Returns:
      updated rules
    • route

      default HttpRules route(Supplier<? extends HttpRoute> route)
      Add a route. This allows also protocol version specific routing.
      Parameters:
      route - route to add
      Returns:
      updated rules
    • route

      default HttpRules route(Method method, String pathPattern, Handler handler)
      Add a route.
      Parameters:
      method - HTTP method to handle
      pathPattern - URI path pattern
      handler - handler to process HTTP request
      Returns:
      updated rules
    • route

      default HttpRules route(Method method, PathMatcher pathMatcher, Handler handler)
      Add a route.
      Parameters:
      method - HTTP method to handle
      pathMatcher - URI path matcher, see PathMatchers.create(String)
      handler - handler to process HTTP request
      Returns:
      updated rules
    • route

      default HttpRules route(Predicate<Method> methodPredicate, PathMatcher pathMatcher, Handler handler)
      Add a route.
      Parameters:
      methodPredicate - HTTP method predicate, see Method.predicate(io.helidon.http.Method...)
      pathMatcher - URI path matcher, see PathMatchers.create(String)
      handler - handler to process HTTP request
      Returns:
      updated rules
    • route

      default HttpRules route(Method method, Handler handler)
      Add a route.
      Parameters:
      method - HTTP method to handle
      handler - handler to process HTTP request
      Returns:
      updated rules
    • get

      default HttpRules get(String pathPattern, Handler... handlers)
      Add a get route.
      Parameters:
      pathPattern - URI path pattern
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • get

      default HttpRules get(Handler... handlers)
      Add a get route.
      Parameters:
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • post

      default HttpRules post(String pathPattern, Handler... handlers)
      Add a post route.
      Parameters:
      pathPattern - URI path pattern
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • post

      default HttpRules post(Handler... handlers)
      Add a post route.
      Parameters:
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • put

      default HttpRules put(String pathPattern, Handler... handlers)
      Add a put route.
      Parameters:
      pathPattern - URI path pattern
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • put

      default HttpRules put(Handler... handlers)
      Add a put route.
      Parameters:
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • delete

      default HttpRules delete(String pathPattern, Handler... handlers)
      Add a delete route.
      Parameters:
      pathPattern - URI path pattern
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • delete

      default HttpRules delete(Handler... handlers)
      Add a delete route.
      Parameters:
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • head

      default HttpRules head(String pathPattern, Handler... handlers)
      Add a head route.
      Parameters:
      pathPattern - URI path pattern
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • head

      default HttpRules head(Handler... handlers)
      Add a head route.
      Parameters:
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • options

      default HttpRules options(String pathPattern, Handler... handlers)
      Add an options route.
      Parameters:
      pathPattern - URI path pattern
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • options

      default HttpRules options(Handler... handlers)
      Add an options route.
      Parameters:
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • trace

      default HttpRules trace(String pathPattern, Handler... handlers)
      Add an options route.
      Parameters:
      pathPattern - URI path pattern
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • trace

      default HttpRules trace(Handler... handlers)
      Add an options route.
      Parameters:
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • patch

      default HttpRules patch(String pathPattern, Handler... handlers)
      Add an options route.
      Parameters:
      pathPattern - URI path pattern
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • patch

      default HttpRules patch(Handler... handlers)
      Add an options route.
      Parameters:
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • any

      default HttpRules any(String pathPattern, Handler... handlers)
      Add a route that executes on any HTTP method and any path.
      Parameters:
      pathPattern - URI path pattern
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • any

      default HttpRules any(Handler... handlers)
      Add a route that executes on any HTTP method and any path.
      Parameters:
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • route

      default HttpRules route(Method method, String pathPattern, Consumer<ServerRequest> handler)
      Add a route.
      Parameters:
      method - HTTP method to handle
      pathPattern - URI path pattern
      handler - handler as a consumer of ServerRequest
      Returns:
      updated builder
    • route

      default HttpRules route(Method method, String pathPattern, Function<ServerRequest,?> handler)
      Add a route.
      Parameters:
      method - HTTP method to handle
      pathPattern - URI path pattern
      handler - handler as a function that gets ServerRequest and returns an entity
      Returns:
      updated builder
    • route

      default HttpRules route(Method method, String pathPattern, Supplier<?> handler)
      Add a route.
      Parameters:
      method - HTTP method to handle
      pathPattern - URI path pattern
      handler - supplier of entity
      Returns:
      updated builder