Class RequestContextImpl

java.lang.Object
akka.http.scaladsl.server.RequestContextImpl
All Implemented Interfaces:
RequestContext

public class RequestContextImpl extends Object implements RequestContext
INTERNAL API
  • Constructor Details

    • RequestContextImpl

      public RequestContextImpl(HttpRequest request, Uri.Path unmatchedPath, scala.concurrent.ExecutionContextExecutor executionContext, akka.stream.Materializer materializer, akka.event.LoggingAdapter log, RoutingSettings settings, ParserSettings parserSettings)
    • RequestContextImpl

      public RequestContextImpl(HttpRequest request, akka.event.LoggingAdapter log, RoutingSettings settings, ParserSettings parserSettings, scala.concurrent.ExecutionContextExecutor ec, akka.stream.Materializer materializer)
  • Method Details

    • complete

      public scala.concurrent.Future<RouteResult> complete(ToResponseMarshallable trm)
      Description copied from interface: RequestContext
      Completes the request with the given ToResponseMarshallable.
      Specified by:
      complete in interface RequestContext
      Parameters:
      trm - (undocumented)
      Returns:
      (undocumented)
    • executionContext

      public scala.concurrent.ExecutionContextExecutor executionContext()
      Description copied from interface: RequestContext
      The default ExecutionContext to be used for scheduling asynchronous logic related to this request.
      Specified by:
      executionContext in interface RequestContext
      Returns:
      (undocumented)
    • fail

      public scala.concurrent.Future<RouteResult> fail(Throwable error)
      Description copied from interface: RequestContext
      Bubbles the given error up the response chain where it is dealt with by the closest handleExceptions directive and its ExceptionHandler, unless the error is a RejectionError. In this case the wrapped rejection is unpacked and "executed".
      Specified by:
      fail in interface RequestContext
      Parameters:
      error - (undocumented)
      Returns:
      (undocumented)
    • log

      public akka.event.LoggingAdapter log()
      Description copied from interface: RequestContext
      The default LoggingAdapter to be used for logging messages related to this request.
      Specified by:
      log in interface RequestContext
      Returns:
      (undocumented)
    • mapRequest

      public RequestContext mapRequest(scala.Function1<HttpRequest,HttpRequest> f)
      Description copied from interface: RequestContext
      Returns a copy of this context with the HttpRequest transformed by the given function.
      Specified by:
      mapRequest in interface RequestContext
      Parameters:
      f - (undocumented)
      Returns:
      (undocumented)
    • mapUnmatchedPath

      public RequestContext mapUnmatchedPath(scala.Function1<Uri.Path,Uri.Path> f)
      Description copied from interface: RequestContext
      Returns a copy of this context with the unmatchedPath transformed by the given function.
      Specified by:
      mapUnmatchedPath in interface RequestContext
      Parameters:
      f - (undocumented)
      Returns:
      (undocumented)
    • materializer

      public akka.stream.Materializer materializer()
      Description copied from interface: RequestContext
      The default Materializer.
      Specified by:
      materializer in interface RequestContext
      Returns:
      (undocumented)
    • parserSettings

      public ParserSettings parserSettings()
      Description copied from interface: RequestContext
      The default ParserSettings to be used for configuring directives.
      Specified by:
      parserSettings in interface RequestContext
      Returns:
      (undocumented)
    • reconfigure

      public RequestContext reconfigure(scala.concurrent.ExecutionContextExecutor executionContext, akka.stream.Materializer materializer, akka.event.LoggingAdapter log, RoutingSettings settings)
      Description copied from interface: RequestContext
      Returns a copy of this context with the given fields updated.
      Specified by:
      reconfigure in interface RequestContext
      Parameters:
      executionContext - (undocumented)
      materializer - (undocumented)
      log - (undocumented)
      settings - (undocumented)
      Returns:
      (undocumented)
    • redirect

      public scala.concurrent.Future<RouteResult> redirect(Uri uri, StatusCodes.Redirection redirectionType)
      Description copied from interface: RequestContext
      Completes the request with redirection response of the given type to the given URI.

      Specified by:
      redirect in interface RequestContext
      Parameters:
      uri - (undocumented)
      redirectionType - (undocumented)
      Returns:
      (undocumented)
    • reject

      public scala.concurrent.Future<RouteResult> reject(scala.collection.immutable.Seq<Rejection> rejections)
      Description copied from interface: RequestContext
      Rejects the request with the given rejections.
      Specified by:
      reject in interface RequestContext
      Parameters:
      rejections - (undocumented)
      Returns:
      (undocumented)
    • request

      public HttpRequest request()
      Description copied from interface: RequestContext
      The request this context represents. Modelled as a `val` so as to enable an `import ctx.request._`.
      Specified by:
      request in interface RequestContext
    • settings

      public RoutingSettings settings()
      Description copied from interface: RequestContext
      The default RoutingSettings to be used for configuring directives.
      Specified by:
      settings in interface RequestContext
      Returns:
      (undocumented)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • unmatchedPath

      public Uri.Path unmatchedPath()
      Description copied from interface: RequestContext
      The unmatched path of this context. Modelled as a `val` so as to enable an `import ctx.unmatchedPath._`.
      Specified by:
      unmatchedPath in interface RequestContext
    • withAcceptAll

      public RequestContext withAcceptAll()
      Description copied from interface: RequestContext
      Removes a potentially existing Accept header from the request headers.
      Specified by:
      withAcceptAll in interface RequestContext
      Returns:
      (undocumented)
    • withExecutionContext

      public RequestContext withExecutionContext(scala.concurrent.ExecutionContextExecutor executionContext)
      Description copied from interface: RequestContext
      Returns a copy of this context with the new HttpRequest.
      Specified by:
      withExecutionContext in interface RequestContext
      Parameters:
      executionContext - (undocumented)
      Returns:
      (undocumented)
    • withLog

      public RequestContext withLog(akka.event.LoggingAdapter log)
      Description copied from interface: RequestContext
      Returns a copy of this context with the new LoggingAdapter.
      Specified by:
      withLog in interface RequestContext
      Parameters:
      log - (undocumented)
      Returns:
      (undocumented)
    • withMaterializer

      public RequestContext withMaterializer(akka.stream.Materializer materializer)
      Description copied from interface: RequestContext
      Returns a copy of this context with the new HttpRequest.
      Specified by:
      withMaterializer in interface RequestContext
      Parameters:
      materializer - (undocumented)
      Returns:
      (undocumented)
    • withParserSettings

      public RequestContext withParserSettings(ParserSettings parserSettings)
      Description copied from interface: RequestContext
      Returns a copy of this context with the new ParserSettings.
      Specified by:
      withParserSettings in interface RequestContext
      Parameters:
      parserSettings - (undocumented)
      Returns:
      (undocumented)
    • withRequest

      public RequestContext withRequest(HttpRequest request)
      Description copied from interface: RequestContext
      Returns a copy of this context with the new HttpRequest.
      Specified by:
      withRequest in interface RequestContext
      Parameters:
      request - (undocumented)
      Returns:
      (undocumented)
    • withRoutingSettings

      public RequestContext withRoutingSettings(RoutingSettings routingSettings)
      Description copied from interface: RequestContext
      Returns a copy of this context with the new RoutingSettings.
      Specified by:
      withRoutingSettings in interface RequestContext
      Parameters:
      routingSettings - (undocumented)
      Returns:
      (undocumented)
    • withUnmatchedPath

      public RequestContext withUnmatchedPath(Uri.Path path)
      Description copied from interface: RequestContext
      Returns a copy of this context with the unmatched path updated to the given one.
      Specified by:
      withUnmatchedPath in interface RequestContext
      Parameters:
      path - (undocumented)
      Returns:
      (undocumented)