Package akka.http.javadsl.server
Class Directives$
- java.lang.Object
-
- akka.http.javadsl.server.directives.BasicDirectives
-
- akka.http.javadsl.server.directives.CacheConditionDirectives
-
- akka.http.javadsl.server.directives.CodingDirectives
-
- akka.http.javadsl.server.directives.CookieDirectives
-
- akka.http.javadsl.server.directives.DebuggingDirectives
-
- akka.http.javadsl.server.directives.ExecutionDirectives
-
- akka.http.javadsl.server.directives.FileAndResourceDirectives
-
- akka.http.javadsl.server.directives.FileUploadDirectives
-
- akka.http.javadsl.server.directives.FormFieldDirectives
-
- akka.http.javadsl.server.directives.FutureDirectives
-
- akka.http.javadsl.server.directives.HeaderDirectives
-
- akka.http.javadsl.server.directives.AttributeDirectives
-
- akka.http.javadsl.server.directives.HostDirectives
-
- akka.http.javadsl.server.directives.MarshallingDirectives
-
- akka.http.javadsl.server.directives.MethodDirectives
-
- akka.http.javadsl.server.directives.MiscDirectives
-
- akka.http.javadsl.server.directives.ParameterDirectives
-
- akka.http.javadsl.server.directives.PathDirectives
-
- akka.http.javadsl.server.directives.RangeDirectives
-
public class Directives$ extends AllDirectives
Collects all default directives into one class for simple importing of static functions.See
Directives
for ScalaDSL equivalent of this class.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class akka.http.javadsl.server.directives.SecurityDirectives
SecurityDirectives.ProvidedCredentials, SecurityDirectives.ProvidedCredentials$
-
-
Field Summary
Fields Modifier and Type Field Description static Directives$
MODULE$
Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description Directives$()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <A,B>
RouteallOf(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(java.lang.String... directories)
Route
getFromBrowseableDirectories(scala.collection.immutable.Seq<java.lang.String> directories)
Route
route(Route... alternatives)
Route
route(scala.collection.immutable.Seq<Route> alternatives)
Deprecated.-
Methods inherited from class akka.http.javadsl.server.directives.TlsDirectives
extractClientCertificate, extractSslSession, requireClientCertificateIdentity
-
Methods inherited from class akka.http.javadsl.server.directives.CorsDirectives
cors, cors
-
Methods inherited from class akka.http.javadsl.server.directives.FramedEntityStreamingDirectives
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, withSizeLimit
-
Methods inherited from class akka.http.javadsl.server.directives.TimeoutDirectives
extractRequestTimeout, withoutRequestTimeout, withRequestTimeout, withRequestTimeout, withRequestTimeoutResponse
-
Methods inherited from class akka.http.javadsl.server.directives.WebSocketDirectives
extractOfferedWsProtocols, extractUpgradeToWebSocket, extractWebSocketUpgrade, handleWebSocketMessages, handleWebSocketMessagesForOptionalProtocol, handleWebSocketMessagesForProtocol
-
Methods inherited from class akka.http.javadsl.server.directives.SecurityDirectives
authenticateBasic, authenticateBasicAsync, authenticateBasicAsyncOptional, authenticateBasicOptional, authenticateBasicPF, authenticateBasicPFAsync, authenticateOAuth2, authenticateOAuth2Async, authenticateOAuth2AsyncOptional, authenticateOAuth2Optional, authenticateOrRejectWithChallenge, authenticateOrRejectWithChallenge, authorize, authorizeAsync, authorizeAsyncWithRequestContext, authorizeWithRequestContext, extractCredentials
-
Methods inherited from class akka.http.javadsl.server.directives.SchemeDirectives
extractScheme, scheme
-
Methods inherited from class akka.http.javadsl.server.directives.RouteDirectives
complete, 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, route
-
Methods inherited from class akka.http.javadsl.server.directives.RespondWithDirectives
respondWithDefaultHeader, respondWithDefaultHeaders, respondWithHeader, respondWithHeaders
-
Methods inherited from class akka.http.javadsl.server.directives.RangeDirectives
withRangeSupport
-
Methods inherited from class akka.http.javadsl.server.directives.PathDirectives
ignoreTrailingSlash, 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, redirectToTrailingSlashIfMissing
-
Methods inherited from class akka.http.javadsl.server.directives.ParameterDirectives
parameter, parameter, parameterList, parameterList, parameterList, parameterMap, parameterMultiMap, parameterOptional, parameterOptional, parameterOrDefault, parameterRequiredValue
-
Methods inherited from class akka.http.javadsl.server.directives.MiscDirectives
extractClientIP, rejectEmptyResponse, requestEntityEmpty, requestEntityPresent, selectPreferredLanguage, validate, withoutSizeLimit, withSizeLimit
-
Methods inherited from class akka.http.javadsl.server.directives.MethodDirectives
delete, extractMethod, get, head, method, options, overrideMethodWithParameter, patch, post, put
-
Methods inherited from class akka.http.javadsl.server.directives.MarshallingDirectives
completeWith, entity, handleWith, request
-
Methods inherited from class akka.http.javadsl.server.directives.HostDirectives
extractHost, host, host, host, host
-
Methods inherited from class akka.http.javadsl.server.directives.AttributeDirectives
attribute, optionalAttribute
-
Methods inherited from class akka.http.javadsl.server.directives.HeaderDirectives
checkSameOrigin, headerValue, headerValueByName, headerValueByType, headerValuePF, optionalHeaderValue, optionalHeaderValueByName, optionalHeaderValueByType, optionalHeaderValuePF
-
Methods inherited from class akka.http.javadsl.server.directives.FutureDirectives
completeOrRecoverWith, onComplete, onComplete, onCompleteWithBreaker, onSuccess, onSuccess
-
Methods inherited from class akka.http.javadsl.server.directives.FormFieldDirectives
formField, formField, formFieldList, formFieldList, formFieldList, formFieldMap, formFieldMultiMap, formFieldOptional, formFieldOptional
-
Methods inherited from class akka.http.javadsl.server.directives.FileUploadDirectives
fileUpload, fileUploadAll, storeUploadedFile, storeUploadedFiles
-
Methods inherited from class akka.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, listDirectoryContents
-
Methods inherited from class akka.http.javadsl.server.directives.ExecutionDirectives
handleExceptions, handleRejections
-
Methods inherited from class akka.http.javadsl.server.directives.DebuggingDirectives
logRequest, logRequest, logRequest, logRequestResult, logRequestResultOptional, logResult, logResult, logResult
-
Methods inherited from class akka.http.javadsl.server.directives.CookieDirectives
cookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, optionalCookie, setCookie, setCookie
-
Methods inherited from class akka.http.javadsl.server.directives.CodingDirectives
decodeRequest, decodeRequestWith, decodeRequestWith, encodeResponse, encodeResponseWith, requestEncodedWith, responseEncodingAccepted, withPrecompressedMediaTypeSupport
-
Methods inherited from class akka.http.javadsl.server.directives.CacheConditionDirectives
conditional, conditional, conditional, conditional
-
Methods inherited from class akka.http.javadsl.server.directives.BasicDirectives
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
-
-
-
-
Field Detail
-
MODULE$
public static final Directives$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
route
public Route route(Route... alternatives)
- Overrides:
route
in classFramedEntityStreamingDirectives
-
getFromBrowseableDirectories
public Route getFromBrowseableDirectories(java.lang.String... directories)
- Overrides:
getFromBrowseableDirectories
in classFramedEntityStreamingDirectives
-
route
public Route route(scala.collection.immutable.Seq<Route> alternatives)
Deprecated.- Overrides:
route
in classFramedEntityStreamingDirectives
-
getFromBrowseableDirectories
public Route getFromBrowseableDirectories(scala.collection.immutable.Seq<java.lang.String> directories)
- Overrides:
getFromBrowseableDirectories
in classFramedEntityStreamingDirectives
-
anyOf
public 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. This is equivalent tofirst(inner).orElse(second(inner))
Usage example:anyOf(this::get, this::post, () -> complete("hi")))
- Parameters:
first
- the first 0-argument directivesecond
- the second 0-argument directiveinner
- the inner route Producer- Returns:
- the resulting route
-
anyOf
public <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. This is the same asfirst(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"))
- Parameters:
first
- the first 1-argument directivesecond
- the second 1-argument directiveinner
- the inner route that takes one argument- Returns:
- the resulting route
-
allOf
public 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!"))
- Parameters:
first
- the 0-argument directive (outer one)second
- the 0-argument directive (inner one)inner
- the inner route function- Returns:
- the resulting route
-
allOf
public <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))
- Parameters:
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 parameters- Returns:
- the resulting route
-
allOf
public <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()))
- Parameters:
first
- the 0-argument directive (outer one)second
- the 1-argument directive (inner one)inner
- the inner route function that takes 1 parameter- Returns:
- the resulting route
-
-