Package akka.http.scaladsl.server
Class RequestContextImpl
- java.lang.Object
-
- akka.http.scaladsl.server.RequestContextImpl
-
- All Implemented Interfaces:
RequestContext
public class RequestContextImpl extends java.lang.Object implements RequestContext
INTERNAL API
-
-
Constructor Summary
Constructors Constructor Description RequestContextImpl(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description scala.concurrent.Future<RouteResult>complete(ToResponseMarshallable trm)Completes the request with the given ToResponseMarshallable.scala.concurrent.ExecutionContextExecutorexecutionContext()The default ExecutionContext to be used for scheduling asynchronous logic related to this request.scala.concurrent.Future<RouteResult>fail(java.lang.Throwable error)Bubbles the given error up the response chain where it is dealt with by the closesthandleExceptionsdirective and itsExceptionHandler, unless the error is aRejectionError.akka.event.LoggingAdapterlog()The default LoggingAdapter to be used for logging messages related to this request.RequestContextmapRequest(scala.Function1<HttpRequest,HttpRequest> f)Returns a copy of this context with the HttpRequest transformed by the given function.RequestContextmapUnmatchedPath(scala.Function1<Uri.Path,Uri.Path> f)Returns a copy of this context with the unmatchedPath transformed by the given function.akka.stream.Materializermaterializer()The default Materializer.ParserSettingsparserSettings()The default ParserSettings to be used for configuring directives.RequestContextreconfigure(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>reject(scala.collection.immutable.Seq<Rejection> rejections)Rejects the request with the given rejections.HttpRequestrequest()The request this context represents.RoutingSettingssettings()The default RoutingSettings to be used for configuring directives.java.lang.StringtoString()Uri.PathunmatchedPath()The unmatched path of this context.RequestContextwithAcceptAll()Removes a potentially existing Accept header from the request headers.RequestContextwithExecutionContext(scala.concurrent.ExecutionContextExecutor executionContext)Returns a copy of this context with the new HttpRequest.RequestContextwithLog(akka.event.LoggingAdapter log)Returns a copy of this context with the new LoggingAdapter.RequestContextwithMaterializer(akka.stream.Materializer materializer)Returns a copy of this context with the new HttpRequest.RequestContextwithParserSettings(ParserSettings parserSettings)Returns a copy of this context with the newParserSettings.RequestContextwithRequest(HttpRequest request)Returns a copy of this context with the new HttpRequest.RequestContextwithRoutingSettings(RoutingSettings routingSettings)Returns a copy of this context with the new RoutingSettings.RequestContextwithUnmatchedPath(Uri.Path path)Returns a copy of this context with the unmatched path updated to the given one.
-
-
-
Constructor Detail
-
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 Detail
-
complete
public scala.concurrent.Future<RouteResult> complete(ToResponseMarshallable trm)
Description copied from interface:RequestContextCompletes the request with the given ToResponseMarshallable.- Specified by:
completein interfaceRequestContext- Parameters:
trm- (undocumented)- Returns:
- (undocumented)
-
executionContext
public scala.concurrent.ExecutionContextExecutor executionContext()
Description copied from interface:RequestContextThe default ExecutionContext to be used for scheduling asynchronous logic related to this request.- Specified by:
executionContextin interfaceRequestContext- Returns:
- (undocumented)
-
fail
public scala.concurrent.Future<RouteResult> fail(java.lang.Throwable error)
Description copied from interface:RequestContextBubbles the given error up the response chain where it is dealt with by the closesthandleExceptionsdirective and itsExceptionHandler, unless the error is aRejectionError. In this case the wrapped rejection is unpacked and "executed".- Specified by:
failin interfaceRequestContext- Parameters:
error- (undocumented)- Returns:
- (undocumented)
-
log
public akka.event.LoggingAdapter log()
Description copied from interface:RequestContextThe default LoggingAdapter to be used for logging messages related to this request.- Specified by:
login interfaceRequestContext- Returns:
- (undocumented)
-
mapRequest
public RequestContext mapRequest(scala.Function1<HttpRequest,HttpRequest> f)
Description copied from interface:RequestContextReturns a copy of this context with the HttpRequest transformed by the given function.- Specified by:
mapRequestin interfaceRequestContext- Parameters:
f- (undocumented)- Returns:
- (undocumented)
-
mapUnmatchedPath
public RequestContext mapUnmatchedPath(scala.Function1<Uri.Path,Uri.Path> f)
Description copied from interface:RequestContextReturns a copy of this context with the unmatchedPath transformed by the given function.- Specified by:
mapUnmatchedPathin interfaceRequestContext- Parameters:
f- (undocumented)- Returns:
- (undocumented)
-
materializer
public akka.stream.Materializer materializer()
Description copied from interface:RequestContextThe default Materializer.- Specified by:
materializerin interfaceRequestContext- Returns:
- (undocumented)
-
parserSettings
public ParserSettings parserSettings()
Description copied from interface:RequestContextThe default ParserSettings to be used for configuring directives.- Specified by:
parserSettingsin 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:RequestContextReturns a copy of this context with the given fields updated.- Specified by:
reconfigurein 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:RequestContextCompletes the request with redirection response of the given type to the given URI.- Specified by:
redirectin 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:RequestContextRejects the request with the given rejections.- Specified by:
rejectin interfaceRequestContext- Parameters:
rejections- (undocumented)- Returns:
- (undocumented)
-
request
public HttpRequest request()
Description copied from interface:RequestContextThe request this context represents. Modelled as a `val` so as to enable an `import ctx.request._`.- Specified by:
requestin interfaceRequestContext
-
settings
public RoutingSettings settings()
Description copied from interface:RequestContextThe default RoutingSettings to be used for configuring directives.- Specified by:
settingsin interfaceRequestContext- Returns:
- (undocumented)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
unmatchedPath
public Uri.Path unmatchedPath()
Description copied from interface:RequestContextThe unmatched path of this context. Modelled as a `val` so as to enable an `import ctx.unmatchedPath._`.- Specified by:
unmatchedPathin interfaceRequestContext
-
withAcceptAll
public RequestContext withAcceptAll()
Description copied from interface:RequestContextRemoves a potentially existing Accept header from the request headers.- Specified by:
withAcceptAllin interfaceRequestContext- Returns:
- (undocumented)
-
withExecutionContext
public RequestContext withExecutionContext(scala.concurrent.ExecutionContextExecutor executionContext)
Description copied from interface:RequestContextReturns a copy of this context with the new HttpRequest.- Specified by:
withExecutionContextin interfaceRequestContext- Parameters:
executionContext- (undocumented)- Returns:
- (undocumented)
-
withLog
public RequestContext withLog(akka.event.LoggingAdapter log)
Description copied from interface:RequestContextReturns a copy of this context with the new LoggingAdapter.- Specified by:
withLogin interfaceRequestContext- Parameters:
log- (undocumented)- Returns:
- (undocumented)
-
withMaterializer
public RequestContext withMaterializer(akka.stream.Materializer materializer)
Description copied from interface:RequestContextReturns a copy of this context with the new HttpRequest.- Specified by:
withMaterializerin interfaceRequestContext- Parameters:
materializer- (undocumented)- Returns:
- (undocumented)
-
withParserSettings
public RequestContext withParserSettings(ParserSettings parserSettings)
Description copied from interface:RequestContextReturns a copy of this context with the newParserSettings.- Specified by:
withParserSettingsin interfaceRequestContext- Parameters:
parserSettings- (undocumented)- Returns:
- (undocumented)
-
withRequest
public RequestContext withRequest(HttpRequest request)
Description copied from interface:RequestContextReturns a copy of this context with the new HttpRequest.- Specified by:
withRequestin interfaceRequestContext- Parameters:
request- (undocumented)- Returns:
- (undocumented)
-
withRoutingSettings
public RequestContext withRoutingSettings(RoutingSettings routingSettings)
Description copied from interface:RequestContextReturns a copy of this context with the new RoutingSettings.- Specified by:
withRoutingSettingsin interfaceRequestContext- Parameters:
routingSettings- (undocumented)- Returns:
- (undocumented)
-
withUnmatchedPath
public RequestContext withUnmatchedPath(Uri.Path path)
Description copied from interface:RequestContextReturns a copy of this context with the unmatched path updated to the given one.- Specified by:
withUnmatchedPathin interfaceRequestContext- Parameters:
path- (undocumented)- Returns:
- (undocumented)
-
-