public class StandardApplicationCookieService extends Object implements ApplicationCookieService
| Modifier and Type | Field and Description |
|---|---|
private static String |
DEFAULT_PATH |
private static boolean |
HTTP_ONLY_ENABLED |
private static org.slf4j.Logger |
logger |
private static Duration |
MAX_AGE_REMOVE |
private static Duration |
MAX_AGE_SESSION |
private static Duration |
MAX_AGE_STANDARD |
private static boolean |
SECURE_ENABLED |
| Constructor and Description |
|---|
StandardApplicationCookieService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCookie(URI resourceUri,
javax.servlet.http.HttpServletResponse response,
ApplicationCookieName applicationCookieName,
String value)
Generate cookie with specified value
|
void |
addSessionCookie(URI resourceUri,
javax.servlet.http.HttpServletResponse response,
ApplicationCookieName applicationCookieName,
String value)
Generate cookie with session-based expiration and specified value as well as SameSite Strict property
|
protected org.springframework.http.ResponseCookie.ResponseCookieBuilder |
getCookieBuilder(URI resourceUri,
ApplicationCookieName applicationCookieName,
String value,
Duration maxAge)
Get Response Cookie Builder with standard properties
|
private String |
getCookiePath(URI resourceUri) |
Optional<String> |
getCookieValue(javax.servlet.http.HttpServletRequest request,
ApplicationCookieName applicationCookieName)
Get cookie value using specified name
|
void |
removeCookie(URI resourceUri,
javax.servlet.http.HttpServletResponse response,
ApplicationCookieName applicationCookieName)
Generate cookie with an empty value instructing the client to remove the cookie with a maximum age of 60 seconds
|
private void |
setResponseCookie(javax.servlet.http.HttpServletResponse response,
org.springframework.http.ResponseCookie responseCookie) |
private static final Duration MAX_AGE_SESSION
private static final Duration MAX_AGE_REMOVE
private static final Duration MAX_AGE_STANDARD
private static final String DEFAULT_PATH
private static final boolean SECURE_ENABLED
private static final boolean HTTP_ONLY_ENABLED
private static final org.slf4j.Logger logger
public void addCookie(URI resourceUri, javax.servlet.http.HttpServletResponse response, ApplicationCookieName applicationCookieName, String value)
addCookie in interface ApplicationCookieServiceresourceUri - Resource URI containing path and domainresponse - HTTP Servlet ResponseapplicationCookieName - Application Cookie Name to be addedvalue - Cookie value to be addedpublic void addSessionCookie(URI resourceUri, javax.servlet.http.HttpServletResponse response, ApplicationCookieName applicationCookieName, String value)
addSessionCookie in interface ApplicationCookieServiceresourceUri - Resource URI containing path and domainresponse - HTTP Servlet ResponseapplicationCookieName - Application Cookie Namevalue - Cookie value to be addedpublic Optional<String> getCookieValue(javax.servlet.http.HttpServletRequest request, ApplicationCookieName applicationCookieName)
getCookieValue in interface ApplicationCookieServicerequest - HTTP Servlet ResponseapplicationCookieName - Application Cookie Name to be retrievedpublic void removeCookie(URI resourceUri, javax.servlet.http.HttpServletResponse response, ApplicationCookieName applicationCookieName)
removeCookie in interface ApplicationCookieServiceresourceUri - Resource URI containing path and domainresponse - HTTP Servlet ResponseapplicationCookieName - Application Cookie Name to be removedprotected org.springframework.http.ResponseCookie.ResponseCookieBuilder getCookieBuilder(URI resourceUri, ApplicationCookieName applicationCookieName, String value, Duration maxAge)
resourceUri - Resource URI containing path and domainapplicationCookieName - Application Cookie Name to be usedvalue - Cookie valuemaxAge - Max Ageprivate void setResponseCookie(javax.servlet.http.HttpServletResponse response,
org.springframework.http.ResponseCookie responseCookie)
Copyright © 2023 Apache NiFi Project. All rights reserved.