class Router extends AnyRef
A router receives request from an io.vertx.scala.core.http.HttpServer and routes it to the first matching io.vertx.scala.ext.web.Route that it contains. A router can contain many routes.
Routers are also used for routing failures.
- Alphabetic
- By Inheritance
- Router
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Router(_asJava: AnyRef)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
accept(request: HttpServerRequest): Unit
This method is used to provide a request to the router.
This method is used to provide a request to the router. Usually you take request from the io.vertx.scala.core.http.HttpServer#requestHandler and pass it to this method. The router then routes it to matching routes.
- request
the request
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asJava: AnyRef
-
def
clear(): Router
Remove all the routes from this router
Remove all the routes from this router
- returns
a reference to this, so the API can be used fluently
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
connect(path: String): Route
Add a route that matches a HTTP CONNECT request and the specified path
Add a route that matches a HTTP CONNECT request and the specified path
- path
URI paths that begin with this path will match
- returns
the route
-
def
connect(): Route
Add a route that matches any HTTP CONNECT request
Add a route that matches any HTTP CONNECT request
- returns
the route
-
def
connectWithRegex(regex: String): Route
Add a route that matches a HTTP CONNECT request and the specified path regex
Add a route that matches a HTTP CONNECT request and the specified path regex
- regex
URI paths that begin with a match for this regex will match
- returns
the route
-
def
delete(path: String): Route
Add a route that matches a HTTP DELETE request and the specified path
Add a route that matches a HTTP DELETE request and the specified path
- path
URI paths that begin with this path will match
- returns
the route
-
def
delete(): Route
Add a route that matches any HTTP DELETE request
Add a route that matches any HTTP DELETE request
- returns
the route
-
def
deleteWithRegex(regex: String): Route
Add a route that matches a HTTP DELETE request and the specified path regex
Add a route that matches a HTTP DELETE request and the specified path regex
- regex
URI paths that begin with a match for this regex will match
- returns
the route
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
exceptionHandler(exceptionHandler: Handler[Throwable]): Router
Specify a handler for any unhandled exceptions on this router.
Specify a handler for any unhandled exceptions on this router. The handler will be called for exceptions thrown from handlers. This does not affect the normal failure routing logic.
- exceptionHandler
the exception handler
- returns
a reference to this, so the API can be used fluently
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
get(path: String): Route
Add a route that matches a HTTP GET request and the specified path
Add a route that matches a HTTP GET request and the specified path
- path
URI paths that begin with this path will match
- returns
the route
-
def
get(): Route
Add a route that matches any HTTP GET request
Add a route that matches any HTTP GET request
- returns
the route
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
getRoutes(): Buffer[Route]
- returns
a list of all the routes on this router
-
def
getWithRegex(regex: String): Route
Add a route that matches a HTTP GET request and the specified path regex
Add a route that matches a HTTP GET request and the specified path regex
- regex
URI paths that begin with a match for this regex will match
- returns
the route
-
def
handleContext(context: RoutingContext): Unit
Used to route a context to the router.
Used to route a context to the router. Used for sub-routers. You wouldn't normally call this method directly.
- context
the routing context
-
def
handleFailure(context: RoutingContext): Unit
Used to route a failure to the router.
Used to route a failure to the router. Used for sub-routers. You wouldn't normally call this method directly.
- context
the routing context
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
head(path: String): Route
Add a route that matches a HTTP HEAD request and the specified path
Add a route that matches a HTTP HEAD request and the specified path
- path
URI paths that begin with this path will match
- returns
the route
-
def
head(): Route
Add a route that matches any HTTP HEAD request
Add a route that matches any HTTP HEAD request
- returns
the route
-
def
headWithRegex(regex: String): Route
Add a route that matches a HTTP HEAD request and the specified path regex
Add a route that matches a HTTP HEAD request and the specified path regex
- regex
URI paths that begin with a match for this regex will match
- returns
the route
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
mountSubRouter(mountPoint: String, subRouter: Router): Router
Mount a sub router on this router
Mount a sub router on this router
- mountPoint
the mount point (path prefix) to mount it on
- subRouter
the router to mount as a sub router
- returns
a reference to this, so the API can be used fluently
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
options(path: String): Route
Add a route that matches a HTTP OPTIONS request and the specified path
Add a route that matches a HTTP OPTIONS request and the specified path
- path
URI paths that begin with this path will match
- returns
the route
-
def
options(): Route
Add a route that matches any HTTP OPTIONS request
Add a route that matches any HTTP OPTIONS request
- returns
the route
-
def
optionsWithRegex(regex: String): Route
Add a route that matches a HTTP OPTIONS request and the specified path regex
Add a route that matches a HTTP OPTIONS request and the specified path regex
- regex
URI paths that begin with a match for this regex will match
- returns
the route
-
def
patch(path: String): Route
Add a route that matches a HTTP PATCH request and the specified path
Add a route that matches a HTTP PATCH request and the specified path
- path
URI paths that begin with this path will match
- returns
the route
-
def
patch(): Route
Add a route that matches any HTTP PATCH request
Add a route that matches any HTTP PATCH request
- returns
the route
-
def
patchWithRegex(regex: String): Route
Add a route that matches a HTTP PATCH request and the specified path regex
Add a route that matches a HTTP PATCH request and the specified path regex
- regex
URI paths that begin with a match for this regex will match
- returns
the route
-
def
post(path: String): Route
Add a route that matches a HTTP POST request and the specified path
Add a route that matches a HTTP POST request and the specified path
- path
URI paths that begin with this path will match
- returns
the route
-
def
post(): Route
Add a route that matches any HTTP POST request
Add a route that matches any HTTP POST request
- returns
the route
-
def
postWithRegex(regex: String): Route
Add a route that matches a HTTP POST request and the specified path regex
Add a route that matches a HTTP POST request and the specified path regex
- regex
URI paths that begin with a match for this regex will match
- returns
the route
-
def
put(path: String): Route
Add a route that matches a HTTP PUT request and the specified path
Add a route that matches a HTTP PUT request and the specified path
- path
URI paths that begin with this path will match
- returns
the route
-
def
put(): Route
Add a route that matches any HTTP PUT request
Add a route that matches any HTTP PUT request
- returns
the route
-
def
putWithRegex(regex: String): Route
Add a route that matches a HTTP PUT request and the specified path regex
Add a route that matches a HTTP PUT request and the specified path regex
- regex
URI paths that begin with a match for this regex will match
- returns
the route
-
def
route(path: String): Route
Add a route that matches the specified path
Add a route that matches the specified path
- path
URI paths that begin with this path will match
- returns
the route
-
def
route(method: HttpMethod, path: String): Route
Add a route that matches the specified HTTP method and path
Add a route that matches the specified HTTP method and path
- method
the HTTP method to match
- path
URI paths that begin with this path will match
- returns
the route
-
def
route(): Route
Add a route with no matching criteria, i.e.
Add a route with no matching criteria, i.e. it matches all requests or failures.
- returns
the route
-
def
routeWithRegex(regex: String): Route
Add a route that matches the specified path regex
Add a route that matches the specified path regex
- regex
URI paths that begin with a match for this regex will match
- returns
the route
-
def
routeWithRegex(method: HttpMethod, regex: String): Route
Add a route that matches the specified HTTP method and path regex
Add a route that matches the specified HTTP method and path regex
- method
the HTTP method to match
- regex
URI paths that begin with a match for this regex will match
- returns
the route
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
trace(path: String): Route
Add a route that matches a HTTP TRACE request and the specified path
Add a route that matches a HTTP TRACE request and the specified path
- path
URI paths that begin with this path will match
- returns
the route
-
def
trace(): Route
Add a route that matches any HTTP TRACE request
Add a route that matches any HTTP TRACE request
- returns
the route
-
def
traceWithRegex(regex: String): Route
Add a route that matches a HTTP TRACE request and the specified path regex
Add a route that matches a HTTP TRACE request and the specified path regex
- regex
URI paths that begin with a match for this regex will match
- returns
the route
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )