Class RouteAdapter

java.lang.Object
akka.http.javadsl.server.directives.RouteAdapter
All Implemented Interfaces:
HandlerProvider, Route

public final class RouteAdapter extends Object implements Route
INTERNAL API
  • Constructor Details

  • Method Details

    • apply

      public static RouteAdapter apply(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> delegate)
    • asJava

      public static Route asJava(scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> delegate)
      Java DSL: Adapt an existing ScalaDSL Route as an Java DSL Route
    • delegate

      public scala.Function1<RequestContext,scala.concurrent.Future<RouteResult>> delegate()
      Description copied from interface: Route
      INTERNAL API
      Specified by:
      delegate in interface Route
    • flow

      public akka.stream.javadsl.Flow<HttpRequest,HttpResponse,akka.NotUsed> flow(akka.actor.ActorSystem system, akka.stream.Materializer materializer)
      Specified by:
      flow in interface Route
    • handler

      public akka.japi.function.Function<HttpRequest,CompletionStage<HttpResponse>> handler(akka.actor.ClassicActorSystemProvider system)
      Specified by:
      handler in interface HandlerProvider
      Specified by:
      handler in interface Route
    • orElse

      public Route orElse(Route alternative)
      Specified by:
      orElse in interface Route
    • seal

      public Route seal()
      Description copied from interface: Route
      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 default RejectionHandler and ExceptionHandler. - Consequently, no route alternatives will be tried that were combined with this route.

      Specified by:
      seal in interface Route
      Returns:
      (undocumented)
    • seal

      public Route seal(RejectionHandler rejectionHandler, ExceptionHandler exceptionHandler)
      Description copied from interface: Route
      Seals a route by wrapping it with explicit 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 given RejectionHandler and ExceptionHandler. - Consequently, no route alternatives will be tried that were combined with this route.

      Specified by:
      seal in interface Route
      Parameters:
      rejectionHandler - (undocumented)
      exceptionHandler - (undocumented)
      Returns:
      (undocumented)
    • toString

      public String toString()
      Overrides:
      toString in class Object