public abstract class FutureDirectives extends FormFieldDirectives
Constructor and Description |
---|
FutureDirectives() |
Modifier and Type | Method and Description |
---|---|
<T> Route |
completeOrRecoverWith(java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> f,
Marshaller<T,RequestEntity> marshaller,
java.util.function.Function<java.lang.Throwable,Route> inner)
"Unwraps" a
CompletionStage and runs the inner route when the stage has failed
with the stage's failure exception as an extraction of type Throwable . |
<T> RouteAdapter |
onComplete(java.util.concurrent.CompletionStage<T> cs,
java.util.function.Function<scala.util.Try<T>,Route> inner)
"Unwraps" a
CompletionStage and runs the inner route after future
completion with the future's value as an extraction of type Try . |
<T> RouteAdapter |
onComplete(java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> f,
java.util.function.Function<scala.util.Try<T>,Route> inner)
"Unwraps" a
CompletionStage and runs the inner route after future
completion with the future's value as an extraction of type Try . |
<T> RouteAdapter |
onCompleteWithBreaker(org.apache.pekko.pattern.CircuitBreaker breaker,
java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> f,
java.util.function.Function<scala.util.Try<T>,Route> inner)
"Unwraps" a
CompletionStage[T] and runs the inner route after future
completion with the future's value as an extraction of type T if
the supplied CircuitBreaker is closed. |
<T> RouteAdapter |
onSuccess(java.util.concurrent.CompletionStage<T> cs,
java.util.function.Function<T,Route> inner)
"Unwraps" a
CompletionStage and runs the inner route after stage
completion with the stage's value as an extraction of type T . |
<T> RouteAdapter |
onSuccess(java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> f,
java.util.function.Function<T,Route> inner)
"Unwraps" a
CompletionStage and runs the inner route after stage
completion with the stage's value as an extraction of type T . |
formField, formField, formFieldList, formFieldList, formFieldList, formFieldMap, formFieldMultiMap, formFieldOptional, formFieldOptional
fileUpload, fileUploadAll, storeUploadedFile, storeUploadedFiles
defaultContentTypeResolver, defaultDirectoryRenderer, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromDirectory, getFromDirectory, getFromFile, getFromFile, getFromFile, getFromFile, getFromFile, getFromResource, getFromResource, getFromResource, getFromResource, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, listDirectoryContents, listDirectoryContents, listDirectoryContents, listDirectoryContents
handleExceptions, handleRejections
logRequest, logRequest, logRequest, logRequestResult, logRequestResultOptional, logResult, logResult, logResult
cookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, optionalCookie, setCookie, setCookie
decodeRequest, decodeRequestWith, decodeRequestWith, encodeResponse, encodeResponseWith, requestEncodedWith, responseEncodingAccepted, withPrecompressedMediaTypeSupport
conditional, conditional, conditional, conditional
cancelRejection, cancelRejections, cancelRejections, extract, extractActorSystem, extractDataBytes, extractEntity, extractExecutionContext, extractLog, extractMatchedPath, extractMaterializer, extractParserSettings, extractRequest, extractRequestContext, extractRequestEntity, extractSettings, extractStrictEntity, extractStrictEntity, extractUnmatchedPath, extractUri, mapInnerRoute, mapRejections, mapRequest, mapRequestContext, mapResponse, mapResponseEntity, mapResponseHeaders, mapRouteResult, mapRouteResultFuture, mapRouteResultPF, mapRouteResultWith, mapRouteResultWithPF, mapSettings, mapUnmatchedPath, pass, provide, recoverRejections, recoverRejectionsWith, toStrictEntity, toStrictEntity, withExecutionContext, withLog, withMaterializer, withSettings
public <T> Route completeOrRecoverWith(java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> f, Marshaller<T,RequestEntity> marshaller, java.util.function.Function<java.lang.Throwable,Route> inner)
CompletionStage
and runs the inner route when the stage has failed
with the stage's failure exception as an extraction of type Throwable
.
If the completion stage succeeds the request is completed using the values marshaller
(This directive therefore requires a marshaller for the completion stage value type to be
provided.)
f
- (undocumented)marshaller
- (undocumented)inner
- (undocumented)public <T> RouteAdapter onComplete(java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> f, java.util.function.Function<scala.util.Try<T>,Route> inner)
CompletionStage
and runs the inner route after future
completion with the future's value as an extraction of type Try
.
f
- (undocumented)inner
- (undocumented)public <T> RouteAdapter onComplete(java.util.concurrent.CompletionStage<T> cs, java.util.function.Function<scala.util.Try<T>,Route> inner)
CompletionStage
and runs the inner route after future
completion with the future's value as an extraction of type Try
.
cs
- (undocumented)inner
- (undocumented)public <T> RouteAdapter onCompleteWithBreaker(org.apache.pekko.pattern.CircuitBreaker breaker, java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> f, java.util.function.Function<scala.util.Try<T>,Route> inner)
CompletionStage[T]
and runs the inner route after future
completion with the future's value as an extraction of type T
if
the supplied CircuitBreaker
is closed.
If the supplied CircuitBreaker
is open the request is rejected
with a pekko.http.javadsl.server.CircuitBreakerOpenRejection
.
breaker
- (undocumented)f
- (undocumented)inner
- (undocumented)public <T> RouteAdapter onSuccess(java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> f, java.util.function.Function<T,Route> inner)
CompletionStage
and runs the inner route after stage
completion with the stage's value as an extraction of type T
.
If the stage fails its failure Throwable is bubbled up to the nearest
ExceptionHandler.
f
- (undocumented)inner
- (undocumented)public <T> RouteAdapter onSuccess(java.util.concurrent.CompletionStage<T> cs, java.util.function.Function<T,Route> inner)
CompletionStage
and runs the inner route after stage
completion with the stage's value as an extraction of type T
.
If the stage fails its failure Throwable is bubbled up to the nearest
ExceptionHandler.
cs
- (undocumented)inner
- (undocumented)