Interface HttpRouting.Builder
- All Superinterfaces:
Builder<HttpRouting.Builder, HttpRouting>, HttpRules, Supplier<HttpRouting>
- Enclosing interface:
HttpRouting
HttpRouting.-
Method Summary
Modifier and TypeMethodDescriptiondefault HttpRouting.BuilderaddFeature(HttpFeature feature) Add a new feature.addFeature(Supplier<? extends HttpFeature> feature) Add a new feature.Add a new filter.default HttpRouting.BuilderAdd a route that executes on any HTTP method and any path.default HttpRouting.BuilderAdd 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.BuilderAdd a delete route.default HttpRouting.BuilderAdd 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.BuilderAdd a get route.default HttpRouting.BuilderAdd a get route.default HttpRouting.BuilderAdd a head route.default HttpRouting.BuilderAdd a head route.maxReRouteCount(int maxReRouteCount) Maximal number of allowed re-routes within routing.default HttpRouting.BuilderAdd an options route.default HttpRouting.BuilderAdd an options route.default HttpRouting.BuilderAdd an options route.default HttpRouting.BuilderAdd an options route.default HttpRouting.BuilderAdd a post route.default HttpRouting.BuilderAdd a post route.default HttpRouting.BuilderAdd a put route.default HttpRouting.BuilderAdd 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.Builderregister(String pathPattern, Supplier<? extends HttpService> service) Register a service on sub-path of the current path.default HttpRouting.Builderregister(String pathPattern, Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2) Register two services on sub-path of the current path.default HttpRouting.Builderregister(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.Builderregister(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.Builderregister(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.Builderregister(String pathPattern, List<Supplier<? extends HttpService>> services) Register services on sub-path of the current path.default HttpRouting.Builderregister(Supplier<? extends HttpService> service) Register a service on the current path.default HttpRouting.Builderregister(Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2) Register two services on the current path.default HttpRouting.Builderregister(Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2, Supplier<? extends HttpService> service3) Register three services on the current path.default HttpRouting.Builderregister(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.Builderregister(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.Builderregister(List<Supplier<? extends HttpService>> services) Register services on the current path.default HttpRouting.BuilderregisterLocator(HttpServiceLocator locator) Register a service locator on the current path.default HttpRouting.BuilderregisterLocator(String pathPattern, HttpServiceLocator locator) Register a service locator on sub-path of the current path.default HttpRouting.Builderroute(Method method, PathMatcher pathMatcher, Handler handler) Add a route.default HttpRouting.BuilderAdd a route.default HttpRouting.BuilderAdd a route.default HttpRouting.Builderroute(Method method, String pathPattern, Consumer<ServerRequest> handler) Add a route.default HttpRouting.Builderroute(Method method, String pathPattern, Function<ServerRequest, ?> handler) Add a route.default HttpRouting.BuilderAdd a route.Add a route.default HttpRouting.Builderroute(Predicate<Method> methodPredicate, PathMatcher pathMatcher, Handler handler) Add a route.default HttpRouting.BuilderAdd a route.security(HttpSecurity security) Configure security for this routing.default HttpRouting.BuilderAdd an options route.default HttpRouting.BuilderAdd an options route.Methods inherited from interface Builder
build, get, identity, updateModifier and TypeMethodDescriptionbuild()Build the instance from this builder.default HttpRoutingget()default HttpRouting.Builderidentity()Instance of this builder as the correct type.default HttpRouting.Builderupdate(Consumer<HttpRouting.Builder> consumer) Update the builder in a fluent API way.
-
Method Details
-
register
Description copied from interface:HttpRulesRegister a service on the current path. -
registerLocator
Description copied from interface:HttpRulesRegister a service locator on the current path.Unlike
HttpRules.register(Supplier), the locator is invoked at request time after the current path matches. If the locator returnsOptional.empty(), routing continues with the next available route. Located services are cached by service instance identity up toHttpServiceLocator.maxServiceCacheSize().- Specified by:
registerLocatorin interfaceHttpRules- Parameters:
locator- service locator to register- Returns:
- updated rules
-
register
Description copied from interface:HttpRulesRegister a service on the current path.The supplier is invoked when the service is registered, not for each request.
-
register
default HttpRouting.Builder register(Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2) Description copied from interface:HttpRulesRegister 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:HttpRulesRegister 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:HttpRulesRegister 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:HttpRulesRegister five services on the current path. -
register
Description copied from interface:HttpRulesRegister services on the current path. -
register
Description copied from interface:HttpRulesRegister a service on sub-path of the current path. -
registerLocator
Description copied from interface:HttpRulesRegister a service locator on sub-path of the current path.Unlike
HttpRules.register(String, Supplier), the locator is invoked at request time after the provided path pattern matches. Path parameters from the matched pattern are available fromServerRequest.path()before the locator is invoked. If the locator returnsOptional.empty(), routing continues with the next available route. Located services are cached by service instance identity up toHttpServiceLocator.maxServiceCacheSize().- Specified by:
registerLocatorin interfaceHttpRules- Parameters:
pathPattern- URI path patternlocator- service locator to register- Returns:
- updated rules
-
register
Description copied from interface:HttpRulesRegister a service on sub-path of the current path.The supplier is invoked when the service is registered, not for each request.
-
register
default HttpRouting.Builder register(String pathPattern, Supplier<? extends HttpService> service1, Supplier<? extends HttpService> service2) Description copied from interface:HttpRulesRegister 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:HttpRulesRegister 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:HttpRulesRegister 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:HttpRulesRegister 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:HttpRulesRegister services on sub-path of the current path. -
route
Description copied from interface:HttpRulesAdd a route. This allows also protocol version specific routing. -
route
-
route
Description copied from interface:HttpRulesAdd a route. -
route
Description copied from interface:HttpRulesAdd a route.- Specified by:
routein 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:HttpRulesAdd a route.- Specified by:
routein 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
-
get
-
get
Description copied from interface:HttpRulesAdd a get route. -
post
-
post
Description copied from interface:HttpRulesAdd a post route. -
put
-
put
Description copied from interface:HttpRulesAdd a put route. -
delete
-
delete
Description copied from interface:HttpRulesAdd a delete route. -
head
-
head
Description copied from interface:HttpRulesAdd a head route. -
options
-
options
Description copied from interface:HttpRulesAdd an options route. -
trace
-
trace
Description copied from interface:HttpRulesAdd an options route. -
patch
-
patch
Description copied from interface:HttpRulesAdd an options route. -
any
Description copied from interface:HttpRulesAdd a route that executes on any HTTP method and any path. -
any
Description copied from interface:HttpRulesAdd 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:HttpRulesAdd a route.- Specified by:
routein 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:HttpRulesAdd a route.- Specified by:
routein interfaceHttpRules- Parameters:
method- HTTP method to handlepathPattern- URI path patternhandler- handler as a function that getsServerRequestand returns an entity- Returns:
- updated builder
-
route
Description copied from interface:HttpRulesAdd 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
-