Package akka.http.scaladsl.server
Class Route$
java.lang.Object
akka.http.scaladsl.server.Route$
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionscala.Function1<RequestContext,
scala.concurrent.Future<RouteResult>> apply
(scala.Function1<RequestContext, scala.concurrent.Future<RouteResult>> f) Helper for constructing a Route from a function literal.scala.Function1<HttpRequest,
scala.concurrent.Future<HttpResponse>> asyncHandler
(scala.Function1<RequestContext, scala.concurrent.Future<RouteResult>> route, RoutingSettings routingSettings, ParserSettings parserSettings, akka.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.scala.Function1<HttpRequest,
scala.concurrent.Future<HttpResponse>> createAsyncHandler
(scala.Function1<RequestContext, scala.concurrent.Future<RouteResult>> sealedRoute, RoutingLog routingLog, RoutingSettings routingSettings, ParserSettings parserSettings, scala.concurrent.ExecutionContextExecutor ec, akka.stream.Materializer mat) akka.stream.scaladsl.Flow<HttpRequest,
HttpResponse, akka.NotUsed> handlerFlow
(scala.Function1<RequestContext, scala.concurrent.Future<RouteResult>> route, RoutingSettings routingSettings, ParserSettings parserSettings, akka.stream.Materializer materializer, RoutingLog routingLog, scala.concurrent.ExecutionContextExecutor executionContext, RejectionHandler rejectionHandler, ExceptionHandler exceptionHandler) Deprecated.Replaced by `toFlow` that takes an implicit ActorSystem.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.akka.stream.scaladsl.Flow<HttpRequest,
HttpResponse, akka.NotUsed> toFlow
(scala.Function1<RequestContext, scala.concurrent.Future<RouteResult>> route, akka.actor.ClassicActorSystemProvider system) Turns aRoute
into a server flow.scala.Function1<HttpRequest,
scala.concurrent.Future<HttpResponse>> toFunction
(scala.Function1<RequestContext, scala.concurrent.Future<RouteResult>> route, akka.actor.ClassicActorSystemProvider system)
-
Field Details
-
MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Constructor Details
-
Route$
public Route$()
-
-
Method Details
-
apply
public 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.- Parameters:
f
- (undocumented)- Returns:
- (undocumented)
-
seal
public 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.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
andExceptionHandler
(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 {@link Directive.|} operator on directives.
- Parameters:
route
- (undocumented)routingSettings
- (undocumented)parserSettings
- (undocumented)rejectionHandler
- (undocumented)exceptionHandler
- (undocumented)- Returns:
- (undocumented)
-
toFlow
public akka.stream.scaladsl.Flow<HttpRequest,HttpResponse, toFlowakka.NotUsed> (scala.Function1<RequestContext, scala.concurrent.Future<RouteResult>> route, akka.actor.ClassicActorSystemProvider system) Turns aRoute
into a server flow.This conversion is also implicitly available wherever a
Route
is used throughRouteResult#routeToFlow
.- Parameters:
route
- (undocumented)system
- (undocumented)- Returns:
- (undocumented)
-
handlerFlow
public akka.stream.scaladsl.Flow<HttpRequest,HttpResponse, handlerFlowakka.NotUsed> (scala.Function1<RequestContext, scala.concurrent.Future<RouteResult>> route, RoutingSettings routingSettings, ParserSettings parserSettings, akka.stream.Materializer materializer, RoutingLog routingLog, scala.concurrent.ExecutionContextExecutor executionContext, RejectionHandler rejectionHandler, ExceptionHandler exceptionHandler) Deprecated.Replaced by `toFlow` that takes an implicit ActorSystem. Since 10.2.0.Turns aRoute
into a server flow.- Parameters:
route
- (undocumented)routingSettings
- (undocumented)parserSettings
- (undocumented)materializer
- (undocumented)routingLog
- (undocumented)executionContext
- (undocumented)rejectionHandler
- (undocumented)exceptionHandler
- (undocumented)- Returns:
- (undocumented)
-
toFunction
public scala.Function1<HttpRequest,scala.concurrent.Future<HttpResponse>> toFunction(scala.Function1<RequestContext, scala.concurrent.Future<RouteResult>> route, akka.actor.ClassicActorSystemProvider system) -
asyncHandler
public scala.Function1<HttpRequest,scala.concurrent.Future<HttpResponse>> asyncHandler(scala.Function1<RequestContext, scala.concurrent.Future<RouteResult>> route, RoutingSettings routingSettings, ParserSettings parserSettings, akka.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 10.2.0.Turns aRoute
into an async handler function.- Parameters:
route
- (undocumented)routingSettings
- (undocumented)parserSettings
- (undocumented)materializer
- (undocumented)routingLog
- (undocumented)executionContext
- (undocumented)rejectionHandler
- (undocumented)exceptionHandler
- (undocumented)- Returns:
- (undocumented)
-
createAsyncHandler
public scala.Function1<HttpRequest,scala.concurrent.Future<HttpResponse>> createAsyncHandler(scala.Function1<RequestContext, scala.concurrent.Future<RouteResult>> sealedRoute, RoutingLog routingLog, RoutingSettings routingSettings, ParserSettings parserSettings, scala.concurrent.ExecutionContextExecutor ec, akka.stream.Materializer mat)
-