Class FutureDirectives
java.lang.Object
org.apache.pekko.http.javadsl.server.directives.BasicDirectives
org.apache.pekko.http.javadsl.server.directives.CacheConditionDirectives
org.apache.pekko.http.javadsl.server.directives.CodingDirectives
org.apache.pekko.http.javadsl.server.directives.CookieDirectives
org.apache.pekko.http.javadsl.server.directives.DebuggingDirectives
org.apache.pekko.http.javadsl.server.directives.ExecutionDirectives
org.apache.pekko.http.javadsl.server.directives.FileAndResourceDirectives
org.apache.pekko.http.javadsl.server.directives.FileUploadDirectives
org.apache.pekko.http.javadsl.server.directives.FormFieldDirectives
org.apache.pekko.http.javadsl.server.directives.FutureDirectives
- Direct Known Subclasses:
HeaderDirectives
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> RoutecompleteOrRecoverWith(Supplier<CompletionStage<T>> f, Marshaller<T, RequestEntity> marshaller, Function<Throwable, Route> inner) "Unwraps" aCompletionStageand runs the inner route when the stage has failed with the stage's failure exception as an extraction of typeThrowable.<T> RouteAdapteronComplete(CompletionStage<T> cs, Function<scala.util.Try<T>, Route> inner) "Unwraps" aCompletionStageand runs the inner route after future completion with the future's value as an extraction of typeTry.<T> RouteAdapteronComplete(Supplier<CompletionStage<T>> f, Function<scala.util.Try<T>, Route> inner) "Unwraps" aCompletionStageand runs the inner route after future completion with the future's value as an extraction of typeTry.<T> RouteAdapteronCompleteWithBreaker(org.apache.pekko.pattern.CircuitBreaker breaker, Supplier<CompletionStage<T>> f, Function<scala.util.Try<T>, Route> inner) "Unwraps" aCompletionStage[T]and runs the inner route after future completion with the future's value as an extraction of typeTif the suppliedCircuitBreakeris closed.<T> RouteAdapteronSuccess(CompletionStage<T> cs, Function<T, Route> inner) "Unwraps" aCompletionStageand runs the inner route after stage completion with the stage's value as an extraction of typeT.<T> RouteAdapteronSuccess(Supplier<CompletionStage<T>> f, Function<T, Route> inner) "Unwraps" aCompletionStageand runs the inner route after stage completion with the stage's value as an extraction of typeT.Methods inherited from class org.apache.pekko.http.javadsl.server.directives.FormFieldDirectives
formField, formField, formFieldList, formFieldList, formFieldList, formFieldMap, formFieldMultiMap, formFieldOptional, formFieldOptionalMethods inherited from class org.apache.pekko.http.javadsl.server.directives.FileUploadDirectives
fileUpload, fileUploadAll, storeUploadedFile, storeUploadedFilesMethods inherited from class org.apache.pekko.http.javadsl.server.directives.FileAndResourceDirectives
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, listDirectoryContentsMethods inherited from class org.apache.pekko.http.javadsl.server.directives.ExecutionDirectives
handleExceptions, handleRejectionsMethods inherited from class org.apache.pekko.http.javadsl.server.directives.DebuggingDirectives
logRequest, logRequest, logRequest, logRequestResult, logRequestResultOptional, logResult, logResult, logResultMethods inherited from class org.apache.pekko.http.javadsl.server.directives.CookieDirectives
cookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, optionalCookie, setCookie, setCookieMethods inherited from class org.apache.pekko.http.javadsl.server.directives.CodingDirectives
decodeRequest, decodeRequestWith, decodeRequestWith, encodeResponse, encodeResponseWith, requestEncodedWith, responseEncodingAccepted, withPrecompressedMediaTypeSupportMethods inherited from class org.apache.pekko.http.javadsl.server.directives.CacheConditionDirectives
conditional, conditional, conditional, conditionalMethods inherited from class org.apache.pekko.http.javadsl.server.directives.BasicDirectives
cancelRejection, cancelRejections, cancelRejections, extract, extractActorSystem, extractDataBytes, extractEntity, extractExecutionContext, extractLog, extractMatchedPath, extractMaterializer, extractParserSettings, extractRequest, extractRequestContext, extractRequestEntity, extractSettings, extractStrictEntity, extractStrictEntity, extractStrictEntity, extractStrictEntity, extractUnmatchedPath, extractUri, mapInnerRoute, mapRejections, mapRequest, mapRequestContext, mapResponse, mapResponseEntity, mapResponseHeaders, mapRouteResult, mapRouteResultFuture, mapRouteResultPF, mapRouteResultWith, mapRouteResultWithPF, mapSettings, mapUnmatchedPath, pass, provide, recoverRejections, recoverRejectionsWith, toStrictEntity, toStrictEntity, toStrictEntity, toStrictEntity, withExecutionContext, withLog, withMaterializer, withSettings
-
Constructor Details
-
FutureDirectives
public FutureDirectives()
-
-
Method Details
-
completeOrRecoverWith
public <T> Route completeOrRecoverWith(Supplier<CompletionStage<T>> f, Marshaller<T, RequestEntity> marshaller, Function<Throwable, Route> inner) "Unwraps" aCompletionStageand runs the inner route when the stage has failed with the stage's failure exception as an extraction of typeThrowable. 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.)- Parameters:
f- (undocumented)marshaller- (undocumented)inner- (undocumented)- Returns:
- (undocumented)
-
onComplete
public <T> RouteAdapter onComplete(Supplier<CompletionStage<T>> f, Function<scala.util.Try<T>, Route> inner) "Unwraps" aCompletionStageand runs the inner route after future completion with the future's value as an extraction of typeTry.- Parameters:
f- (undocumented)inner- (undocumented)- Returns:
- (undocumented)
-
onComplete
"Unwraps" aCompletionStageand runs the inner route after future completion with the future's value as an extraction of typeTry.- Parameters:
cs- (undocumented)inner- (undocumented)- Returns:
- (undocumented)
-
onCompleteWithBreaker
public <T> RouteAdapter onCompleteWithBreaker(org.apache.pekko.pattern.CircuitBreaker breaker, Supplier<CompletionStage<T>> f, Function<scala.util.Try<T>, Route> inner) "Unwraps" aCompletionStage[T]and runs the inner route after future completion with the future's value as an extraction of typeTif the suppliedCircuitBreakeris closed.If the supplied
CircuitBreakeris open the request is rejected with apekko.http.javadsl.server.CircuitBreakerOpenRejection.- Parameters:
breaker- (undocumented)f- (undocumented)inner- (undocumented)- Returns:
- (undocumented)
-
onSuccess
"Unwraps" aCompletionStageand runs the inner route after stage completion with the stage's value as an extraction of typeT. If the stage fails its failure Throwable is bubbled up to the nearest ExceptionHandler.- Parameters:
f- (undocumented)inner- (undocumented)- Returns:
- (undocumented)
-
onSuccess
"Unwraps" aCompletionStageand runs the inner route after stage completion with the stage's value as an extraction of typeT. If the stage fails its failure Throwable is bubbled up to the nearest ExceptionHandler.- Parameters:
cs- (undocumented)inner- (undocumented)- Returns:
- (undocumented)
-