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.
- Alphabetic
- By Inheritance
- Route
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Route(_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
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asJava: AnyRef
-
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.
- 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
-
def
blockingHandler(requestHandler: Handler[RoutingContext]): Route
Like io.vertx.scala.ext.web.Route#blockingHandler called with ordered = true
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
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.
- contentType
the content type
- returns
a reference to this, so the API can be used fluently
-
def
disable(): Route
Disable this route.
Disable this route. While disabled the router will not route any requests or failures to it.
- returns
a reference to this, so the API can be used fluently
-
def
enable(): Route
Enable this route.
Enable this route.
- returns
a reference to this, so the API can be used fluently
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
failureHandler(failureHandler: Handler[RoutingContext]): Route
Specify a failure handler for the route.
Specify a failure handler for the route. The router routes failures to failurehandlers depending on whether the various criteria such as method, path, etc match. There can be only one failure handler for a route. If you set this more than once it will overwrite the previous handler.
- failureHandler
the request 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] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
getPath(): Option[String]
- returns
the path prefix (if any) for this route
-
def
handler(requestHandler: Handler[RoutingContext]): Route
Specify a request handler for the route.
Specify a request handler for the route. The router routes requests to handlers depending on whether the various criteria such as method, path, etc match. There can be only one request handler for a route. If you set this more than once it will overwrite the previous handler.
- requestHandler
the request handler
- returns
a reference to this, so the API can be used fluently
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
last(): Route
Specify this is the last route for the router.
Specify this is the last route for the router.
- returns
a reference to this, so the API can be used fluently
-
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
- method
the HTTP method to add
- 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
order(order: Int): Route
Specify the order for this route.
Specify the order for this route. The router tests routes in that order.
- order
the order
- returns
a reference to this, so the API can be used fluently
-
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.
- path
the path prefix
- returns
a reference to this, so the API can be used fluently
-
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.
- path
the path regex
- returns
a reference to this, so the API can be used fluently
-
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.
- contentType
the content type
- returns
a reference to this, so the API can be used fluently
-
def
remove(): Route
Remove this route from the router
Remove this route from the router
- returns
a reference to this, so the API can be used fluently
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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
- useNormalisedPath
use normalised path for routing?
- returns
a reference to this, so the API can be used fluently
-
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( ... )