Class CookieDirectives

Direct Known Subclasses:
DebuggingDirectives

public abstract class CookieDirectives extends CodingDirectives
  • Constructor Details

    • CookieDirectives

      public CookieDirectives()
  • Method Details

    • cookie

      public Route cookie(String name, Function<HttpCookiePair,Route> inner)
      Extracts the HttpCookiePair with the given name. If the cookie is not present the request is rejected with a respective MissingCookieRejection.
      Parameters:
      name - (undocumented)
      inner - (undocumented)
      Returns:
      (undocumented)
    • deleteCookie

      public Route deleteCookie(HttpCookie cookie, 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(Iterable<HttpCookie> cookies, 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(String name, Supplier<Route> inner)
      Adds a {@link Set-Cookie} response header expiring the cookie with the given properties.

      Parameters:
      name - Name of the cookie to match
      inner - (undocumented)
      Returns:
      (undocumented)
    • deleteCookie

      public Route deleteCookie(String name, String domain, Supplier<Route> inner)
      Adds a {@link Set-Cookie} response header expiring the cookie with the given properties.

      Parameters:
      name - Name of the cookie to match
      domain - Domain of the cookie to match, or empty string to match any domain
      inner - (undocumented)
      Returns:
      (undocumented)
    • deleteCookie

      public Route deleteCookie(String name, String domain, String path, Supplier<Route> inner)
      Adds a {@link Set-Cookie} response header expiring the cookie with the given properties.

      Parameters:
      name - Name of the cookie to match
      domain - Domain of the cookie to match, or empty string to match any domain
      path - Path of the cookie to match, or empty string to match any path
      inner - (undocumented)
      Returns:
      (undocumented)
    • optionalCookie

      public Route optionalCookie(String name, Function<Optional<HttpCookiePair>,Route> inner)
      Extracts the HttpCookiePair with the given name as an Option[HttpCookiePair]. If the cookie is not present a value of None is extracted.
      Parameters:
      name - (undocumented)
      inner - (undocumented)
      Returns:
      (undocumented)
    • setCookie

      public Route setCookie(HttpCookie cookie, 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(Iterable<HttpCookie> cookies, Supplier<Route> inner)
      Adds a {@link Set-Cookie} response header with the given cookies.
      Parameters:
      cookies - (undocumented)
      inner - (undocumented)
      Returns:
      (undocumented)