- 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 Summary
Modifier and TypeMethodDescriptiondefault HttpRouting.Builder
addFeature
(HttpFeature feature) Add a new feature.addFeature
(Supplier<? extends HttpFeature> feature) Add a new feature.Add a new filter.default HttpRouting.Builder
Add a route that executes on any HTTP method and any path.default HttpRouting.Builder
Add a route that executes on any HTTP method and any path.copy()
Create a copy of this builder that has the same routes, but is not backed by the same lists/maps.default HttpRouting.Builder
Add a delete route.default HttpRouting.Builder
Add a delete route.<T extends Throwable>
HttpRouting.Buildererror
(Class<T> exceptionClass, ErrorHandler<? super T> handler) Registers an error handler that handles the given type of exceptions.default HttpRouting.Builder
Add a get route.default HttpRouting.Builder
Add a get route.default HttpRouting.Builder
Add a head route.default HttpRouting.Builder
Add a head route.maxReRouteCount
(int maxReRouteCount) Maximal number of allowed re-routes within routing.default HttpRouting.Builder
Add an options route.default HttpRouting.Builder
Add an options route.default HttpRouting.Builder
Add an options route.default HttpRouting.Builder
Add an options route.default HttpRouting.Builder
Add a post route.default HttpRouting.Builder
Add a post route.default HttpRouting.Builder
Add a put route.default HttpRouting.Builder
Add a put route.register
(HttpService... service) Register a service on the current path.register
(String path, HttpService... service) Register a service on sub-path of the current path.default HttpRouting.Builder
register
(String pathPattern, Supplier<? extends HttpService> service) Register a service on sub-path of the current path.default HttpRouting.Builder
register
(String pathPattern, Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2) Register two services on sub-path of the current path.default HttpRouting.Builder
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.default HttpRouting.Builder
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.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) Register five services on sub-path of the current path.default HttpRouting.Builder
register
(String pathPattern, List<Supplier<? extends HttpService>> services) Register services on sub-path of the current path.default HttpRouting.Builder
register
(Supplier<? extends HttpService> service) Register a service on the current path.default HttpRouting.Builder
register
(Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2) Register two services on the current path.default HttpRouting.Builder
register
(Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2, Supplier<? extends HttpService> service3) Register three services on the current path.default HttpRouting.Builder
register
(Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2, Supplier<? extends HttpService> service3, Supplier<? extends HttpService> service4) Register four services on the current path.default HttpRouting.Builder
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.default HttpRouting.Builder
register
(List<Supplier<? extends HttpService>> services) Register services on the current path.default HttpRouting.Builder
route
(Method method, PathMatcher pathMatcher, Handler handler) Add a route.default HttpRouting.Builder
Add a route.default HttpRouting.Builder
Add a route.default HttpRouting.Builder
route
(Method method, String pathPattern, Consumer<ServerRequest> handler) Add a route.default HttpRouting.Builder
route
(Method method, String pathPattern, Function<ServerRequest, ?> handler) Add a route.default HttpRouting.Builder
Add a route.Add a route.default HttpRouting.Builder
route
(Predicate<Method> methodPredicate, PathMatcher pathMatcher, Handler handler) Add a route.default HttpRouting.Builder
Add a route.security
(HttpSecurity security) Configure security for this routing.default HttpRouting.Builder
Add an options route.default HttpRouting.Builder
Add an options route.
-
Method Details
-
register
Description copied from interface:HttpRules
Register a service on the current path. -
register
Description copied from interface:HttpRules
Register a service on the current path. -
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. -
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. -
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. -
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. -
register
Description copied from interface:HttpRules
Register services on the current path. -
register
Description copied from interface:HttpRules
Register a service on sub-path of the current path. -
register
Description copied from interface:HttpRules
Register a service on sub-path of the current path. -
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. -
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. -
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. -
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. -
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. -
route
Description copied from interface:HttpRules
Add a route. This allows also protocol version specific routing. -
route
Description copied from interface:HttpRules
Add a route. This allows also protocol version specific routing. -
route
Description copied from interface:HttpRules
Add a route. -
route
Description copied from interface:HttpRules
Add a route.- Specified by:
route
in interfaceHttpRules
- Parameters:
method
- HTTP method to handlepathMatcher
- URI path matcher, seePathMatchers.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 interfaceHttpRules
- Parameters:
methodPredicate
- HTTP method predicate, seeMethod.predicate(io.helidon.http.Method...)
pathMatcher
- URI path matcher, seePathMatchers.create(String)
handler
- handler to process HTTP request- Returns:
- updated rules
-
route
Description copied from interface:HttpRules
Add a route. -
get
Description copied from interface:HttpRules
Add a get route. -
get
Description copied from interface:HttpRules
Add a get route. -
post
Description copied from interface:HttpRules
Add a post route. -
post
Description copied from interface:HttpRules
Add a post route. -
put
Description copied from interface:HttpRules
Add a put route. -
put
Description copied from interface:HttpRules
Add a put route. -
delete
Description copied from interface:HttpRules
Add a delete route. -
delete
Description copied from interface:HttpRules
Add a delete route. -
head
Description copied from interface:HttpRules
Add a head route. -
head
Description copied from interface:HttpRules
Add a head route. -
options
Description copied from interface:HttpRules
Add an options route. -
options
Description copied from interface:HttpRules
Add an options route. -
trace
Description copied from interface:HttpRules
Add an options route. -
trace
Description copied from interface:HttpRules
Add an options route. -
patch
Description copied from interface:HttpRules
Add an options route. -
patch
Description copied from interface:HttpRules
Add an options route. -
any
Description copied from interface:HttpRules
Add a route that executes on any HTTP method and any path. -
any
Description copied from interface:HttpRules
Add a route that executes on any HTTP method and any path. -
route
default HttpRouting.Builder route(Method method, String pathPattern, Consumer<ServerRequest> handler) Description copied from interface:HttpRules
Add a route.- Specified by:
route
in interfaceHttpRules
- Parameters:
method
- HTTP method to handlepathPattern
- URI path patternhandler
- handler as a consumer ofServerRequest
- 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 interfaceHttpRules
- Parameters:
method
- HTTP method to handlepathPattern
- URI path patternhandler
- handler as a function that getsServerRequest
and returns an entity- Returns:
- updated builder
-
route
Description copied from interface:HttpRules
Add a route. -
addFilter
Add a new filter.- Parameters:
filter
- filter to add- Returns:
- updated builder
-
addFeature
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
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 handlerhandler
- the error handler- Returns:
- updated builder
-
maxReRouteCount
Maximal number of allowed re-routes within routing.- Parameters:
maxReRouteCount
- maximum number of allowed reroutes- Returns:
- updated builder
- See Also:
-
security
Configure security for this routing.- Parameters:
security
- security to use- Returns:
- updated builder
-
copy
HttpRouting.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
-