Class CookieDirectives

    • Constructor Detail

      • CookieDirectives

        public CookieDirectives()
    • Method Detail

      • cookie

        public Route cookie​(java.lang.String name,
                            java.util.function.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,
                                  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 match
        inner - (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 match
        domain - Domain of the cookie to match, or empty string to match any domain
        inner - (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 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​(java.lang.String name,
                                    java.util.function.Function<java.util.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,
                               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)