- All Known Implementing Classes:
Routing.Builder
- Enclosing interface:
- Routing
public static interface Routing.Rules
An API to define HTTP request routing rules.
- See Also:
-
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).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).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
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.- Parameters:
webTracingConfig
- WebServer tracing configuration- Returns:
- Updated routing configuration
-
register
Registers builder consumer. It enables to separate complex routing definitions to dedicated classes.- Parameters:
services
- services to register- Returns:
- Updated routing configuration
-
register
Registers builder consumer. It enables to separate complex routing definitions to dedicated classes.- Parameters:
serviceBuilders
- service builder to register; they will be built as a first step of this method execution- Returns:
- Updated routing configuration
-
register
Registers builder consumer. It enables to separate complex routing definitions to dedicated classes.- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for pattern syntax reference.services
- services to register- Returns:
- Updated routing configuration
-
register
Registers builder consumer. It enables to separate complex routing definitions to dedicated classes.- 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
Routes all GET requests to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
get
Routes GET requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for pattern syntax reference.requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
route
Add a route. This allows also protocol version specific routing.- Parameters:
route
- route to add- Returns:
- updated rules
-
get
Routes GET requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
pathMatcher
- a URI path pattern. SeePathMatcher
for pattern syntax reference.requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
put
Routes all PUT requests to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
put
Routes PUT requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for pattern syntax reference.requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
put
Routes PUT requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
pathMatcher
- define path for a registered routerrequestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
post
Routes all POST requests to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
post
Routes POST requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for pattern syntax reference.requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
post
Routes POST requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
pathMatcher
- define path for registered routerrequestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
patch
Routes all RFC 5789 PATCH requests to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
patch
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.- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for pattern syntax reference.requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
patch
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.- Parameters:
pathMatcher
- define path for registered routerrequestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
delete
Routes all DELETE requests to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
delete
Routes DELETE requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for pattern syntax reference.requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
delete
Routes DELETE requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
pathMatcher
- define path for registered routerrequestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
options
Routes all OPTIONS requests to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
options
Routes OPTIONS requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for pattern syntax reference.requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
options
Routes OPTIONS requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
pathMatcher
- define path for registered routerrequestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
head
Routes all HEAD requests to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
head
Routes HEAD requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for pattern syntax reference.requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
head
Routes HEAD requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
pathMatcher
- define path for registered routerrequestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
trace
Routes all TRACE requests to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
trace
Routes TRACE requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for pattern syntax reference.requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
trace
Routes TRACE requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
pathMatcher
- define path for registered routerrequestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
any
Routes all requests to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
any
Routes all requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
pathPattern
- a URI path pattern. SeePathMatcher
for pattern syntax reference.requestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
any
Routes all requests with corresponding path to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
pathMatcher
- define path for registered routerrequestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
anyOf
Routes requests any specified method to provided handler(s). Request handler can callServerRequest.next()
to continue processing on the next registered handler.- Parameters:
methods
- HTTP methodsrequestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
anyOf
Routing.Rules anyOf(Iterable<Http.RequestMethod> methods, String pathPattern, Handler... requestHandlers) 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.- 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
Routing.Rules anyOf(Iterable<Http.RequestMethod> methods, PathMatcher pathMatcher, Handler... requestHandlers) 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.- Parameters:
methods
- HTTP methodspathMatcher
- define path for registered routerrequestHandlers
- handlers to process HTTP request- Returns:
- an updated routing configuration
-
onNewWebServer
Registers callback on created newWebServer
instance with this routing.- Parameters:
webServerConsumer
- a WebServer creation callback- Returns:
- updated routing configuration
-