public class Directives$ extends AllDirectives
See pekko.http.scaladsl.server.Directives for ScalaDSL equivalent of this class.
SecurityDirectives.ProvidedCredentials, SecurityDirectives.ProvidedCredentials$| Modifier and Type | Field and Description |
|---|---|
static Directives$ |
MODULE$
Static reference to the singleton instance of this Scala object.
|
| Constructor and Description |
|---|
Directives$() |
| Modifier and Type | Method and Description |
|---|---|
<A,B> Route |
allOf(java.util.function.Function<java.util.function.Function<A,Route>,Route> first,
java.util.function.Function<java.util.function.Function<B,Route>,Route> second,
java.util.function.BiFunction<A,B,Route> inner)
Nests two 1-argument directives together
Usage example:
allOf(this::extractScheme, this::extractMethod, (scheme, method) -> complete("You did a " + method.name() + " using " + scheme)) |
<A> Route |
allOf(java.util.function.Function<java.util.function.Supplier<Route>,Route> first,
java.util.function.Function<java.util.function.Function<A,Route>,Route> second,
java.util.function.Function<A,Route> inner)
Nests one 0-argument and 1-argument directives together
Usage example:
allOf(bindParameter(this::pathPrefix, "guess"), this::extractMethod, method -> complete("You did a " + method.name())) |
Route |
allOf(java.util.function.Function<java.util.function.Supplier<Route>,Route> first,
java.util.function.Function<java.util.function.Supplier<Route>,Route> second,
java.util.function.Supplier<Route> inner)
Nests two 0-argument directives together
Usage example:
allOf(bindParameter(this::pathPrefix, "alice"), bindParameter(this::path, "bob"), () -> complete("Charlie!")) |
<A> Route |
anyOf(java.util.function.Function<java.util.function.Function<A,Route>,Route> first,
java.util.function.Function<java.util.function.Function<A,Route>,Route> second,
java.util.function.Function<A,Route> inner)
Composes two 1-argument directives (directives whose inner route takes a parameter) which share the same inner route.
|
Route |
anyOf(java.util.function.Function<java.util.function.Supplier<Route>,Route> first,
java.util.function.Function<java.util.function.Supplier<Route>,Route> second,
java.util.function.Supplier<Route> inner)
Composes two 0-argument directives which share the same inner Route.
|
Route |
getFromBrowseableDirectories(scala.collection.immutable.Seq<java.lang.String> directories) |
Route |
getFromBrowseableDirectories(java.lang.String... directories) |
Route |
route(Route... alternatives) |
Route |
route(scala.collection.immutable.Seq<Route> alternatives)
Deprecated.
|
attribute, authenticateBasic, authenticateBasicAsync, authenticateBasicAsyncOptional, authenticateBasicOptional, authenticateBasicPF, authenticateBasicPFAsync, authenticateOAuth2, authenticateOAuth2Async, authenticateOAuth2AsyncOptional, authenticateOAuth2Optional, authenticateOrRejectWithChallenge, authenticateOrRejectWithChallenge, authorize, authorizeAsync, authorizeAsyncWithRequestContext, authorizeWithRequestContext, cancelRejection, cancelRejections, cancelRejections, checkSameOrigin, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, complete, completeOK, completeOKWithFuture, completeOKWithFuture, completeOKWithFuture, completeOKWithFutureString, completeOKWithFutureString, completeOKWithSource, completeOrRecoverWith, completeWith, completeWithFuture, completeWithFuture, completeWithFuture, completeWithFutureResponse, completeWithFutureStatus, completeWithFutureStatus, completeWithSource, concat, concat, conditional, conditional, conditional, conditional, cookie, decodeRequest, decodeRequestWith, decodeRequestWith, defaultContentTypeResolver, defaultDirectoryRenderer, delete, deleteCookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, encodeResponse, encodeResponseWith, entity, entityAsSourceOf, extract, extractActorSystem, extractClientIP, extractCredentials, extractDataBytes, extractEntity, extractExecutionContext, extractHost, extractLog, extractMatchedPath, extractMaterializer, extractMethod, extractOfferedWsProtocols, extractParserSettings, extractRequest, extractRequestContext, extractRequestEntity, extractRequestTimeout, extractScheme, extractSettings, extractStrictEntity, extractStrictEntity, extractUnmatchedPath, extractUpgradeToWebSocket, extractUri, extractWebSocketUpgrade, failWith, fileUpload, fileUploadAll, formField, formField, formFieldList, formFieldList, formFieldList, formFieldMap, formFieldMultiMap, formFieldOptional, formFieldOptional, get, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromDirectory, getFromDirectory, getFromFile, getFromFile, getFromFile, getFromFile, getFromFile, getFromResource, getFromResource, getFromResource, getFromResource, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, handle, handleExceptions, handleRejections, handleSync, handleWebSocketMessages, handleWebSocketMessagesForOptionalProtocol, handleWebSocketMessagesForProtocol, handleWith, head, headerValue, headerValueByName, headerValueByType, headerValuePF, host, host, host, host, ignoreTrailingSlash, listDirectoryContents, listDirectoryContents, listDirectoryContents, listDirectoryContents, logRequest, logRequest, logRequest, logRequestResult, logRequestResultOptional, logResult, logResult, logResult, mapInnerRoute, mapRejections, mapRequest, mapRequestContext, mapResponse, mapResponseEntity, mapResponseHeaders, mapRouteResult, mapRouteResultFuture, mapRouteResultPF, mapRouteResultWith, mapRouteResultWithPF, mapSettings, mapUnmatchedPath, method, onComplete, onComplete, onCompleteWithBreaker, onSuccess, onSuccess, optionalAttribute, optionalCookie, optionalHeaderValue, optionalHeaderValueByName, optionalHeaderValueByType, optionalHeaderValuePF, options, overrideMethodWithParameter, parameter, parameter, parameterList, parameterList, parameterList, parameterMap, parameterMultiMap, parameterOptional, parameterOptional, parameterOrDefault, parameterRequiredValue, pass, patch, 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, post, provide, put, rawPathPrefix, rawPathPrefix, rawPathPrefix, rawPathPrefix, rawPathPrefixTest, rawPathPrefixTest, rawPathPrefixTest, rawPathPrefixTest, recoverRejections, recoverRejectionsWith, redirect, redirectToNoTrailingSlashIfPresent, redirectToTrailingSlashIfMissing, reject, reject, reject, rejectEmptyResponse, request, requestEncodedWith, requestEntityEmpty, requestEntityPresent, respondWithDefaultHeader, respondWithDefaultHeaders, respondWithHeader, respondWithHeaders, responseEncodingAccepted, scheme, selectPreferredLanguage, setCookie, setCookie, storeUploadedFile, storeUploadedFiles, toStrictEntity, toStrictEntity, validate, withExecutionContext, withLog, withMaterializer, withoutRequestTimeout, withoutSizeLimit, withPrecompressedMediaTypeSupport, withRangeSupport, withRequestTimeout, withRequestTimeout, withRequestTimeoutResponse, withSettings, withSizeLimitextractRequestTimeout, withoutRequestTimeout, withRequestTimeout, withRequestTimeout, withRequestTimeoutResponseextractOfferedWsProtocols, extractUpgradeToWebSocket, extractWebSocketUpgrade, handleWebSocketMessages, handleWebSocketMessagesForOptionalProtocol, handleWebSocketMessagesForProtocolauthenticateBasic, authenticateBasicAsync, authenticateBasicAsyncOptional, authenticateBasicOptional, authenticateBasicPF, authenticateBasicPFAsync, authenticateOAuth2, authenticateOAuth2Async, authenticateOAuth2AsyncOptional, authenticateOAuth2Optional, authenticateOrRejectWithChallenge, authenticateOrRejectWithChallenge, authorize, authorizeAsync, authorizeAsyncWithRequestContext, authorizeWithRequestContext, extractCredentialsextractScheme, schemecomplete, 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, rejectrespondWithDefaultHeader, respondWithDefaultHeaders, respondWithHeader, respondWithHeaderswithRangeSupportignoreTrailingSlash, 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, redirectToTrailingSlashIfMissingparameter, parameter, parameterList, parameterList, parameterList, parameterMap, parameterMultiMap, parameterOptional, parameterOptional, parameterOrDefault, parameterRequiredValueextractClientIP, rejectEmptyResponse, requestEntityEmpty, requestEntityPresent, selectPreferredLanguage, validate, withoutSizeLimit, withSizeLimitdelete, extractMethod, get, head, method, options, overrideMethodWithParameter, patch, post, putcompleteWith, entity, handleWith, requestextractHost, host, host, host, hostattribute, optionalAttributecheckSameOrigin, headerValue, headerValueByName, headerValueByType, headerValuePF, optionalHeaderValue, optionalHeaderValueByName, optionalHeaderValueByType, optionalHeaderValuePFcompleteOrRecoverWith, onComplete, onComplete, onCompleteWithBreaker, onSuccess, onSuccessformField, formField, formFieldList, formFieldList, formFieldList, formFieldMap, formFieldMultiMap, formFieldOptional, formFieldOptionalfileUpload, fileUploadAll, storeUploadedFile, storeUploadedFilesdefaultContentTypeResolver, defaultDirectoryRenderer, 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, listDirectoryContentshandleExceptions, handleRejectionslogRequest, logRequest, logRequest, logRequestResult, logRequestResultOptional, logResult, logResult, logResultcookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, optionalCookie, setCookie, setCookiedecodeRequest, decodeRequestWith, decodeRequestWith, encodeResponse, encodeResponseWith, requestEncodedWith, responseEncodingAccepted, withPrecompressedMediaTypeSupportconditional, conditional, conditional, conditionalcancelRejection, 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, withSettingspublic static final Directives$ MODULE$
public Route route(Route... alternatives)
route in class FramedEntityStreamingDirectivespublic Route getFromBrowseableDirectories(java.lang.String... directories)
getFromBrowseableDirectories in class FramedEntityStreamingDirectivespublic Route route(scala.collection.immutable.Seq<Route> alternatives)
route in class FramedEntityStreamingDirectivespublic Route getFromBrowseableDirectories(scala.collection.immutable.Seq<java.lang.String> directories)
getFromBrowseableDirectories in class FramedEntityStreamingDirectivespublic Route anyOf(java.util.function.Function<java.util.function.Supplier<Route>,Route> first, java.util.function.Function<java.util.function.Supplier<Route>,Route> second, java.util.function.Supplier<Route> inner)
first(inner).orElse(second(inner))
Usage example:
anyOf(this::get, this::post, () -> complete("hi")))first - the first 0-argument directivesecond - the second 0-argument directiveinner - the inner route Producerpublic <A> Route anyOf(java.util.function.Function<java.util.function.Function<A,Route>,Route> first, java.util.function.Function<java.util.function.Function<A,Route>,Route> second, java.util.function.Function<A,Route> inner)
first(inner).orElse(second(inner)).
This can be used also for directives that take an additional parameter if the directive is partially applied, ie. parameter
Usage example:
anyOf(bindParameter(this::path, "bar"), bindParameter(this::path, "baz"), () -> complete("bar or baz"))first - the first 1-argument directivesecond - the second 1-argument directiveinner - the inner route that takes one argumentpublic Route allOf(java.util.function.Function<java.util.function.Supplier<Route>,Route> first, java.util.function.Function<java.util.function.Supplier<Route>,Route> second, java.util.function.Supplier<Route> inner)
allOf(bindParameter(this::pathPrefix, "alice"), bindParameter(this::path, "bob"), () -> complete("Charlie!"))first - the 0-argument directive (outer one)second - the 0-argument directive (inner one)inner - the inner route functionpublic <A,B> Route allOf(java.util.function.Function<java.util.function.Function<A,Route>,Route> first, java.util.function.Function<java.util.function.Function<B,Route>,Route> second, java.util.function.BiFunction<A,B,Route> inner)
allOf(this::extractScheme, this::extractMethod, (scheme, method) -> complete("You did a " + method.name() + " using " + scheme))first - the first 1-argument directive (outer one)second - the second 1-argument directive (inner one)inner - the inner route function that takes 2 different parameterspublic <A> Route allOf(java.util.function.Function<java.util.function.Supplier<Route>,Route> first, java.util.function.Function<java.util.function.Function<A,Route>,Route> second, java.util.function.Function<A,Route> inner)
allOf(bindParameter(this::pathPrefix, "guess"), this::extractMethod, method -> complete("You did a " + method.name()))first - the 0-argument directive (outer one)second - the 1-argument directive (inner one)inner - the inner route function that takes 1 parameter