java.lang.Object
io.helidon.webserver.Routing.Builder
- All Implemented Interfaces:
Builder<Routing.Builder,,Routing> Routing.Rules,Supplier<Routing>
- Enclosing interface:
- Routing
public static class Routing.Builder
extends Object
implements Routing.Rules, Builder<Routing.Builder,Routing>
A
Routing builder.-
Method Summary
Modifier and TypeMethodDescriptionRoutes all requests to provided handler(s).any(PathMatcher pathMatcher, Handler... requestHandlers) Routes all requests with corresponding path to provided handler(s).Routes all requests with corresponding path to provided handler(s).anyOf(Iterable<Http.RequestMethod> methods, Handler... requestHandlers) Routes requests any specified method to provided handler(s).anyOf(Iterable<Http.RequestMethod> methods, PathMatcher pathMatcher, Handler... requestHandlers) Routes requests with any specified method and corresponding path to provided handler(s).anyOf(Iterable<Http.RequestMethod> methods, String pathPattern, Handler... requestHandlers) Routes requests with any specified method and corresponding path to provided handler(s).build()Builds a new routing instance.Routes all DELETE requests to provided handler(s).delete(PathMatcher pathMatcher, Handler... requestHandlers) Routes DELETE requests with corresponding path to provided handler(s).Routes DELETE requests with corresponding path to provided handler(s).<T extends Throwable>
Routing.Buildererror(Class<T> exceptionClass, ErrorHandler<T> errorHandler) Registers an error handler that handles the given type of exceptions.Routes all GET requests to provided handler(s).get(PathMatcher pathMatcher, Handler... requestHandlers) Routes GET requests with corresponding path to provided handler(s).Routes GET requests with corresponding path to provided handler(s).Routes all HEAD requests to provided handler(s).head(PathMatcher pathMatcher, Handler... requestHandlers) Routes HEAD requests with corresponding path to provided handler(s).Routes HEAD requests with corresponding path to provided handler(s).onNewWebServer(Consumer<WebServer> webServerConsumer) Registers callback on created newWebServerinstance with this routing.Routes all OPTIONS requests to provided handler(s).options(PathMatcher pathMatcher, Handler... requestHandlers) Routes OPTIONS requests with corresponding path to provided handler(s).Routes OPTIONS requests with corresponding path to provided handler(s).Routes all RFC 5789 PATCH requests to provided handler(s).patch(PathMatcher pathMatcher, Handler... requestHandlers) Routes RFC 5789 PATCH requests with corresponding path to provided handler(s).Routes RFC 5789 PATCH requests with corresponding path to provided handler(s).Routes all POST requests to provided handler(s).post(PathMatcher pathMatcher, Handler... requestHandlers) Routes POST requests with corresponding path to provided handler(s).Routes POST requests with corresponding path to provided handler(s).Routes all PUT requests to provided handler(s).put(PathMatcher pathMatcher, Handler... requestHandlers) Routes PUT requests with corresponding path to provided handler(s).Routes PUT requests with corresponding path to provided handler(s).Registers builder consumer.register(WebTracingConfig webTracingConfig) Configuration of tracing for this routing.Registers builder consumer.Registers builder consumer.Registers builder consumer.Add a route.Routes all TRACE requests to provided handler(s).trace(PathMatcher pathMatcher, Handler... requestHandlers) Routes TRACE requests with corresponding path to provided handler(s).Routes TRACE requests with corresponding path to provided handler(s).
-
Method Details
-
register
Description copied from interface:Routing.RulesConfiguration of tracing for this routing. The configuration may control whether to log specific components, spans and span logs, either globally, or for a specific path and method combinations.- Specified by:
registerin interfaceRouting.Rules- Parameters:
webTracingConfig- WebServer tracing configuration- Returns:
- Updated routing configuration
-
register
Description copied from interface:Routing.RulesRegisters builder consumer. It enables to separate complex routing definitions to dedicated classes.- Specified by:
registerin interfaceRouting.Rules- Parameters:
serviceBuilders- service builder to register; they will be built as a first step of this method execution- Returns:
- Updated routing configuration
-
register
Description copied from interface:Routing.RulesRegisters builder consumer. It enables to separate complex routing definitions to dedicated classes.- Specified by:
registerin interfaceRouting.Rules- Parameters:
services- services to register- Returns:
- Updated routing configuration
-
register
Description copied from interface:Routing.RulesRegisters builder consumer. It enables to separate complex routing definitions to dedicated classes.- Specified by:
registerin interfaceRouting.Rules- Parameters:
pathPattern- a URI path pattern. SeePathMatcherfor pattern syntax reference.services- services to register- Returns:
- Updated routing configuration
-
register
Description copied from interface:Routing.RulesRegisters builder consumer. It enables to separate complex routing definitions to dedicated classes.- Specified by:
registerin interfaceRouting.Rules- Parameters:
pathPattern- a URI path pattern. SeePathMatcherfor pattern syntax reference.serviceBuilders- service builder to register; they will be built as a first step of this method execution- Returns:
- an updated routing configuration
-
get
Description copied from interface:Routing.RulesRoutes all GET requests to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
getin interfaceRouting.Rules- Parameters:
requestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
get
Description copied from interface:Routing.RulesRoutes GET requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
getin interfaceRouting.Rules- Parameters:
pathPattern- a URI path pattern. SeePathMatcherfor pattern syntax reference.requestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
route
Description copied from interface:Routing.RulesAdd a route. This allows also protocol version specific routing.- Specified by:
routein interfaceRouting.Rules- Parameters:
route- route to add- Returns:
- updated rules
-
get
Description copied from interface:Routing.RulesRoutes GET requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
getin interfaceRouting.Rules- Parameters:
pathMatcher- a URI path pattern. SeePathMatcherfor pattern syntax reference.requestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
put
Description copied from interface:Routing.RulesRoutes all PUT requests to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
putin interfaceRouting.Rules- Parameters:
requestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
put
Description copied from interface:Routing.RulesRoutes PUT requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
putin interfaceRouting.Rules- Parameters:
pathPattern- a URI path pattern. SeePathMatcherfor pattern syntax reference.requestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
put
Description copied from interface:Routing.RulesRoutes PUT requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
putin interfaceRouting.Rules- Parameters:
pathMatcher- define path for a registered routerrequestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
post
Description copied from interface:Routing.RulesRoutes all POST requests to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
postin interfaceRouting.Rules- Parameters:
requestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
post
Description copied from interface:Routing.RulesRoutes POST requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
postin interfaceRouting.Rules- Parameters:
pathPattern- a URI path pattern. SeePathMatcherfor pattern syntax reference.requestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
post
Description copied from interface:Routing.RulesRoutes POST requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
postin interfaceRouting.Rules- Parameters:
pathMatcher- define path for registered routerrequestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
patch
Description copied from interface:Routing.RulesRoutes all RFC 5789 PATCH requests to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
patchin interfaceRouting.Rules- Parameters:
requestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
patch
Description copied from interface:Routing.RulesRoutes RFC 5789 PATCH requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
patchin interfaceRouting.Rules- Parameters:
pathPattern- a URI path pattern. SeePathMatcherfor pattern syntax reference.requestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
patch
Description copied from interface:Routing.RulesRoutes RFC 5789 PATCH requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
patchin interfaceRouting.Rules- Parameters:
pathMatcher- define path for registered routerrequestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
delete
Description copied from interface:Routing.RulesRoutes all DELETE requests to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
deletein interfaceRouting.Rules- Parameters:
requestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
delete
Description copied from interface:Routing.RulesRoutes DELETE requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
deletein interfaceRouting.Rules- Parameters:
pathPattern- a URI path pattern. SeePathMatcherfor pattern syntax reference.requestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
delete
Description copied from interface:Routing.RulesRoutes DELETE requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
deletein interfaceRouting.Rules- Parameters:
pathMatcher- define path for registered routerrequestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
options
Description copied from interface:Routing.RulesRoutes all OPTIONS requests to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
optionsin interfaceRouting.Rules- Parameters:
requestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
options
Description copied from interface:Routing.RulesRoutes OPTIONS requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
optionsin interfaceRouting.Rules- Parameters:
pathPattern- a URI path pattern. SeePathMatcherfor pattern syntax reference.requestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
options
Description copied from interface:Routing.RulesRoutes OPTIONS requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
optionsin interfaceRouting.Rules- Parameters:
pathMatcher- define path for registered routerrequestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
head
Description copied from interface:Routing.RulesRoutes all HEAD requests to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
headin interfaceRouting.Rules- Parameters:
requestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
head
Description copied from interface:Routing.RulesRoutes HEAD requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
headin interfaceRouting.Rules- Parameters:
pathPattern- a URI path pattern. SeePathMatcherfor pattern syntax reference.requestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
head
Description copied from interface:Routing.RulesRoutes HEAD requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
headin interfaceRouting.Rules- Parameters:
pathMatcher- define path for registered routerrequestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
trace
Description copied from interface:Routing.RulesRoutes all TRACE requests to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
tracein interfaceRouting.Rules- Parameters:
requestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
trace
Description copied from interface:Routing.RulesRoutes TRACE requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
tracein interfaceRouting.Rules- Parameters:
pathPattern- a URI path pattern. SeePathMatcherfor pattern syntax reference.requestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
trace
Description copied from interface:Routing.RulesRoutes TRACE requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
tracein interfaceRouting.Rules- Parameters:
pathMatcher- define path for registered routerrequestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
any
Description copied from interface:Routing.RulesRoutes all requests to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
anyin interfaceRouting.Rules- Parameters:
requestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
any
Description copied from interface:Routing.RulesRoutes all requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
anyin interfaceRouting.Rules- Parameters:
pathPattern- a URI path pattern. SeePathMatcherfor pattern syntax reference.requestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
any
Description copied from interface:Routing.RulesRoutes all requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
anyin interfaceRouting.Rules- Parameters:
pathMatcher- define path for registered routerrequestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
anyOf
Description copied from interface:Routing.RulesRoutes requests any specified method to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
anyOfin interfaceRouting.Rules- Parameters:
methods- HTTP methodsrequestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
anyOf
public Routing.Builder anyOf(Iterable<Http.RequestMethod> methods, String pathPattern, Handler... requestHandlers) Description copied from interface:Routing.RulesRoutes requests with any specified method and corresponding path to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
anyOfin interfaceRouting.Rules- Parameters:
methods- HTTP methodspathPattern- a URI path pattern. SeePathMatcherfor pattern syntax reference.requestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
anyOf
public Routing.Builder anyOf(Iterable<Http.RequestMethod> methods, PathMatcher pathMatcher, Handler... requestHandlers) Description copied from interface:Routing.RulesRoutes requests with any specified method and corresponding path to provided handler(s). Request handler can callServerRequest.next()to continue processing on the next registered handler.- Specified by:
anyOfin interfaceRouting.Rules- Parameters:
methods- HTTP methodspathMatcher- define path for registered routerrequestHandlers- handlers to process HTTP request- Returns:
- an updated routing configuration
-
onNewWebServer
Description copied from interface:Routing.RulesRegisters callback on created newWebServerinstance with this routing.- Specified by:
onNewWebServerin interfaceRouting.Rules- Parameters:
webServerConsumer- a WebServer creation callback- Returns:
- updated routing configuration
-
error
public <T extends Throwable> Routing.Builder error(Class<T> exceptionClass, ErrorHandler<T> errorHandler) Registers an error handler that handles the given type of exceptions.- Type Parameters:
T- an error handler type- Parameters:
exceptionClass- the type of exception to handle by this handlererrorHandler- the error handler- Returns:
- an updated builder
-
build
Builds a new routing instance.- Specified by:
buildin interfaceBuilder<Routing.Builder,Routing> - Returns:
- a new instance
-