public interface Route
However, the built-in directives may be combined methods like:
Route myDirective(String test, Supplier<Route> inner) { return path("fixed", () -> path(test), inner ) ); }
The above example will invoke [inner] whenever the path "fixed/{test}" is matched, where "{test}" is the actual String that was given as method argument.
Modifier and Type | Method and Description |
---|---|
scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> |
asScala()
Converts to the Scala DSL form of an Route.
|
scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> |
delegate()
INTERNAL API
|
akka.stream.javadsl.Flow<HttpRequest,HttpResponse,akka.NotUsed> |
flow(akka.actor.ActorSystem system,
akka.stream.Materializer materializer) |
Route |
orElse(Route alternative) |
Route |
seal()
Seals a route by wrapping it with default exception handling and rejection conversion.
|
Route |
seal(akka.actor.ActorSystem system,
akka.stream.Materializer materializer)
Deprecated.
Use the variant without
ActorSystem and Materializer |
Route |
seal(RejectionHandler rejectionHandler,
ExceptionHandler exceptionHandler)
Seals a route by wrapping it with explicit exception handling and rejection conversion.
|
Route |
seal(RoutingSettings routingSettings,
ParserSettings parserSettings,
RejectionHandler rejectionHandler,
ExceptionHandler exceptionHandler)
Deprecated.
Use the variant without
RoutingSettings and ParserSettings |
Route |
seal(RoutingSettings routingSettings,
ParserSettings parserSettings,
RejectionHandler rejectionHandler,
ExceptionHandler exceptionHandler,
akka.actor.ActorSystem system,
akka.stream.Materializer materializer)
Deprecated.
Use the variant without
ActorSystem and Materializer |
scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> asScala()
scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> delegate()
akka.stream.javadsl.Flow<HttpRequest,HttpResponse,akka.NotUsed> flow(akka.actor.ActorSystem system, akka.stream.Materializer materializer)
Route seal(akka.actor.ActorSystem system, akka.stream.Materializer materializer)
ActorSystem
and Materializer
A sealed route has these properties:
- The result of the route will always be a complete response, i.e. the result of the future is a
Success(RouteResult.Complete(response))
, never a failed future and never a rejected route. These
will be already be handled using the implicitly given RejectionHandler
and ExceptionHandler
(or
the default handlers if none are given or can be found implicitly).
- Consequently, no route alternatives will be tried that were combined with this route.
system
- (undocumented)materializer
- (undocumented)Route seal()
A sealed route has these properties:
- The result of the route will always be a complete response, i.e. the result of the future is a
Success(RouteResult.Complete(response))
, never a failed future and never a rejected route. These
will be already be handled using the implicitly given RejectionHandler
and ExceptionHandler
(or
the default handlers if none are given or can be found implicitly).
- Consequently, no route alternatives will be tried that were combined with this route.
Route seal(RoutingSettings routingSettings, ParserSettings parserSettings, RejectionHandler rejectionHandler, ExceptionHandler exceptionHandler, akka.actor.ActorSystem system, akka.stream.Materializer materializer)
ActorSystem
and Materializer
A sealed route has these properties:
- The result of the route will always be a complete response, i.e. the result of the future is a
Success(RouteResult.Complete(response))
, never a failed future and never a rejected route. These
will be already be handled using the implicitly given RejectionHandler
and ExceptionHandler
(or
the default handlers if none are given or can be found implicitly).
- Consequently, no route alternatives will be tried that were combined with this route.
routingSettings
- (undocumented)parserSettings
- (undocumented)rejectionHandler
- (undocumented)exceptionHandler
- (undocumented)system
- (undocumented)materializer
- (undocumented)Route seal(RoutingSettings routingSettings, ParserSettings parserSettings, RejectionHandler rejectionHandler, ExceptionHandler exceptionHandler)
RoutingSettings
and ParserSettings
A sealed route has these properties:
- The result of the route will always be a complete response, i.e. the result of the future is a
Success(RouteResult.Complete(response))
, never a failed future and never a rejected route. These
will be already be handled using the implicitly given RejectionHandler
and ExceptionHandler
(or
the default handlers if none are given or can be found implicitly).
- Consequently, no route alternatives will be tried that were combined with this route.
routingSettings
- (undocumented)parserSettings
- (undocumented)rejectionHandler
- (undocumented)exceptionHandler
- (undocumented)Route seal(RejectionHandler rejectionHandler, ExceptionHandler exceptionHandler)
A sealed route has these properties:
- The result of the route will always be a complete response, i.e. the result of the future is a
Success(RouteResult.Complete(response))
, never a failed future and never a rejected route. These
will be already be handled using the implicitly given RejectionHandler
and ExceptionHandler
(or
the default handlers if none are given or can be found implicitly).
- Consequently, no route alternatives will be tried that were combined with this route.
rejectionHandler
- (undocumented)exceptionHandler
- (undocumented)