public static class Routing.Builder extends java.lang.Object implements Routing.Rules<Routing.Builder>, Builder<Routing>
Routing builder.| Modifier and Type | Method and Description |
|---|---|
Routing.Builder |
any(Handler... requestHandlers)
Routes all requests to provided handler(s).
|
Routing.Builder |
any(PathMatcher pathMatcher,
Handler... requestHandlers)
Routes all requests with corresponding path to provided handler(s).
|
Routing.Builder |
any(java.lang.String pathPattern,
Handler... requestHandlers)
Routes all requests with corresponding path to provided handler(s).
|
Routing.Builder |
anyOf(java.lang.Iterable<Http.RequestMethod> methods,
Handler... requestHandlers)
Routes requests any specified method to provided handler(s).
|
Routing.Builder |
anyOf(java.lang.Iterable<Http.RequestMethod> methods,
PathMatcher pathMatcher,
Handler... requestHandlers)
Routes requests with any specified method and corresponding path to provided handler(s).
|
Routing.Builder |
anyOf(java.lang.Iterable<Http.RequestMethod> methods,
java.lang.String pathPattern,
Handler... requestHandlers)
Routes requests with any specified method and corresponding path to provided handler(s).
|
Routing |
build()
Builds a new routing instance.
|
WebServer |
createServer()
Creates new
WebServer instance with this routing and default configuration. |
WebServer |
createServer(ServerConfiguration.Builder configurationBuilder)
Creates new
WebServer instance with provided configuration and this routing. |
WebServer |
createServer(ServerConfiguration configuration)
Creates new
WebServer instance with provided configuration and this routing. |
Routing.Builder |
delete(Handler... requestHandlers)
Routes all DELETE requests to provided handler(s).
|
Routing.Builder |
delete(PathMatcher pathMatcher,
Handler... requestHandlers)
Routes DELETE requests with corresponding path to provided handler(s).
|
Routing.Builder |
delete(java.lang.String pathPattern,
Handler... requestHandlers)
Routes DELETE requests with corresponding path to provided handler(s).
|
<T extends java.lang.Throwable> |
error(java.lang.Class<T> exceptionClass,
ErrorHandler<T> errorHandler)
Registers an error handler that handles the given type of exceptions.
|
Routing.Builder |
get(Handler... requestHandlers)
Routes all GET requests to provided handler(s).
|
Routing.Builder |
get(PathMatcher pathMatcher,
Handler... requestHandlers)
Routes GET requests with corresponding path to provided handler(s).
|
Routing.Builder |
get(java.lang.String pathPattern,
Handler... requestHandlers)
Routes GET requests with corresponding path to provided handler(s).
|
Routing.Builder |
head(Handler... requestHandlers)
Routes all HEAD requests to provided handler(s).
|
Routing.Builder |
head(PathMatcher pathMatcher,
Handler... requestHandlers)
Routes HEAD requests with corresponding path to provided handler(s).
|
Routing.Builder |
head(java.lang.String pathPattern,
Handler... requestHandlers)
Routes HEAD requests with corresponding path to provided handler(s).
|
Routing.Builder |
onNewWebServer(java.util.function.Consumer<WebServer> webServerConsumer)
Registers callback on created new
WebServer instance with this routing. |
Routing.Builder |
options(Handler... requestHandlers)
Routes all OPTIONS requests to provided handler(s).
|
Routing.Builder |
options(PathMatcher pathMatcher,
Handler... requestHandlers)
Routes OPTIONS requests with corresponding path to provided handler(s).
|
Routing.Builder |
options(java.lang.String pathPattern,
Handler... requestHandlers)
Routes OPTIONS requests with corresponding path to provided handler(s).
|
Routing.Builder |
post(Handler... requestHandlers)
Routes all POST requests to provided handler(s).
|
Routing.Builder |
post(PathMatcher pathMatcher,
Handler... requestHandlers)
Routes POST requests with corresponding path to provided handler(s).
|
Routing.Builder |
post(java.lang.String pathPattern,
Handler... requestHandlers)
Routes POST requests with corresponding path to provided handler(s).
|
Routing.Builder |
put(Handler... requestHandlers)
Routes all PUT requests to provided handler(s).
|
Routing.Builder |
put(PathMatcher pathMatcher,
Handler... requestHandlers)
Routes PUT requests with corresponding path to provided handler(s).
|
Routing.Builder |
put(java.lang.String pathPattern,
Handler... requestHandlers)
Routes PUT requests with corresponding path to provided handler(s).
|
Routing.Builder |
register(Builder<? extends Service>... serviceBuilders)
Registers builder consumer.
|
Routing.Builder |
register(Service... services)
Registers builder consumer.
|
Routing.Builder |
register(java.lang.String pathPattern,
Builder<? extends Service>... serviceBuilders)
Registers builder consumer.
|
Routing.Builder |
register(java.lang.String pathPattern,
Service... services)
Registers builder consumer.
|
Routing.Builder |
trace(Handler... requestHandlers)
Routes all TRACE requests to provided handler(s).
|
Routing.Builder |
trace(PathMatcher pathMatcher,
Handler... requestHandlers)
Routes TRACE requests with corresponding path to provided handler(s).
|
Routing.Builder |
trace(java.lang.String pathPattern,
Handler... requestHandlers)
Routes TRACE requests with corresponding path to provided handler(s).
|
public Routing.Builder register(Builder<? extends Service>... serviceBuilders)
Routing.Rulesregister in interface Routing.Rules<Routing.Builder>serviceBuilders - service builder to register; they will be built as a first step of this
method executionpublic Routing.Builder register(Service... services)
Routing.Rulesregister in interface Routing.Rules<Routing.Builder>services - services to registerpublic Routing.Builder register(java.lang.String pathPattern, Service... services)
Routing.Rulesregister in interface Routing.Rules<Routing.Builder>pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.services - services to registerpublic Routing.Builder register(java.lang.String pathPattern, Builder<? extends Service>... serviceBuilders)
Routing.Rulesregister in interface Routing.Rules<Routing.Builder>pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.serviceBuilders - service builder to register; they will be built as a first step of this
method executionpublic Routing.Builder get(Handler... requestHandlers)
Routing.RulesServerRequest.next()
to continue processing on the next registered handler.get in interface Routing.Rules<Routing.Builder>requestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder get(java.lang.String pathPattern, Handler... requestHandlers)
Routing.RulesServerRequest.next() to continue processing on the next registered handler.get in interface Routing.Rules<Routing.Builder>pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.requestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder get(PathMatcher pathMatcher, Handler... requestHandlers)
Routing.RulesServerRequest.next() to continue processing on the next registered handler.get in interface Routing.Rules<Routing.Builder>pathMatcher - a URI path pattern. See PathMatcher for pattern syntax reference.requestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder put(Handler... requestHandlers)
Routing.RulesServerRequest.next()
to continue processing on the next registered handler.put in interface Routing.Rules<Routing.Builder>requestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder put(java.lang.String pathPattern, Handler... requestHandlers)
Routing.RulesServerRequest.next() to continue processing on the next registered handler.put in interface Routing.Rules<Routing.Builder>pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.requestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder put(PathMatcher pathMatcher, Handler... requestHandlers)
Routing.RulesServerRequest.next() to continue processing on the next registered handler.put in interface Routing.Rules<Routing.Builder>pathMatcher - define path for a registered routerrequestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder post(Handler... requestHandlers)
Routing.RulesServerRequest.next()
to continue processing on the next registered handler.post in interface Routing.Rules<Routing.Builder>requestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder post(java.lang.String pathPattern, Handler... requestHandlers)
Routing.RulesServerRequest.next() to continue processing on the next registered handler.post in interface Routing.Rules<Routing.Builder>pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.requestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder post(PathMatcher pathMatcher, Handler... requestHandlers)
Routing.RulesServerRequest.next() to continue processing on the next registered handler.post in interface Routing.Rules<Routing.Builder>pathMatcher - define path for registered routerrequestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder delete(Handler... requestHandlers)
Routing.RulesServerRequest.next()
to continue processing on the next registered handler.delete in interface Routing.Rules<Routing.Builder>requestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder delete(java.lang.String pathPattern, Handler... requestHandlers)
Routing.RulesServerRequest.next() to continue processing on the next registered handler.delete in interface Routing.Rules<Routing.Builder>pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.requestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder delete(PathMatcher pathMatcher, Handler... requestHandlers)
Routing.RulesServerRequest.next() to continue processing on the next registered handler.delete in interface Routing.Rules<Routing.Builder>pathMatcher - define path for registered routerrequestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder options(Handler... requestHandlers)
Routing.RulesServerRequest.next()
to continue processing on the next registered handler.options in interface Routing.Rules<Routing.Builder>requestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder options(java.lang.String pathPattern, Handler... requestHandlers)
Routing.RulesServerRequest.next() to continue processing on the next registered handler.options in interface Routing.Rules<Routing.Builder>pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.requestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder options(PathMatcher pathMatcher, Handler... requestHandlers)
Routing.RulesServerRequest.next() to continue processing on the next registered handler.options in interface Routing.Rules<Routing.Builder>pathMatcher - define path for registered routerrequestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder head(Handler... requestHandlers)
Routing.RulesServerRequest.next()
to continue processing on the next registered handler.head in interface Routing.Rules<Routing.Builder>requestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder head(java.lang.String pathPattern, Handler... requestHandlers)
Routing.RulesServerRequest.next() to continue processing on the next registered handler.head in interface Routing.Rules<Routing.Builder>pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.requestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder head(PathMatcher pathMatcher, Handler... requestHandlers)
Routing.RulesServerRequest.next() to continue processing on the next registered handler.head in interface Routing.Rules<Routing.Builder>pathMatcher - define path for registered routerrequestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder trace(Handler... requestHandlers)
Routing.RulesServerRequest.next()
to continue processing on the next registered handler.trace in interface Routing.Rules<Routing.Builder>requestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder trace(java.lang.String pathPattern, Handler... requestHandlers)
Routing.RulesServerRequest.next() to continue processing on the next registered handler.trace in interface Routing.Rules<Routing.Builder>pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.requestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder trace(PathMatcher pathMatcher, Handler... requestHandlers)
Routing.RulesServerRequest.next() to continue processing on the next registered handler.trace in interface Routing.Rules<Routing.Builder>pathMatcher - define path for registered routerrequestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder any(Handler... requestHandlers)
Routing.RulesServerRequest.next()
to continue processing on the next registered handler.any in interface Routing.Rules<Routing.Builder>requestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder any(java.lang.String pathPattern, Handler... requestHandlers)
Routing.RulesServerRequest.next() to continue processing on the next registered handler.any in interface Routing.Rules<Routing.Builder>pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.requestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder any(PathMatcher pathMatcher, Handler... requestHandlers)
Routing.RulesServerRequest.next() to continue processing on the next registered handler.any in interface Routing.Rules<Routing.Builder>pathMatcher - define path for registered routerrequestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder anyOf(java.lang.Iterable<Http.RequestMethod> methods, Handler... requestHandlers)
Routing.RulesServerRequest.next()
to continue processing on the next registered handler.anyOf in interface Routing.Rules<Routing.Builder>methods - HTTP methodsrequestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder anyOf(java.lang.Iterable<Http.RequestMethod> methods, java.lang.String pathPattern, Handler... requestHandlers)
Routing.RulesServerRequest.next() to continue processing on the next registered handler.anyOf in interface Routing.Rules<Routing.Builder>methods - HTTP methodspathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.requestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder anyOf(java.lang.Iterable<Http.RequestMethod> methods, PathMatcher pathMatcher, Handler... requestHandlers)
Routing.RulesServerRequest.next() to continue processing on the next registered handler.anyOf in interface Routing.Rules<Routing.Builder>methods - HTTP methodspathMatcher - define path for registered routerrequestHandlers - handlers to tryProcess HTTP requestpublic Routing.Builder onNewWebServer(java.util.function.Consumer<WebServer> webServerConsumer)
Routing.RulesWebServer instance with this routing.onNewWebServer in interface Routing.Rules<Routing.Builder>webServerConsumer - a WebServer creation callbackpublic <T extends java.lang.Throwable> Routing.Builder error(java.lang.Class<T> exceptionClass, ErrorHandler<T> errorHandler)
T - an error handler typeexceptionClass - the type of exception to handle by this handlererrorHandler - the error handlerpublic Routing build()
public WebServer createServer(ServerConfiguration configuration)
WebServer instance with provided configuration and this routing.configuration - a web server configurationWebServer instancejava.lang.IllegalStateException - if none SPI implementation foundpublic WebServer createServer(ServerConfiguration.Builder configurationBuilder)
WebServer instance with provided configuration and this routing.configurationBuilder - a web server configuration builderWebServer instancejava.lang.IllegalStateException - if none SPI implementation foundCopyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.