public class Route
extends java.lang.Object
| Constructor and Description |
|---|
Route() |
| Modifier and Type | Method and Description |
|---|---|
static scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> |
apply(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> f)
Helper for constructing a Route from a function literal.
|
static scala.Function1<HttpRequest,scala.concurrent.Future<HttpResponse>> |
asyncHandler(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> route,
RoutingSettings routingSettings,
ParserSettings parserSettings,
org.apache.pekko.stream.Materializer materializer,
RoutingLog routingLog,
scala.concurrent.ExecutionContextExecutor executionContext,
RejectionHandler rejectionHandler,
ExceptionHandler exceptionHandler)
Deprecated.
Use `toFunction` instead, which only requires an implicit ActorSystem and no rejection/exception handlers. Use directives to specify custom exceptions or rejection handlers. Since Akka HTTP 10.2.0.
|
static org.apache.pekko.stream.scaladsl.Flow<HttpRequest,HttpResponse,org.apache.pekko.NotUsed> |
handlerFlow(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> route,
RoutingSettings routingSettings,
ParserSettings parserSettings,
org.apache.pekko.stream.Materializer materializer,
RoutingLog routingLog,
scala.concurrent.ExecutionContextExecutor executionContext,
RejectionHandler rejectionHandler,
ExceptionHandler exceptionHandler)
Deprecated.
Replaced by `toFlow` that takes an implicit ActorSystem. Since Akka HTTP 10.2.0.
|
static scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> |
seal(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> route,
RoutingSettings routingSettings,
ParserSettings parserSettings,
RejectionHandler rejectionHandler,
ExceptionHandler exceptionHandler)
"Seals" a route by wrapping it with default exception handling and rejection conversion.
|
static org.apache.pekko.stream.scaladsl.Flow<HttpRequest,HttpResponse,org.apache.pekko.NotUsed> |
toFlow(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> route,
org.apache.pekko.actor.ClassicActorSystemProvider system)
Turns a
Route into a server flow. |
static scala.Function1<HttpRequest,scala.concurrent.Future<HttpResponse>> |
toFunction(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> route,
org.apache.pekko.actor.ClassicActorSystemProvider system) |
public static scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> apply(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> f)
f - (undocumented)public static scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> seal(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> route, RoutingSettings routingSettings, ParserSettings parserSettings, 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
using the ~ on routes or the Directive.| operator on directives.
route - (undocumented)routingSettings - (undocumented)parserSettings - (undocumented)rejectionHandler - (undocumented)exceptionHandler - (undocumented)public static org.apache.pekko.stream.scaladsl.Flow<HttpRequest,HttpResponse,org.apache.pekko.NotUsed> toFlow(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> route, org.apache.pekko.actor.ClassicActorSystemProvider system)
Route into a server flow.
This conversion is also implicitly available wherever a Route is used through RouteResult#routeToFlow.
route - (undocumented)system - (undocumented)public static org.apache.pekko.stream.scaladsl.Flow<HttpRequest,HttpResponse,org.apache.pekko.NotUsed> handlerFlow(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> route, RoutingSettings routingSettings, ParserSettings parserSettings, org.apache.pekko.stream.Materializer materializer, RoutingLog routingLog, scala.concurrent.ExecutionContextExecutor executionContext, RejectionHandler rejectionHandler, ExceptionHandler exceptionHandler)
Route into a server flow.route - (undocumented)routingSettings - (undocumented)parserSettings - (undocumented)materializer - (undocumented)routingLog - (undocumented)executionContext - (undocumented)rejectionHandler - (undocumented)exceptionHandler - (undocumented)public static scala.Function1<HttpRequest,scala.concurrent.Future<HttpResponse>> toFunction(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> route, org.apache.pekko.actor.ClassicActorSystemProvider system)
public static scala.Function1<HttpRequest,scala.concurrent.Future<HttpResponse>> asyncHandler(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> route, RoutingSettings routingSettings, ParserSettings parserSettings, org.apache.pekko.stream.Materializer materializer, RoutingLog routingLog, scala.concurrent.ExecutionContextExecutor executionContext, RejectionHandler rejectionHandler, ExceptionHandler exceptionHandler)
Route into an async handler function.route - (undocumented)routingSettings - (undocumented)parserSettings - (undocumented)materializer - (undocumented)routingLog - (undocumented)executionContext - (undocumented)rejectionHandler - (undocumented)exceptionHandler - (undocumented)