Class TimeoutDirectives
- Direct Known Subclasses:
- FramedEntityStreamingDirectives
- 
Nested Class SummaryNested classes/interfaces inherited from class org.apache.pekko.http.javadsl.server.directives.SecurityDirectivesSecurityDirectives.ProvidedCredentials, SecurityDirectives.ProvidedCredentials$
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionextractRequestTimeout(Function<Duration, Route> inner) Java APIwithoutRequestTimeout(Supplier<Route> inner) withRequestTimeout(Duration timeout, Function<HttpRequest, HttpResponse> timeoutHandler, Supplier<Route> inner) Tries to set a new request timeout and handler (if provided) at the same time.withRequestTimeout(Duration timeout, Supplier<Route> inner) Tries to set a new request timeout and handler (if provided) at the same time.withRequestTimeout(scala.concurrent.duration.Duration timeout, Function<HttpRequest, HttpResponse> timeoutHandler, Supplier<Route> inner) Deprecated.withRequestTimeout(scala.concurrent.duration.Duration timeout, Supplier<Route> inner) Deprecated.As of 1.3.0, use the overloaded method taking ajava.time.Durationinstead.withRequestTimeoutResponse(Function<HttpRequest, HttpResponse> timeoutHandler, Supplier<Route> inner) Tries to set a new request timeout handler, which produces the timeout response for a given request.Methods inherited from class org.apache.pekko.http.javadsl.server.directives.WebSocketDirectivesextractOfferedWsProtocols, extractWebSocketUpgrade, handleWebSocketMessages, handleWebSocketMessagesForOptionalProtocol, handleWebSocketMessagesForProtocolMethods inherited from class org.apache.pekko.http.javadsl.server.directives.SecurityDirectivesauthenticateBasic, authenticateBasicAsync, authenticateBasicAsyncOptional, authenticateBasicOptional, authenticateBasicPF, authenticateBasicPFAsync, authenticateOAuth2, authenticateOAuth2Async, authenticateOAuth2AsyncOptional, authenticateOAuth2Optional, authenticateOrRejectWithChallenge, authenticateOrRejectWithChallenge, authorize, authorizeAsync, authorizeAsyncWithRequestContext, authorizeWithRequestContext, extractCredentialsMethods inherited from class org.apache.pekko.http.javadsl.server.directives.SchemeDirectivesextractScheme, schemeMethods inherited from class org.apache.pekko.http.javadsl.server.directives.RouteDirectivescomplete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, completeOK, completeOKWithFuture, completeOKWithFuture, completeOKWithFuture, completeOKWithFutureString, completeOKWithFutureString, completeWithFuture, completeWithFuture, completeWithFuture, completeWithFutureResponse, completeWithFutureStatus, completeWithFutureStatus, concat, concat, failWith, handle, handleSync, redirect, reject, reject, reject, route, routeMethods inherited from class org.apache.pekko.http.javadsl.server.directives.RespondWithDirectivesrespondWithDefaultHeader, respondWithDefaultHeaders, respondWithHeader, respondWithHeadersMethods inherited from class org.apache.pekko.http.javadsl.server.directives.RangeDirectiveswithRangeSupportMethods inherited from class org.apache.pekko.http.javadsl.server.directives.PathDirectivesignoreTrailingSlash, path, path, path, path, path, path, pathEnd, pathEndOrSingleSlash, pathPrefix, pathPrefix, pathPrefix, pathPrefix, pathPrefix, pathPrefix, pathPrefixTest, pathPrefixTest, pathPrefixTest, pathPrefixTest, pathSingleSlash, pathSuffix, pathSuffix, pathSuffix, pathSuffix, pathSuffixTest, pathSuffixTest, pathSuffixTest, pathSuffixTest, rawPathPrefix, rawPathPrefix, rawPathPrefix, rawPathPrefix, rawPathPrefixTest, rawPathPrefixTest, rawPathPrefixTest, rawPathPrefixTest, redirectToNoTrailingSlashIfPresent, redirectToTrailingSlashIfMissingMethods inherited from class org.apache.pekko.http.javadsl.server.directives.ParameterDirectivesparameter, parameter, parameterList, parameterList, parameterList, parameterMap, parameterMultiMap, parameterOptional, parameterOptional, parameterOrDefault, parameterRequiredValueMethods inherited from class org.apache.pekko.http.javadsl.server.directives.MiscDirectivesextractClientIP, rejectEmptyResponse, requestEntityEmpty, requestEntityPresent, selectPreferredLanguage, validate, withoutSizeLimit, withSizeLimitMethods inherited from class org.apache.pekko.http.javadsl.server.directives.MethodDirectivesdelete, extractMethod, get, head, method, options, overrideMethodWithParameter, patch, post, putMethods inherited from class org.apache.pekko.http.javadsl.server.directives.MarshallingDirectivescompleteWith, entity, handleWith, requestMethods inherited from class org.apache.pekko.http.javadsl.server.directives.HostDirectivesextractHost, host, host, host, hostMethods inherited from class org.apache.pekko.http.javadsl.server.directives.AttributeDirectivesattribute, optionalAttributeMethods inherited from class org.apache.pekko.http.javadsl.server.directives.HeaderDirectivescheckSameOrigin, headerValue, headerValueByName, headerValueByType, headerValuePF, optionalHeaderValue, optionalHeaderValueByName, optionalHeaderValueByType, optionalHeaderValuePFMethods inherited from class org.apache.pekko.http.javadsl.server.directives.FutureDirectivescompleteOrRecoverWith, onComplete, onComplete, onCompleteWithBreaker, onSuccess, onSuccessMethods inherited from class org.apache.pekko.http.javadsl.server.directives.FormFieldDirectivesformField, formField, formFieldList, formFieldList, formFieldList, formFieldMap, formFieldMultiMap, formFieldOptional, formFieldOptionalMethods inherited from class org.apache.pekko.http.javadsl.server.directives.FileUploadDirectivesfileUpload, fileUploadAll, storeUploadedFile, storeUploadedFilesMethods inherited from class org.apache.pekko.http.javadsl.server.directives.FileAndResourceDirectivesdefaultContentTypeResolver, 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.ExecutionDirectiveshandleExceptions, handleRejectionsMethods inherited from class org.apache.pekko.http.javadsl.server.directives.DebuggingDirectiveslogRequest, logRequest, logRequest, logRequestResult, logRequestResultOptional, logResult, logResult, logResultMethods inherited from class org.apache.pekko.http.javadsl.server.directives.CookieDirectivescookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, optionalCookie, setCookie, setCookieMethods inherited from class org.apache.pekko.http.javadsl.server.directives.CodingDirectivesdecodeRequest, decodeRequestWith, decodeRequestWith, encodeResponse, encodeResponseWith, requestEncodedWith, responseEncodingAccepted, withPrecompressedMediaTypeSupportMethods inherited from class org.apache.pekko.http.javadsl.server.directives.CacheConditionDirectivesconditional, conditional, conditional, conditionalMethods inherited from class org.apache.pekko.http.javadsl.server.directives.BasicDirectivescancelRejection, 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- 
TimeoutDirectivespublic TimeoutDirectives()
 
- 
- 
Method Details- 
extractRequestTimeoutJava APIIn 2.0.0, the input function changed from expecting scala.concurrent.duration.Durationas input tojava.time.Duration.- Parameters:
- inner- (undocumented)
- Returns:
- (undocumented)
 
- 
withRequestTimeoutpublic RouteAdapter withRequestTimeout(scala.concurrent.duration.Duration timeout, Supplier<Route> inner) Deprecated.As of 1.3.0, use the overloaded method taking ajava.time.Durationinstead.Tries to set a new request timeout and handler (if provided) at the same time.Due to the inherent raciness it is not guaranteed that the update will be applied before the previously set timeout has expired! - Parameters:
- timeout- (undocumented)
- inner- (undocumented)
- Returns:
- (undocumented)
 
- 
withRequestTimeoutTries to set a new request timeout and handler (if provided) at the same time.Due to the inherent raciness it is not guaranteed that the update will be applied before the previously set timeout has expired! - Parameters:
- timeout- (undocumented)
- inner- (undocumented)
- Returns:
- (undocumented)
- Since:
- 1.3.0
 
- 
withRequestTimeoutpublic RouteAdapter withRequestTimeout(scala.concurrent.duration.Duration timeout, Function<HttpRequest, HttpResponse> timeoutHandler, Supplier<Route> inner) Deprecated.As of 1.3.0, use the overloaded method taking ajava.time.Durationinstead.Tries to set a new request timeout and handler (if provided) at the same time.Due to the inherent raciness it is not guaranteed that the update will be applied before the previously set timeout has expired! - Parameters:
- timeout- (undocumented)
- timeoutHandler- (undocumented)
- inner- (undocumented)
- Returns:
- (undocumented)
 
- 
withRequestTimeoutpublic RouteAdapter withRequestTimeout(Duration timeout, Function<HttpRequest, HttpResponse> timeoutHandler, Supplier<Route> inner) Tries to set a new request timeout and handler (if provided) at the same time.Due to the inherent raciness it is not guaranteed that the update will be applied before the previously set timeout has expired! - Parameters:
- timeout- (undocumented)
- timeoutHandler- (undocumented)
- inner- (undocumented)
- Returns:
- (undocumented)
- Since:
- 1.3.0
 
- 
withRequestTimeoutResponsepublic RouteAdapter withRequestTimeoutResponse(Function<HttpRequest, HttpResponse> timeoutHandler, Supplier<Route> inner) Tries to set a new request timeout handler, which produces the timeout response for a given request. Note that the handler must produce the response synchronously and shouldn't block!Due to the inherent raciness it is not guaranteed that the update will be applied before the previously set timeout has expired! - Parameters:
- timeoutHandler- (undocumented)
- inner- (undocumented)
- Returns:
- (undocumented)
 
- 
withoutRequestTimeout
 
- 
java.time.Durationinstead.