Router

wvlet.airframe.http.Router
See theRouter companion object
case class Router(surface: Option[Surface], children: Seq[Router], localRoutes: Seq[Route], filterSurface: Option[Surface], filterInstance: Option[HttpFilterType]) extends RouterBase with LogSupport

Router defines mappings from HTTP requests to Routes.

Router can be nested

  • Router1 with Filter1
    • Router2: endpoints e1, e2
    • Router3: endpoints e3 with Filter2
  • Router4: endpoints e4

From this router definition, the backend HTTP server specific implementation will build a mapping table like this: e1 -> Filter1 andThen process(e1) e2 -> Filter1 andThen process(e2) e3 -> Filter1 andThen Filter2 andThen process(e3) e4 -> process(e4)

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
trait LogSupport
trait LazyLogger
trait LoggingMethods
trait Serializable
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

def addChild(childRouter: Router): Router

Add a child and and return a new Router with this child node

Add a child and and return a new Router with this child node

Attributes

def addInternal(controllerSurface: Surface, controllerMethodSurfaces: Seq[MethodSurface]): Router

Internal only method for adding the surface of the controller

Internal only method for adding the surface of the controller

Attributes

def andThen(filter: HttpFilterType): Router
def andThen(next: Router): Router
def findRoute[Req : HttpRequestAdapter](request: Req): Option[RouteMatch]
def hasNoOperation: Boolean
def isEmpty: Boolean
def isLeafFilter: Boolean
def routes: Seq[Route]
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns:

a string representation of the object.

Definition Classes
Any
def verifyRoutes: Unit

Call this method to verify duplicated routes in an early phase

Call this method to verify duplicated routes in an early phase

Attributes

def withFilter(newFilterSurface: Surface): Router

Inherited methods

inline def add[Controller]: Router

Attributes

Inherited from:
RouterBase
inline def andThen[Controller]: Router

Attributes

Inherited from:
RouterBase
inline protected def debug(inline message: Any, inline cause: Throwable): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def debug(inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def error(inline message: Any, inline cause: Throwable): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def error(inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def info(inline message: Any, inline cause: Throwable): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def info(inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def logAt(inline logLevel: LogLevel, inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
inline protected def trace(inline message: Any, inline cause: Throwable): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def trace(inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def warn(inline message: Any, inline cause: Throwable): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def warn(inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods