Logic used to determine if this Router contains a Route for an Input.
Logic used to determine if this Router contains a Route for an Input.
The Input to determine a route for.
Some(Route)
if a matching route is defined, None
if a route destination is
not defined for the Input.
A label used for identifying this Router (i.e.
A label used for identifying this Router (i.e. for distinguishing between Router instances in error messages or for StatsReceiver scope).
All of the Route routes contained within this Router
All of the Route routes contained within this Router
This property is used to linearly determine the routes when closed() is called. It may also be used as a way to determine what routes are defined within a Router (i.e. for generating meaningful error messages). This property does not imply any relationship with apply or find or that a Router's runtime behavior needs to be linear.
Attempt to route an Input to a Route route known by this Router.
Attempt to route an Input to a Route route known by this Router.
The Input to use for determining an available route
Some(Route)
if a route is found to match, None
otherwise
A ClosedRouterException will be thrown if close has been initiated on this router and subsequent routing attempts are received.
<invalid inheritdoc annotation>
<invalid inheritdoc annotation>
NonFatal exceptions encountered when calling close() on a Route will be suppressed and Fatal exceptions will take on the same exception behavior of a Future.join.
The Logger to use for this Router.
The Logger to use for this Router. Can be overridden to customize.
A generic interface for routing an input to an optional matching route.
The Input type used when determining a route destination
The resulting route type. A Route may have dynamic properties and may be found to satisfy multiple Input instances. As there may not be a 1-to-1 mapping of Input to Route, it is encouraged that a Route encapsulates its relationship to an Input. An example to consider would be an HTTP Router. An HTTP request contains a Method (i.e. GET, POST) and a URI. A Router for a REST API may match "GET /users/{id}" for multiple HTTP requests (i.e. "GET /users/123" AND "GET /users/456" would map to the same destination Route). As a result, the Route in this example should be aware of the method, path, and and the destination/logic responsible for handling an Input that matches. Another property to consider for a Route is "uniqueness". It may or may not be desirable for a Router to contain multiple routes that correspond to the same Input.
A Router should be considered immutable unless explicitly noted.