Interface HttpRouting.Builder

All Superinterfaces:
Builder<HttpRouting.Builder,HttpRouting>, HttpRules, Supplier<HttpRouting>
Enclosing interface:
HttpRouting

public static interface HttpRouting.Builder extends HttpRules, Builder<HttpRouting.Builder,HttpRouting>
Fluent API builder for HttpRouting.
  • Method Details

    • register

      HttpRouting.Builder register(HttpService... service)
      Description copied from interface: HttpRules
      Register a service on the current path.
      Specified by:
      register in interface HttpRules
      Parameters:
      service - service to register
      Returns:
      updated rules
    • register

      default HttpRouting.Builder register(Supplier<? extends HttpService> service)
      Description copied from interface: HttpRules
      Register a service on the current path.
      Specified by:
      register in interface HttpRules
      Parameters:
      service - service to register
      Returns:
      updated rules
    • register

      default HttpRouting.Builder register(Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2)
      Description copied from interface: HttpRules
      Register two services on the current path.
      Specified by:
      register in interface HttpRules
      Parameters:
      service1 - first service to register
      service2 - second service to register
      Returns:
      updated rules
    • register

      default HttpRouting.Builder register(Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2, Supplier<? extends HttpService> service3)
      Description copied from interface: HttpRules
      Register three services on the current path.
      Specified by:
      register in interface HttpRules
      Parameters:
      service1 - first service to register
      service2 - second service to register
      service3 - third service to register
      Returns:
      updated rules
    • register

      default HttpRouting.Builder register(Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2, Supplier<? extends HttpService> service3, Supplier<? extends HttpService> service4)
      Description copied from interface: HttpRules
      Register four services on the current path.
      Specified by:
      register in interface HttpRules
      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 HttpRouting.Builder register(Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2, Supplier<? extends HttpService> service3, Supplier<? extends HttpService> service4, Supplier<? extends HttpService> service5)
      Description copied from interface: HttpRules
      Register five services on the current path.
      Specified by:
      register in interface HttpRules
      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 HttpRouting.Builder register(List<Supplier<? extends HttpService>> services)
      Description copied from interface: HttpRules
      Register services on the current path.
      Specified by:
      register in interface HttpRules
      Parameters:
      services - services to register
      Returns:
      updated rules
    • register

      HttpRouting.Builder register(String path, HttpService... service)
      Description copied from interface: HttpRules
      Register a service on sub-path of the current path.
      Specified by:
      register in interface HttpRules
      Parameters:
      path - URI path pattern
      service - service to register
      Returns:
      updated rules
    • register

      default HttpRouting.Builder register(String pathPattern, Supplier<? extends HttpService> service)
      Description copied from interface: HttpRules
      Register a service on sub-path of the current path.
      Specified by:
      register in interface HttpRules
      Parameters:
      pathPattern - URI path pattern
      service - service to register
      Returns:
      updated rules
    • register

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

      default HttpRouting.Builder register(String pathPattern, Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2, Supplier<? extends HttpService> service3)
      Description copied from interface: HttpRules
      Register three services on sub-path of the current path.
      Specified by:
      register in interface HttpRules
      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 HttpRouting.Builder register(String pathPattern, Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2, Supplier<? extends HttpService> service3, Supplier<? extends HttpService> service4)
      Description copied from interface: HttpRules
      Register four services on sub-path of the current path.
      Specified by:
      register in interface HttpRules
      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 HttpRouting.Builder register(String pathPattern, Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2, Supplier<? extends HttpService> service3, Supplier<? extends HttpService> service4, Supplier<? extends HttpService> service5)
      Description copied from interface: HttpRules
      Register five services on sub-path of the current path.
      Specified by:
      register in interface HttpRules
      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 HttpRouting.Builder register(String pathPattern, List<Supplier<? extends HttpService>> services)
      Description copied from interface: HttpRules
      Register services on sub-path of the current path.
      Specified by:
      register in interface HttpRules
      Parameters:
      pathPattern - URI path pattern
      services - services to register
      Returns:
      updated rules
    • route

      Description copied from interface: HttpRules
      Add a route. This allows also protocol version specific routing.
      Specified by:
      route in interface HttpRules
      Parameters:
      route - route to add
      Returns:
      updated rules
    • route

      default HttpRouting.Builder route(Supplier<? extends HttpRoute> route)
      Description copied from interface: HttpRules
      Add a route. This allows also protocol version specific routing.
      Specified by:
      route in interface HttpRules
      Parameters:
      route - route to add
      Returns:
      updated rules
    • route

      default HttpRouting.Builder route(Method method, String pathPattern, Handler handler)
      Description copied from interface: HttpRules
      Add a route.
      Specified by:
      route in interface HttpRules
      Parameters:
      method - HTTP method to handle
      pathPattern - URI path pattern
      handler - handler to process HTTP request
      Returns:
      updated rules
    • route

      default HttpRouting.Builder route(Method method, PathMatcher pathMatcher, Handler handler)
      Description copied from interface: HttpRules
      Add a route.
      Specified by:
      route in interface HttpRules
      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 HttpRouting.Builder route(Predicate<Method> methodPredicate, PathMatcher pathMatcher, Handler handler)
      Description copied from interface: HttpRules
      Add a route.
      Specified by:
      route in interface HttpRules
      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 HttpRouting.Builder route(Method method, Handler handler)
      Description copied from interface: HttpRules
      Add a route.
      Specified by:
      route in interface HttpRules
      Parameters:
      method - HTTP method to handle
      handler - handler to process HTTP request
      Returns:
      updated rules
    • get

      default HttpRouting.Builder get(String pathPattern, Handler... handlers)
      Description copied from interface: HttpRules
      Add a get route.
      Specified by:
      get in interface HttpRules
      Parameters:
      pathPattern - URI path pattern
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • get

      default HttpRouting.Builder get(Handler... handlers)
      Description copied from interface: HttpRules
      Add a get route.
      Specified by:
      get in interface HttpRules
      Parameters:
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • post

      default HttpRouting.Builder post(String pathPattern, Handler... handlers)
      Description copied from interface: HttpRules
      Add a post route.
      Specified by:
      post in interface HttpRules
      Parameters:
      pathPattern - URI path pattern
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • post

      default HttpRouting.Builder post(Handler... handlers)
      Description copied from interface: HttpRules
      Add a post route.
      Specified by:
      post in interface HttpRules
      Parameters:
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • put

      default HttpRouting.Builder put(String pathPattern, Handler... handlers)
      Description copied from interface: HttpRules
      Add a put route.
      Specified by:
      put in interface HttpRules
      Parameters:
      pathPattern - URI path pattern
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • put

      default HttpRouting.Builder put(Handler... handlers)
      Description copied from interface: HttpRules
      Add a put route.
      Specified by:
      put in interface HttpRules
      Parameters:
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • delete

      default HttpRouting.Builder delete(String pathPattern, Handler... handlers)
      Description copied from interface: HttpRules
      Add a delete route.
      Specified by:
      delete in interface HttpRules
      Parameters:
      pathPattern - URI path pattern
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • delete

      default HttpRouting.Builder delete(Handler... handlers)
      Description copied from interface: HttpRules
      Add a delete route.
      Specified by:
      delete in interface HttpRules
      Parameters:
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • head

      default HttpRouting.Builder head(String pathPattern, Handler... handlers)
      Description copied from interface: HttpRules
      Add a head route.
      Specified by:
      head in interface HttpRules
      Parameters:
      pathPattern - URI path pattern
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • head

      default HttpRouting.Builder head(Handler... handlers)
      Description copied from interface: HttpRules
      Add a head route.
      Specified by:
      head in interface HttpRules
      Parameters:
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • options

      default HttpRouting.Builder options(String pathPattern, Handler... handlers)
      Description copied from interface: HttpRules
      Add an options route.
      Specified by:
      options in interface HttpRules
      Parameters:
      pathPattern - URI path pattern
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • options

      default HttpRouting.Builder options(Handler... handlers)
      Description copied from interface: HttpRules
      Add an options route.
      Specified by:
      options in interface HttpRules
      Parameters:
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • trace

      default HttpRouting.Builder trace(String pathPattern, Handler... handlers)
      Description copied from interface: HttpRules
      Add an options route.
      Specified by:
      trace in interface HttpRules
      Parameters:
      pathPattern - URI path pattern
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • trace

      default HttpRouting.Builder trace(Handler... handlers)
      Description copied from interface: HttpRules
      Add an options route.
      Specified by:
      trace in interface HttpRules
      Parameters:
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • patch

      default HttpRouting.Builder patch(String pathPattern, Handler... handlers)
      Description copied from interface: HttpRules
      Add an options route.
      Specified by:
      patch in interface HttpRules
      Parameters:
      pathPattern - URI path pattern
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • patch

      default HttpRouting.Builder patch(Handler... handlers)
      Description copied from interface: HttpRules
      Add an options route.
      Specified by:
      patch in interface HttpRules
      Parameters:
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • any

      default HttpRouting.Builder any(String pathPattern, Handler... handlers)
      Description copied from interface: HttpRules
      Add a route that executes on any HTTP method and any path.
      Specified by:
      any in interface HttpRules
      Parameters:
      pathPattern - URI path pattern
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • any

      default HttpRouting.Builder any(Handler... handlers)
      Description copied from interface: HttpRules
      Add a route that executes on any HTTP method and any path.
      Specified by:
      any in interface HttpRules
      Parameters:
      handlers - handlers to process HTTP request
      Returns:
      updated rules
    • route

      default HttpRouting.Builder route(Method method, String pathPattern, Consumer<ServerRequest> handler)
      Description copied from interface: HttpRules
      Add a route.
      Specified by:
      route in interface HttpRules
      Parameters:
      method - HTTP method to handle
      pathPattern - URI path pattern
      handler - handler as a consumer of ServerRequest
      Returns:
      updated builder
    • route

      default HttpRouting.Builder route(Method method, String pathPattern, Function<ServerRequest,?> handler)
      Description copied from interface: HttpRules
      Add a route.
      Specified by:
      route in interface HttpRules
      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 HttpRouting.Builder route(Method method, String pathPattern, Supplier<?> handler)
      Description copied from interface: HttpRules
      Add a route.
      Specified by:
      route in interface HttpRules
      Parameters:
      method - HTTP method to handle
      pathPattern - URI path pattern
      handler - supplier of entity
      Returns:
      updated builder
    • addFilter

      HttpRouting.Builder addFilter(Filter filter)
      Add a new filter.
      Parameters:
      filter - filter to add
      Returns:
      updated builder
    • addFeature

      default HttpRouting.Builder addFeature(HttpFeature feature)
      Add a new feature. If a feature is added from within a feature, it will inherit weight of the feature adding it and will be fully registered at the same time.
      Parameters:
      feature - feature to add
      Returns:
      updated builder
    • addFeature

      HttpRouting.Builder addFeature(Supplier<? extends HttpFeature> feature)
      Add a new feature. If a feature is added from within a feature, it will inherit weight of the feature adding it and will be fully registered at the same time.
      Parameters:
      feature - feature to add
      Returns:
      updated builder
    • error

      <T extends Throwable> HttpRouting.Builder error(Class<T> exceptionClass, ErrorHandler<? super T> handler)
      Registers an error handler that handles the given type of exceptions. This will replace an existing error handler for the same exception class.
      Type Parameters:
      T - exception type
      Parameters:
      exceptionClass - the type of exception to handle by this handler
      handler - the error handler
      Returns:
      updated builder
    • maxReRouteCount

      HttpRouting.Builder maxReRouteCount(int maxReRouteCount)
      Maximal number of allowed re-routes within routing.
      Parameters:
      maxReRouteCount - maximum number of allowed reroutes
      Returns:
      updated builder
      See Also:
    • security

      HttpRouting.Builder security(HttpSecurity security)
      Configure security for this routing.
      Parameters:
      security - security to use
      Returns:
      updated builder
    • copy

      Create a copy of this builder that has the same routes, but is not backed by the same lists/maps. Modifications to the routes of the copy will not modify routes of this builder.
      Returns:
      builder that is a copy of this builder