Packages

class Route extends AnyRef

A route is a holder for a set of criteria which determine whether an HTTP request or failure should be routed to a handler.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Route
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Route(_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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def asJava: AnyRef
  6. def blockingHandler(requestHandler: Handler[RoutingContext], ordered: Boolean): Route

    Specify a blocking request handler for the route.

    Specify a blocking request handler for the route. This method works just like io.vertx.scala.ext.web.Route#handler excepted that it will run the blocking handler on a worker thread so that it won't block the event loop. Note that it's safe to call context.next() from the blocking handler as it will be executed on the event loop context (and not on the worker thread.

    If the blocking handler is ordered it means that any blocking handlers for the same context are never executed concurrently but always in the order they were called. The default value of ordered is true. If you do not want this behaviour and don't mind if your blocking handlers are executed in parallel you can set ordered to false. * @param requestHandler the blocking request handler

    ordered

    if true handlers are executed in sequence, otherwise are run in parallel

    returns

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

  7. def blockingHandler(requestHandler: Handler[RoutingContext]): Route

    Like io.vertx.scala.ext.web.Route#blockingHandler called with ordered = true

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

    Add a content type consumed by this route.

    Add a content type consumed by this route. Used for content based routing. * @param contentType the content type

    returns

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

  10. def disable(): Route

    Disable this route.

    Disable this route. While disabled the router will not route any requests or failures to it. * @return a reference to this, so the API can be used fluently

  11. def enable(): Route

    Enable this route.

    Enable this route. * @return a reference to this, so the API can be used fluently

  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  14. def failureHandler(failureHandler: Handler[RoutingContext]): Route

    Append a failure handler to the route failure handlers list.

    Append a failure handler to the route failure handlers list. The router routes failures to failurehandlers depending on whether the various criteria such as method, path, etc match. When method, path, etc are the same for different routes, You should add multiple failure handlers to the same route object rather than creating two different routes objects with one failure handler for route * @param failureHandler the request handler

    returns

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

  15. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def getPath(): Option[String]

    returns

    the path prefix (if any) for this route

  18. def handler(requestHandler: Handler[RoutingContext]): Route

    Append a request handler to the route handlers list.

    Append a request handler to the route handlers list. The router routes requests to handlers depending on whether the various criteria such as method, path, etc match. When method, path, etc are the same for different routes, You should add multiple handlers to the same route object rather than creating two different routes objects with one handler for route * @param requestHandler the request handler

    returns

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

  19. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  21. def last(): Route

    Specify this is the last route for the router.

    Specify this is the last route for the router. * @return a reference to this, so the API can be used fluently

  22. def method(method: HttpMethod): Route

    Add an HTTP method for this route.

    Add an HTTP method for this route. By default a route will match all HTTP methods. If any are specified then the route will only match any of the specified methods * @param method the HTTP method to add

    returns

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

  23. def methods(): Set[HttpMethod]

    returns

    the http methods accepted by this route

  24. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  27. def order(order: Int): Route

    Specify the order for this route.

    Specify the order for this route. The router tests routes in that order. * @param order the order

    returns

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

  28. def path(path: String): Route

    Set the path prefix for this route.

    Set the path prefix for this route. If set then this route will only match request URI paths which start with this path prefix. Only a single path or path regex can be set for a route. * @param path the path prefix

    returns

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

  29. def pathRegex(path: String): Route

    Set the path prefix as a regular expression.

    Set the path prefix as a regular expression. If set then this route will only match request URI paths, the beginning of which match the regex. Only a single path or path regex can be set for a route. * @param path the path regex

    returns

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

  30. def produces(contentType: String): Route

    Add a content type produced by this route.

    Add a content type produced by this route. Used for content based routing. * @param contentType the content type

    returns

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

  31. def remove(): Route

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

  32. def setRegexGroupsNames(groups: Buffer[String]): Route

    When you add a new route with a regular expression, you can add named capture groups for parameters.

    When you add a new route with a regular expression, you can add named capture groups for parameters.
    However, if you need more complex parameters names (like "param_name"), you can add parameters names with this function. You have to name capture groups in regex with names: "p0", "p1", "p2", ...

    For example: If you declare route with regex \/(?<p0>[a-z]*)\/(?<p1>[a-z]*) and group names ["param_a", "param-b"] for uri /hello/world you receive inside pathParams() the parameter param_a = "hello" * @param groups group names

    returns

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

  33. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  34. def toString(): String
    Definition Classes
    AnyRef → Any
  35. def useNormalisedPath(useNormalisedPath: Boolean): Route

    If true then the normalised request path will be used when routing (e.g.

    If true then the normalised request path will be used when routing (e.g. removing duplicate /) Default is true * @param useNormalisedPath use normalised path for routing?

    returns

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

  36. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped