Package io.vertx.mutiny.ext.web
Class Router
java.lang.Object
io.vertx.mutiny.ext.web.Router
- All Implemented Interfaces:
MutinyDelegate,io.vertx.core.Handler<HttpServerRequest>,Consumer<HttpServerRequest>
public class Router
extends Object
implements MutinyDelegate, io.vertx.core.Handler<HttpServerRequest>, Consumer<HttpServerRequest>
A router receives request from an
HttpServer and routes it to the first matching
Route that it contains. A router can contain many routes.
Routers are also used for routing failures.
NOTE: This class has been automatically generated from theoriginal non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(HttpServerRequest item) allowForward(io.vertx.ext.web.AllowForwardHeaders allowForwardHeaders) clear()connect()connectWithRegex(String regex) delete()deleteWithRegex(String regex) booleanerrorHandler(int statusCode, Consumer<RoutingContext> errorHandler) get()io.vertx.ext.web.Router<T> TgetMetadata(String key) getWithRegex(String regex) voidhandle(HttpServerRequest arg0) voidhandleContext(RoutingContext context) voidhandleFailure(RoutingContext context) inthashCode()head()headWithRegex(String regex) metadata()modifiedHandler(Consumer<Router> handler) mountSubRouter(String mountPoint, Router subRouter) Deprecated.static RouternewInstance(io.vertx.ext.web.Router arg) options()optionsWithRegex(String regex) patch()patchWithRegex(String regex) post()postWithRegex(String regex) put()putMetadata(String key, Object value) putWithRegex(String regex) route()static RouterrouteWithRegex(io.vertx.core.http.HttpMethod method, String regex) routeWithRegex(String regex) toString()trace()traceWithRegex(String regex)
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
Router
public Router(io.vertx.ext.web.Router delegate) -
Router
-
-
Method Details
-
getDelegate
public io.vertx.ext.web.Router getDelegate()- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
handle
- Specified by:
handlein interfaceio.vertx.core.Handler<HttpServerRequest>
-
putMetadata
- Parameters:
key- the metadata of keyvalue- the metadata of value- Returns:
- a reference to this, so the API can be used fluently
-
metadata
- Returns:
- the metadata of this router, never returns null.
-
getMetadata
- Parameters:
key- the key for the metadata- Returns:
- the data
-
router
- Parameters:
vertx- the Vert.x instance- Returns:
- the router
-
route
- Returns:
- the route
-
route
- Parameters:
method- the HTTP method to matchpath- URI paths that begin with this path will match- Returns:
- the route
-
route
- Parameters:
path- URI paths that begin with this path will match- Returns:
- the route
-
routeWithRegex
- Parameters:
method- the HTTP method to matchregex- URI paths that begin with a match for this regex will match- Returns:
- the route
-
routeWithRegex
- Parameters:
regex- URI paths that begin with a match for this regex will match- Returns:
- the route
-
get
- Returns:
- the route
-
get
- Parameters:
path- URI paths that begin with this path will match- Returns:
- the route
-
getWithRegex
- Parameters:
regex- URI paths that begin with a match for this regex will match- Returns:
- the route
-
head
- Returns:
- the route
-
head
- Parameters:
path- URI paths that begin with this path will match- Returns:
- the route
-
headWithRegex
- Parameters:
regex- URI paths that begin with a match for this regex will match- Returns:
- the route
-
options
- Returns:
- the route
-
options
- Parameters:
path- URI paths that begin with this path will match- Returns:
- the route
-
optionsWithRegex
- Parameters:
regex- URI paths that begin with a match for this regex will match- Returns:
- the route
-
put
- Returns:
- the route
-
put
- Parameters:
path- URI paths that begin with this path will match- Returns:
- the route
-
putWithRegex
- Parameters:
regex- URI paths that begin with a match for this regex will match- Returns:
- the route
-
post
- Returns:
- the route
-
post
- Parameters:
path- URI paths that begin with this path will match- Returns:
- the route
-
postWithRegex
- Parameters:
regex- URI paths that begin with a match for this regex will match- Returns:
- the route
-
delete
- Returns:
- the route
-
delete
- Parameters:
path- URI paths that begin with this path will match- Returns:
- the route
-
deleteWithRegex
- Parameters:
regex- URI paths that begin with a match for this regex will match- Returns:
- the route
-
trace
- Returns:
- the route
-
trace
- Parameters:
path- URI paths that begin with this path will match- Returns:
- the route
-
traceWithRegex
- Parameters:
regex- URI paths that begin with a match for this regex will match- Returns:
- the route
-
connect
- Returns:
- the route
-
connect
- Parameters:
path- URI paths that begin with this path will match- Returns:
- the route
-
connectWithRegex
- Parameters:
regex- URI paths that begin with a match for this regex will match- Returns:
- the route
-
patch
- Returns:
- the route
-
patch
- Parameters:
path- URI paths that begin with this path will match- Returns:
- the route
-
patchWithRegex
- Parameters:
regex- URI paths that begin with a match for this regex will match- Returns:
- the route
-
getRoutes
- Returns:
- a list of all the routes on this router
-
clear
- Returns:
- a reference to this, so the API can be used fluently
-
mountSubRouter
Deprecated.This method duplicates the sub router functionality fromRoute.subRouter(Router). Mount a sub router on this router- Parameters:
mountPoint- the mount point (path prefix) to mount it onsubRouter- the router to mount as a sub router- Returns:
- a reference to this, so the API can be used fluently
-
errorHandler
- Parameters:
statusCode- status code the errorHandler is capable of handleerrorHandler- error handler. Note: You must not useRoutingContext.next()inside the provided handler- Returns:
-
handleContext
- Parameters:
context- the routing context
-
handleFailure
- Parameters:
context- the routing context
-
modifiedHandler
- Parameters:
handler- a notification handler that will receive this router as argument- Returns:
-
allowForward
- Parameters:
allowForwardHeaders- to enable parsing of "forwarded"-type headers- Returns:
- a reference to this, so the API can be used fluently
-
accept
- Specified by:
acceptin interfaceConsumer<HttpServerRequest>
-
newInstance
-
Route.subRouter(Router).