Packages

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.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Router
  2. AnyRef
  3. 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.

    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

    Remove all the routes from this router

    returns

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

  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. 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

  10. def connect(): Route

    Add a route that matches any HTTP CONNECT request

    Add a route that matches any HTTP CONNECT request

    returns

    the route

  11. 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

  12. 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

  13. def delete(): Route

    Add a route that matches any HTTP DELETE request

    Add a route that matches any HTTP DELETE request

    returns

    the route

  14. 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

  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.

    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

    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

  20. def get(): Route

    Add a route that matches any HTTP GET request

    Add a route that matches any HTTP GET request

    returns

    the route

  21. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  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

    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

  24. 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

  25. 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

  26. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  27. 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

  28. def head(): Route

    Add a route that matches any HTTP HEAD request

    Add a route that matches any HTTP HEAD request

    returns

    the route

  29. 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

  30. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  31. 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

  32. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  33. final def notify(): Unit
    Definition Classes
    AnyRef
  34. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  35. 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

  36. def options(): Route

    Add a route that matches any HTTP OPTIONS request

    Add a route that matches any HTTP OPTIONS request

    returns

    the route

  37. 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

  38. 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

  39. def patch(): Route

    Add a route that matches any HTTP PATCH request

    Add a route that matches any HTTP PATCH request

    returns

    the route

  40. 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

  41. 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

  42. def post(): Route

    Add a route that matches any HTTP POST request

    Add a route that matches any HTTP POST request

    returns

    the route

  43. 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

  44. 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

  45. def put(): Route

    Add a route that matches any HTTP PUT request

    Add a route that matches any HTTP PUT request

    returns

    the route

  46. 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

  47. 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

  48. 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

  49. 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

  50. 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

  51. 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

  52. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  53. def toString(): String
    Definition Classes
    AnyRef → Any
  54. 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

  55. def trace(): Route

    Add a route that matches any HTTP TRACE request

    Add a route that matches any HTTP TRACE request

    returns

    the route

  56. 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

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

Inherited from AnyRef

Inherited from Any

Ungrouped