Package akka.http.scaladsl.server
Class RequestContextImpl
java.lang.Object
akka.http.scaladsl.server.RequestContextImpl
- All Implemented Interfaces:
RequestContext
INTERNAL API
-
Constructor Summary
ConstructorsConstructorDescriptionRequestContextImpl
(HttpRequest request, akka.event.LoggingAdapter log, RoutingSettings settings, ParserSettings parserSettings, scala.concurrent.ExecutionContextExecutor ec, akka.stream.Materializer materializer) RequestContextImpl
(HttpRequest request, Uri.Path unmatchedPath, scala.concurrent.ExecutionContextExecutor executionContext, akka.stream.Materializer materializer, akka.event.LoggingAdapter log, RoutingSettings settings, ParserSettings parserSettings) -
Method Summary
Modifier and TypeMethodDescriptionscala.concurrent.Future<RouteResult>
Completes the request with the given ToResponseMarshallable.scala.concurrent.ExecutionContextExecutor
The default ExecutionContext to be used for scheduling asynchronous logic related to this request.scala.concurrent.Future<RouteResult>
Bubbles the given error up the response chain where it is dealt with by the closesthandleExceptions
directive and itsExceptionHandler
, unless the error is aRejectionError
.akka.event.LoggingAdapter
log()
The default LoggingAdapter to be used for logging messages related to this request.mapRequest
(scala.Function1<HttpRequest, HttpRequest> f) Returns a copy of this context with the HttpRequest transformed by the given function.mapUnmatchedPath
(scala.Function1<Uri.Path, Uri.Path> f) Returns a copy of this context with the unmatchedPath transformed by the given function.akka.stream.Materializer
The default Materializer.The default ParserSettings to be used for configuring directives.reconfigure
(scala.concurrent.ExecutionContextExecutor executionContext, akka.stream.Materializer materializer, akka.event.LoggingAdapter log, RoutingSettings settings) Returns a copy of this context with the given fields updated.scala.concurrent.Future<RouteResult>
redirect
(Uri uri, StatusCodes.Redirection redirectionType) Completes the request with redirection response of the given type to the given URI.scala.concurrent.Future<RouteResult>
Rejects the request with the given rejections.request()
The request this context represents.settings()
The default RoutingSettings to be used for configuring directives.toString()
The unmatched path of this context.Removes a potentially existing Accept header from the request headers.withExecutionContext
(scala.concurrent.ExecutionContextExecutor executionContext) Returns a copy of this context with the new HttpRequest.withLog
(akka.event.LoggingAdapter log) Returns a copy of this context with the new LoggingAdapter.withMaterializer
(akka.stream.Materializer materializer) Returns a copy of this context with the new HttpRequest.withParserSettings
(ParserSettings parserSettings) Returns a copy of this context with the newParserSettings
.withRequest
(HttpRequest request) Returns a copy of this context with the new HttpRequest.withRoutingSettings
(RoutingSettings routingSettings) Returns a copy of this context with the new RoutingSettings.withUnmatchedPath
(Uri.Path path) Returns a copy of this context with the unmatched path updated to the given one.
-
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
Description copied from interface:RequestContext
Completes the request with the given ToResponseMarshallable.- Specified by:
complete
in interfaceRequestContext
- 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 interfaceRequestContext
- Returns:
- (undocumented)
-
fail
Description copied from interface:RequestContext
Bubbles the given error up the response chain where it is dealt with by the closesthandleExceptions
directive and itsExceptionHandler
, unless the error is aRejectionError
. In this case the wrapped rejection is unpacked and "executed".- Specified by:
fail
in interfaceRequestContext
- 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 interfaceRequestContext
- Returns:
- (undocumented)
-
mapRequest
Description copied from interface:RequestContext
Returns a copy of this context with the HttpRequest transformed by the given function.- Specified by:
mapRequest
in interfaceRequestContext
- Parameters:
f
- (undocumented)- Returns:
- (undocumented)
-
mapUnmatchedPath
Description copied from interface:RequestContext
Returns a copy of this context with the unmatchedPath transformed by the given function.- Specified by:
mapUnmatchedPath
in interfaceRequestContext
- Parameters:
f
- (undocumented)- Returns:
- (undocumented)
-
materializer
public akka.stream.Materializer materializer()Description copied from interface:RequestContext
The default Materializer.- Specified by:
materializer
in interfaceRequestContext
- Returns:
- (undocumented)
-
parserSettings
Description copied from interface:RequestContext
The default ParserSettings to be used for configuring directives.- Specified by:
parserSettings
in interfaceRequestContext
- 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 interfaceRequestContext
- 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 interfaceRequestContext
- 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 interfaceRequestContext
- Parameters:
rejections
- (undocumented)- Returns:
- (undocumented)
-
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 interfaceRequestContext
-
settings
Description copied from interface:RequestContext
The default RoutingSettings to be used for configuring directives.- Specified by:
settings
in interfaceRequestContext
- Returns:
- (undocumented)
-
toString
-
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 interfaceRequestContext
-
withAcceptAll
Description copied from interface:RequestContext
Removes a potentially existing Accept header from the request headers.- Specified by:
withAcceptAll
in interfaceRequestContext
- 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 interfaceRequestContext
- Parameters:
executionContext
- (undocumented)- Returns:
- (undocumented)
-
withLog
Description copied from interface:RequestContext
Returns a copy of this context with the new LoggingAdapter.- Specified by:
withLog
in interfaceRequestContext
- Parameters:
log
- (undocumented)- Returns:
- (undocumented)
-
withMaterializer
Description copied from interface:RequestContext
Returns a copy of this context with the new HttpRequest.- Specified by:
withMaterializer
in interfaceRequestContext
- Parameters:
materializer
- (undocumented)- Returns:
- (undocumented)
-
withParserSettings
Description copied from interface:RequestContext
Returns a copy of this context with the newParserSettings
.- Specified by:
withParserSettings
in interfaceRequestContext
- Parameters:
parserSettings
- (undocumented)- Returns:
- (undocumented)
-
withRequest
Description copied from interface:RequestContext
Returns a copy of this context with the new HttpRequest.- Specified by:
withRequest
in interfaceRequestContext
- Parameters:
request
- (undocumented)- Returns:
- (undocumented)
-
withRoutingSettings
Description copied from interface:RequestContext
Returns a copy of this context with the new RoutingSettings.- Specified by:
withRoutingSettings
in interfaceRequestContext
- Parameters:
routingSettings
- (undocumented)- Returns:
- (undocumented)
-
withUnmatchedPath
Description copied from interface:RequestContext
Returns a copy of this context with the unmatched path updated to the given one.- Specified by:
withUnmatchedPath
in interfaceRequestContext
- Parameters:
path
- (undocumented)- Returns:
- (undocumented)
-