| Constructor and Description |
|---|
RouterImpl(Vertx vertx) |
| Modifier and Type | Method and Description |
|---|---|
Router |
clear()
Remove all the routes from this router
|
Route |
connect()
Add a route that matches any HTTP CONNECT request
|
Route |
connect(String path)
Add a route that matches a HTTP CONNECT request and the specified path
|
Route |
connectWithRegex(String path)
Add a route that matches a HTTP CONNECT request and the specified path regex
|
Route |
delete()
Add a route that matches any HTTP DELETE request
|
Route |
delete(String path)
Add a route that matches a HTTP DELETE request and the specified path
|
Route |
deleteWithRegex(String path)
Add a route that matches a HTTP DELETE request and the specified path regex
|
Router |
errorHandler(int statusCode,
Handler<RoutingContext> errorHandler)
Specify an handler to handle an error for a particular status code.
|
Router |
exceptionHandler(Handler<Throwable> exceptionHandler)
Deprecated.
|
Route |
get()
Add a route that matches any HTTP GET request
|
Route |
get(String path)
Add a route that matches a HTTP GET request and the specified path
|
List<Route> |
getRoutes() |
Route |
getWithRegex(String path)
Add a route that matches a HTTP GET request and the specified path regex
|
void |
handle(HttpServerRequest request)
Something has happened, so handle it.
|
void |
handleContext(RoutingContext ctx)
Used to route a context to the router.
|
void |
handleFailure(RoutingContext ctx)
Used to route a failure to the router.
|
Route |
head()
Add a route that matches any HTTP HEAD request
|
Route |
head(String path)
Add a route that matches a HTTP HEAD request and the specified path
|
Route |
headWithRegex(String path)
Add a route that matches a HTTP HEAD request and the specified path regex
|
Router |
modifiedHandler(Handler<Router> handler)
When a Router routes are changed this handler is notified.
|
Router |
mountSubRouter(String mountPoint,
Router subRouter)
Mount a sub router on this router
|
Route |
options()
Add a route that matches any HTTP OPTIONS request
|
Route |
options(String path)
Add a route that matches a HTTP OPTIONS request and the specified path
|
Route |
optionsWithRegex(String path)
Add a route that matches a HTTP OPTIONS request and the specified path regex
|
Route |
patch()
Add a route that matches any HTTP PATCH request
|
Route |
patch(String path)
Add a route that matches a HTTP PATCH request and the specified path
|
Route |
patchWithRegex(String path)
Add a route that matches a HTTP PATCH request and the specified path regex
|
Route |
post()
Add a route that matches any HTTP POST request
|
Route |
post(String path)
Add a route that matches a HTTP POST request and the specified path
|
Route |
postWithRegex(String path)
Add a route that matches a HTTP POST request and the specified path regex
|
Route |
put()
Add a route that matches any HTTP PUT request
|
Route |
put(String path)
Add a route that matches a HTTP PUT request and the specified path
|
Route |
putWithRegex(String path)
Add a route that matches a HTTP PUT request and the specified path regex
|
Route |
route()
Add a route with no matching criteria, i.e.
|
Route |
route(HttpMethod method,
String path)
Add a route that matches the specified HTTP method and path
|
Route |
route(String path)
Add a route that matches the specified path
|
Route |
routeWithRegex(HttpMethod method,
String regex)
Add a route that matches the specified HTTP method and path regex
|
Route |
routeWithRegex(String regex)
Add a route that matches the specified path regex
|
String |
toString() |
Route |
trace()
Add a route that matches any HTTP TRACE request
|
Route |
trace(String path)
Add a route that matches a HTTP TRACE request and the specified path
|
Route |
traceWithRegex(String path)
Add a route that matches a HTTP TRACE request and the specified path regex
|
public RouterImpl(Vertx vertx)
public void handle(HttpServerRequest request)
Handlerhandle in interface Handler<HttpServerRequest>request - the event to handlepublic Route route()
Routerpublic Route route(HttpMethod method, String path)
Routerpublic Route route(String path)
Routerpublic Route routeWithRegex(HttpMethod method, String regex)
RouterrouteWithRegex in interface Routermethod - the HTTP method to matchregex - URI paths that begin with a match for this regex will matchpublic Route routeWithRegex(String regex)
RouterrouteWithRegex in interface Routerregex - URI paths that begin with a match for this regex will matchpublic Route get()
Routerpublic Route get(String path)
Routerpublic Route getWithRegex(String path)
RoutergetWithRegex in interface Routerpath - URI paths that begin with a match for this regex will matchpublic Route head()
Routerpublic Route head(String path)
Routerpublic Route headWithRegex(String path)
RouterheadWithRegex in interface Routerpath - URI paths that begin with a match for this regex will matchpublic Route options()
Routerpublic Route options(String path)
Routerpublic Route optionsWithRegex(String path)
RouteroptionsWithRegex in interface Routerpath - URI paths that begin with a match for this regex will matchpublic Route put()
Routerpublic Route put(String path)
Routerpublic Route putWithRegex(String path)
RouterputWithRegex in interface Routerpath - URI paths that begin with a match for this regex will matchpublic Route post()
Routerpublic Route post(String path)
Routerpublic Route postWithRegex(String path)
RouterpostWithRegex in interface Routerpath - URI paths that begin with a match for this regex will matchpublic Route delete()
Routerpublic Route delete(String path)
Routerpublic Route deleteWithRegex(String path)
RouterdeleteWithRegex in interface Routerpath - URI paths that begin with a match for this regex will matchpublic Route trace()
Routerpublic Route trace(String path)
Routerpublic Route traceWithRegex(String path)
RoutertraceWithRegex in interface Routerpath - URI paths that begin with a match for this regex will matchpublic Route connect()
Routerpublic Route connect(String path)
Routerpublic Route connectWithRegex(String path)
RouterconnectWithRegex in interface Routerpath - URI paths that begin with a match for this regex will matchpublic Route patch()
Routerpublic Route patch(String path)
Routerpublic Route patchWithRegex(String path)
RouterpatchWithRegex in interface Routerpath - URI paths that begin with a match for this regex will matchpublic Router clear()
Routerpublic void handleContext(RoutingContext ctx)
RouterhandleContext in interface Routerctx - the routing contextpublic void handleFailure(RoutingContext ctx)
RouterhandleFailure in interface Routerctx - the routing contextpublic Router modifiedHandler(Handler<Router> handler)
RoutermodifiedHandler in interface Routerhandler - a notification handler that will receive this router as argumentpublic Router mountSubRouter(String mountPoint, Router subRouter)
RoutermountSubRouter in interface RoutermountPoint - the mount point (path prefix) to mount it onsubRouter - the router to mount as a sub router@Deprecated public Router exceptionHandler(Handler<Throwable> exceptionHandler)
RouterexceptionHandler in interface RouterexceptionHandler - the exception handlerpublic Router errorHandler(int statusCode, Handler<RoutingContext> errorHandler)
RouterRoutingContext.next() inside the error handler
This does not affect the normal failure routing logic.errorHandler in interface RouterstatusCode - status code the errorHandler is capable of handleerrorHandler - error handler. Note: You must not use RoutingContext.next() inside the provided handlerCopyright © 2020. All rights reserved.