Packages

class Router extends Handler[HttpServerRequest]

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.

Linear Supertypes
Handler[HttpServerRequest], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Router
  2. Handler
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Router(_asJava: AnyRef)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. 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.

    This method is now deprecated you can use this object directly as a request handler, which means there is no need for a method reference anymore. * @param request the request

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def asJava: AnyRef
  7. def clear(): Router

    Remove all the routes from this router * @return a reference to this, so the API can be used fluently

  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  9. def connect(path: String): Route

    Add a route that matches a HTTP CONNECT request and the specified path * @param path URI paths that begin with this path will match

    Add a route that matches a HTTP CONNECT request and the specified path * @param path URI paths that begin with this path will match

    returns

    the route

  10. def connect(): Route

    Add a route that matches any HTTP CONNECT request * @return the route

  11. def connectWithRegex(regex: String): Route

    Add a route that matches a HTTP CONNECT request and the specified path regex * @param regex URI paths that begin with a match for this regex will match

    Add a route that matches a HTTP CONNECT request and the specified path regex * @param regex URI paths that begin with a match for this regex will match

    returns

    the route

  12. def delete(path: String): Route

    Add a route that matches a HTTP DELETE request and the specified path * @param path URI paths that begin with this path will match

    Add a route that matches a HTTP DELETE request and the specified path * @param path URI paths that begin with this path will match

    returns

    the route

  13. def delete(): Route

    Add a route that matches any HTTP DELETE request * @return the route

  14. def deleteWithRegex(regex: String): Route

    Add a route that matches a HTTP DELETE request and the specified path regex * @param regex URI paths that begin with a match for this regex will match

    Add a route that matches a HTTP DELETE request and the specified path regex * @param regex URI paths that begin with a match for this regex will match

    returns

    the route

  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  17. 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. * @param exceptionHandler the exception handler

    returns

    a reference to this, so the API can be used fluently

  18. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def get(path: String): Route

    Add a route that matches a HTTP GET request and the specified path * @param path URI paths that begin with this path will match

    Add a route that matches a HTTP GET request and the specified path * @param path URI paths that begin with this path will match

    returns

    the route

  20. def get(): Route

    Add a route that matches any HTTP GET request * @return the route

  21. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. def getRoutes(): Buffer[Route]

    returns

    a list of all the routes on this router

  23. def getWithRegex(regex: String): Route

    Add a route that matches a HTTP GET request and the specified path regex * @param regex URI paths that begin with a match for this regex will match

    Add a route that matches a HTTP GET request and the specified path regex * @param regex URI paths that begin with a match for this regex will match

    returns

    the route

  24. def handle(arg0: HttpServerRequest): Unit
    Definition Classes
    Router → Handler
  25. 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. * @param context the routing context

  26. 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. * @param context the routing context

  27. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  28. def head(path: String): Route

    Add a route that matches a HTTP HEAD request and the specified path * @param path URI paths that begin with this path will match

    Add a route that matches a HTTP HEAD request and the specified path * @param path URI paths that begin with this path will match

    returns

    the route

  29. def head(): Route

    Add a route that matches any HTTP HEAD request * @return the route

  30. def headWithRegex(regex: String): Route

    Add a route that matches a HTTP HEAD request and the specified path regex * @param regex URI paths that begin with a match for this regex will match

    Add a route that matches a HTTP HEAD request and the specified path regex * @param regex URI paths that begin with a match for this regex will match

    returns

    the route

  31. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  32. def mountSubRouter(mountPoint: String, subRouter: Router): Router

    Mount a sub router on this router * @param mountPoint the mount point (path prefix) to mount it on

    Mount a sub router on this router * @param 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

  33. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  34. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  35. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  36. def options(path: String): Route

    Add a route that matches a HTTP OPTIONS request and the specified path * @param path URI paths that begin with this path will match

    Add a route that matches a HTTP OPTIONS request and the specified path * @param path URI paths that begin with this path will match

    returns

    the route

  37. def options(): Route

    Add a route that matches any HTTP OPTIONS request * @return the route

  38. def optionsWithRegex(regex: String): Route

    Add a route that matches a HTTP OPTIONS request and the specified path regex * @param regex URI paths that begin with a match for this regex will match

    Add a route that matches a HTTP OPTIONS request and the specified path regex * @param regex URI paths that begin with a match for this regex will match

    returns

    the route

  39. def patch(path: String): Route

    Add a route that matches a HTTP PATCH request and the specified path * @param path URI paths that begin with this path will match

    Add a route that matches a HTTP PATCH request and the specified path * @param path URI paths that begin with this path will match

    returns

    the route

  40. def patch(): Route

    Add a route that matches any HTTP PATCH request * @return the route

  41. def patchWithRegex(regex: String): Route

    Add a route that matches a HTTP PATCH request and the specified path regex * @param regex URI paths that begin with a match for this regex will match

    Add a route that matches a HTTP PATCH request and the specified path regex * @param regex URI paths that begin with a match for this regex will match

    returns

    the route

  42. def post(path: String): Route

    Add a route that matches a HTTP POST request and the specified path * @param path URI paths that begin with this path will match

    Add a route that matches a HTTP POST request and the specified path * @param path URI paths that begin with this path will match

    returns

    the route

  43. def post(): Route

    Add a route that matches any HTTP POST request * @return the route

  44. def postWithRegex(regex: String): Route

    Add a route that matches a HTTP POST request and the specified path regex * @param regex URI paths that begin with a match for this regex will match

    Add a route that matches a HTTP POST request and the specified path regex * @param regex URI paths that begin with a match for this regex will match

    returns

    the route

  45. def put(path: String): Route

    Add a route that matches a HTTP PUT request and the specified path * @param path URI paths that begin with this path will match

    Add a route that matches a HTTP PUT request and the specified path * @param path URI paths that begin with this path will match

    returns

    the route

  46. def put(): Route

    Add a route that matches any HTTP PUT request * @return the route

  47. def putWithRegex(regex: String): Route

    Add a route that matches a HTTP PUT request and the specified path regex * @param regex URI paths that begin with a match for this regex will match

    Add a route that matches a HTTP PUT request and the specified path regex * @param regex URI paths that begin with a match for this regex will match

    returns

    the route

  48. def route(path: String): Route

    Add a route that matches the specified path * @param path URI paths that begin with this path will match

    Add a route that matches the specified path * @param path URI paths that begin with this path will match

    returns

    the route

  49. def route(method: HttpMethod, path: String): Route

    Add a route that matches the specified HTTP method and path * @param method the HTTP method to match

    Add a route that matches the specified HTTP method and path * @param method the HTTP method to match

    path

    URI paths that begin with this path will match

    returns

    the route

  50. 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. * @return the route

  51. def routeWithRegex(regex: String): Route

    Add a route that matches the specified path regex * @param regex URI paths that begin with a match for this regex will match

    Add a route that matches the specified path regex * @param regex URI paths that begin with a match for this regex will match

    returns

    the route

  52. def routeWithRegex(method: HttpMethod, regex: String): Route

    Add a route that matches the specified HTTP method and path regex * @param method the HTTP method to match

    Add a route that matches the specified HTTP method and path regex * @param method the HTTP method to match

    regex

    URI paths that begin with a match for this regex will match

    returns

    the route

  53. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  54. def toString(): String
    Definition Classes
    AnyRef → Any
  55. def trace(path: String): Route

    Add a route that matches a HTTP TRACE request and the specified path * @param path URI paths that begin with this path will match

    Add a route that matches a HTTP TRACE request and the specified path * @param path URI paths that begin with this path will match

    returns

    the route

  56. def trace(): Route

    Add a route that matches any HTTP TRACE request * @return the route

  57. def traceWithRegex(regex: String): Route

    Add a route that matches a HTTP TRACE request and the specified path regex * @param regex URI paths that begin with a match for this regex will match

    Add a route that matches a HTTP TRACE request and the specified path regex * @param regex URI paths that begin with a match for this regex will match

    returns

    the route

  58. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  59. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  60. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from Handler[HttpServerRequest]

Inherited from AnyRef

Inherited from Any

Ungrouped