Class HostDirectives
- 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
-
- Direct Known Subclasses:
MarshallingDirectives
public abstract class HostDirectives extends AttributeDirectives
-
-
Constructor Summary
Constructors Constructor Description HostDirectives()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Route
extractHost(java.util.function.Function<java.lang.String,Route> inner)
Extracts the hostname part of the Host request header value.Route
host(java.lang.Iterable<java.lang.String> hostNames, java.util.function.Supplier<Route> inner)
Rejects all requests with a host name different from the given ones.Route
host(java.lang.String hostName, java.util.function.Supplier<Route> inner)
Rejects all requests with a host name different from the given one.Route
host(java.util.function.Predicate<java.lang.String> predicate, java.util.function.Supplier<Route> inner)
Rejects all requests for whose host name the given predicate function returns false.Route
host(java.util.regex.Pattern regex, java.util.function.Function<java.lang.String,Route> inner)
Rejects all requests with a host name that doesn't have a prefix matching the given regular expression.-
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
-
-
-
-
Method Detail
-
extractHost
public Route extractHost(java.util.function.Function<java.lang.String,Route> inner)
Extracts the hostname part of the Host request header value.- Parameters:
inner
- (undocumented)- Returns:
- (undocumented)
-
host
public Route host(java.lang.Iterable<java.lang.String> hostNames, java.util.function.Supplier<Route> inner)
Rejects all requests with a host name different from the given ones.- Parameters:
hostNames
- (undocumented)inner
- (undocumented)- Returns:
- (undocumented)
-
host
public Route host(java.lang.String hostName, java.util.function.Supplier<Route> inner)
Rejects all requests with a host name different from the given one.- Parameters:
hostName
- (undocumented)inner
- (undocumented)- Returns:
- (undocumented)
-
host
public Route host(java.util.function.Predicate<java.lang.String> predicate, java.util.function.Supplier<Route> inner)
Rejects all requests for whose host name the given predicate function returns false.- Parameters:
predicate
- (undocumented)inner
- (undocumented)- Returns:
- (undocumented)
-
host
public Route host(java.util.regex.Pattern regex, java.util.function.Function<java.lang.String,Route> inner)
Rejects all requests with a host name that doesn't have a prefix matching the given regular expression. For all matching requests the prefix string matching the regex is extracted and passed to the inner route. If the regex contains a capturing group only the string matched by this group is extracted. If the regex contains more than one capturing group an IllegalArgumentException is thrown.- Parameters:
regex
- (undocumented)inner
- (undocumented)- Returns:
- (undocumented)
-
-