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 newWebServer
instance 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.Rules
Configuration 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:
register
in interfaceRouting.Rules
- Parameters:
webTracingConfig
- WebServer tracing configuration- Returns:
- Updated routing configuration
-
register
Description copied from interface:Routing.Rules
Registers builder consumer. It enables to separate complex routing definitions to dedicated classes.- Specified by:
register
in 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.Rules
Registers builder consumer. It enables to separate complex routing definitions to dedicated classes.- Specified by:
register
in interfaceRouting.Rules
- Parameters:
services
- services to register- Returns:
- Updated routing configuration
-
register
Description copied from interface:Routing.Rules
Registers builder consumer. It enables to separate complex routing definitions to dedicated classes.- Specified by:
register
in interfaceRouting.Rules
- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for pattern syntax reference.services
- services to register- Returns:
- Updated routing configuration
-
register
Description copied from interface:Routing.Rules
Registers builder consumer. It enables to separate complex routing definitions to dedicated classes.- Specified by:
register
in interfaceRouting.Rules
- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for 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.Rules
Routes all GET requests to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
get
in interfaceRouting.Rules
- Parameters:
requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
get
Description copied from interface:Routing.Rules
Routes GET requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
get
in interfaceRouting.Rules
- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for pattern syntax reference.requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
route
Description copied from interface:Routing.Rules
Add a route. This allows also protocol version specific routing.- Specified by:
route
in interfaceRouting.Rules
- Parameters:
route
- route to add- Returns:
- updated rules
-
get
Description copied from interface:Routing.Rules
Routes GET requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
get
in interfaceRouting.Rules
- Parameters:
pathMatcher
- a URI path pattern. SeePathMatcher
for pattern syntax reference.requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
put
Description copied from interface:Routing.Rules
Routes all PUT requests to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
put
in interfaceRouting.Rules
- Parameters:
requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
put
Description copied from interface:Routing.Rules
Routes PUT requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
put
in interfaceRouting.Rules
- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for pattern syntax reference.requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
put
Description copied from interface:Routing.Rules
Routes PUT requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
put
in 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.Rules
Routes all POST requests to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
post
in interfaceRouting.Rules
- Parameters:
requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
post
Description copied from interface:Routing.Rules
Routes POST requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
post
in interfaceRouting.Rules
- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for pattern syntax reference.requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
post
Description copied from interface:Routing.Rules
Routes POST requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
post
in 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.Rules
Routes all RFC 5789 PATCH requests to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
patch
in interfaceRouting.Rules
- Parameters:
requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
patch
Description copied from interface:Routing.Rules
Routes 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:
patch
in interfaceRouting.Rules
- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for pattern syntax reference.requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
patch
Description copied from interface:Routing.Rules
Routes 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:
patch
in 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.Rules
Routes all DELETE requests to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
delete
in interfaceRouting.Rules
- Parameters:
requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
delete
Description copied from interface:Routing.Rules
Routes DELETE requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
delete
in interfaceRouting.Rules
- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for pattern syntax reference.requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
delete
Description copied from interface:Routing.Rules
Routes DELETE requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
delete
in 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.Rules
Routes all OPTIONS requests to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
options
in interfaceRouting.Rules
- Parameters:
requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
options
Description copied from interface:Routing.Rules
Routes OPTIONS requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
options
in interfaceRouting.Rules
- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for pattern syntax reference.requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
options
Description copied from interface:Routing.Rules
Routes OPTIONS requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
options
in 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.Rules
Routes all HEAD requests to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
head
in interfaceRouting.Rules
- Parameters:
requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
head
Description copied from interface:Routing.Rules
Routes HEAD requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
head
in interfaceRouting.Rules
- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for pattern syntax reference.requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
head
Description copied from interface:Routing.Rules
Routes HEAD requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
head
in 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.Rules
Routes all TRACE requests to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
trace
in interfaceRouting.Rules
- Parameters:
requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
trace
Description copied from interface:Routing.Rules
Routes TRACE requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
trace
in interfaceRouting.Rules
- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for pattern syntax reference.requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
trace
Description copied from interface:Routing.Rules
Routes TRACE requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
trace
in 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.Rules
Routes all requests to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
any
in interfaceRouting.Rules
- Parameters:
requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
any
Description copied from interface:Routing.Rules
Routes all requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
any
in interfaceRouting.Rules
- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for pattern syntax reference.requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
any
Description copied from interface:Routing.Rules
Routes all requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
any
in 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.Rules
Routes requests any specified method to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Specified by:
anyOf
in 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.Rules
Routes 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:
anyOf
in interfaceRouting.Rules
- Parameters:
methods
- HTTP methodspathPattern
- a URI path pattern. SeePathMatcher
for 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.Rules
Routes 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:
anyOf
in 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.Rules
Registers callback on created newWebServer
instance with this routing.- Specified by:
onNewWebServer
in 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:
build
in interfaceBuilder<Routing.Builder,
Routing> - Returns:
- a new instance
-