Class CookieDirectives
- 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
-
- Direct Known Subclasses:
DebuggingDirectives
public abstract class CookieDirectives extends CodingDirectives
-
-
Constructor Summary
Constructors Constructor Description CookieDirectives()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Routecookie(java.lang.String name, java.util.function.Function<HttpCookiePair,Route> inner)Extracts theHttpCookiePairwith the given name.RoutedeleteCookie(HttpCookie cookie, java.util.function.Supplier<Route> inner)Adds a {@link Set-Cookie} response header expiring the given cookie.RoutedeleteCookie(java.lang.Iterable<HttpCookie> cookies, java.util.function.Supplier<Route> inner)Adds a {@link Set-Cookie} response header expiring the given cookies.RoutedeleteCookie(java.lang.String name, java.lang.String domain, java.lang.String path, java.util.function.Supplier<Route> inner)Adds a {@link Set-Cookie} response header expiring the cookie with the given properties.RoutedeleteCookie(java.lang.String name, java.lang.String domain, java.util.function.Supplier<Route> inner)Adds a {@link Set-Cookie} response header expiring the cookie with the given properties.RoutedeleteCookie(java.lang.String name, java.util.function.Supplier<Route> inner)Adds a {@link Set-Cookie} response header expiring the cookie with the given properties.RouteoptionalCookie(java.lang.String name, java.util.function.Function<java.util.Optional<HttpCookiePair>,Route> inner)Extracts theHttpCookiePairwith the given name as anOption[HttpCookiePair].RoutesetCookie(HttpCookie cookie, java.util.function.Supplier<Route> inner)Adds a {@link Set-Cookie} response header with the given cookie.RoutesetCookie(java.lang.Iterable<HttpCookie> cookies, java.util.function.Supplier<Route> inner)Adds a {@link Set-Cookie} response header with the given cookies.-
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
-
cookie
public Route cookie(java.lang.String name, java.util.function.Function<HttpCookiePair,Route> inner)
Extracts theHttpCookiePairwith the given name. If the cookie is not present the request is rejected with a respectiveMissingCookieRejection.- Parameters:
name- (undocumented)inner- (undocumented)- Returns:
- (undocumented)
-
deleteCookie
public Route deleteCookie(HttpCookie cookie, java.util.function.Supplier<Route> inner)
Adds a {@link Set-Cookie} response header expiring the given cookie.- Parameters:
cookie- (undocumented)inner- (undocumented)- Returns:
- (undocumented)
-
deleteCookie
public Route deleteCookie(java.lang.Iterable<HttpCookie> cookies, java.util.function.Supplier<Route> inner)
Adds a {@link Set-Cookie} response header expiring the given cookies.- Parameters:
cookies- (undocumented)inner- (undocumented)- Returns:
- (undocumented)
-
deleteCookie
public Route deleteCookie(java.lang.String name, java.util.function.Supplier<Route> inner)
Adds a {@link Set-Cookie} response header expiring the cookie with the given properties.- Parameters:
name- Name of the cookie to matchinner- (undocumented)- Returns:
- (undocumented)
-
deleteCookie
public Route deleteCookie(java.lang.String name, java.lang.String domain, java.util.function.Supplier<Route> inner)
Adds a {@link Set-Cookie} response header expiring the cookie with the given properties.- Parameters:
name- Name of the cookie to matchdomain- Domain of the cookie to match, or empty string to match any domaininner- (undocumented)- Returns:
- (undocumented)
-
deleteCookie
public Route deleteCookie(java.lang.String name, java.lang.String domain, java.lang.String path, java.util.function.Supplier<Route> inner)
Adds a {@link Set-Cookie} response header expiring the cookie with the given properties.- Parameters:
name- Name of the cookie to matchdomain- Domain of the cookie to match, or empty string to match any domainpath- Path of the cookie to match, or empty string to match any pathinner- (undocumented)- Returns:
- (undocumented)
-
optionalCookie
public Route optionalCookie(java.lang.String name, java.util.function.Function<java.util.Optional<HttpCookiePair>,Route> inner)
Extracts theHttpCookiePairwith the given name as anOption[HttpCookiePair]. If the cookie is not present a value ofNoneis extracted.- Parameters:
name- (undocumented)inner- (undocumented)- Returns:
- (undocumented)
-
setCookie
public Route setCookie(HttpCookie cookie, java.util.function.Supplier<Route> inner)
Adds a {@link Set-Cookie} response header with the given cookie.- Parameters:
cookie- (undocumented)inner- (undocumented)- Returns:
- (undocumented)
-
setCookie
public Route setCookie(java.lang.Iterable<HttpCookie> cookies, java.util.function.Supplier<Route> inner)
Adds a {@link Set-Cookie} response header with the given cookies.- Parameters:
cookies- (undocumented)inner- (undocumented)- Returns:
- (undocumented)
-
-