Class ProcessAwareHttpResponseCookies
- All Implemented Interfaces:
Iterable<HttpResponseCookie>,HttpResponseCookies
ProcessState aware HttpResponseCookies.- Author:
- Daniel Sagenschneider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionObtains theHttpResponseCookieby name.Obtains the headWritableHttpCookieto the linked list ofWritableHttpCookieinstances for theHttpResponseWriter.iterator()booleanremoveCookie(HttpResponseCookie cookie) Removes theHttpResponseCookie.Sets aHttpResponseCookie.setCookie(String name, String value, Consumer<HttpResponseCookie> initialiser) Sets aHttpResponseCookie.setCookie(HttpRequestCookie cookie) Sets aHttpResponseCookiefrom aHttpRequestCookie.setCookie(HttpRequestCookie cookie, Consumer<HttpResponseCookie> initialiser) Sets aHttpResponseCookiefrom aHttpRequestCookie.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ProcessAwareHttpResponseCookies
Instantiate.- Parameters:
context-ManagedObjectContext.
-
-
Method Details
-
getWritableHttpCookie
Obtains the headWritableHttpCookieto the linked list ofWritableHttpCookieinstances for theHttpResponseWriter.- Returns:
- Head
WritableHttpCookieto the linked list ofWritableHttpCookieinstances for theHttpResponseWriter. May benull.
-
iterator
- Specified by:
iteratorin interfaceIterable<HttpResponseCookie>
-
setCookie
Description copied from interface:HttpResponseCookiesSets a
HttpResponseCookie.If a
HttpResponseCookiealready exists by the name, it is updated to the value and returned. Otherwise a newHttpResponseCookieis added for the name.- Specified by:
setCookiein interfaceHttpResponseCookies- Parameters:
name- Name.value- Value.- Returns:
HttpRequestCookie.
-
setCookie
public HttpResponseCookie setCookie(String name, String value, Consumer<HttpResponseCookie> initialiser) Description copied from interface:HttpResponseCookiesSets a
HttpResponseCookie.If a
HttpResponseCookiealready exists by the name, it is updated to the value and returned. Otherwise a newHttpResponseCookieis added for the name.- Specified by:
setCookiein interfaceHttpResponseCookies- Parameters:
name- Name.value- Value.initialiser- Enables initialising the attributes of theHttpResponseCookie. This reduces locking in setting multiple attributes.- Returns:
HttpResponseCookie.
-
setCookie
Description copied from interface:HttpResponseCookiesSets a
HttpResponseCookiefrom aHttpRequestCookie.If a
HttpResponseCookiealready exists by the name, it is updated to the value and returned. Otherwise a newHttpResponseCookieis added for the name.This is typically used to update the Cookie with the client. For example, expiring the Cookie to no longer be sent.
- Specified by:
setCookiein interfaceHttpResponseCookies- Parameters:
cookie-HttpRequestCookie.- Returns:
HttpResponseCookie.
-
setCookie
public HttpResponseCookie setCookie(HttpRequestCookie cookie, Consumer<HttpResponseCookie> initialiser) Description copied from interface:HttpResponseCookiesSets a
HttpResponseCookiefrom aHttpRequestCookie.If a
HttpResponseCookiealready exists by the name, it is updated to the value and returned. Otherwise a newHttpResponseCookieis added for the name.- Specified by:
setCookiein interfaceHttpResponseCookies- Parameters:
cookie-HttpRequestCookieinitialiser- Enables initialising the attributes of theHttpResponseCookie. This reduces locking in setting multiple attributes.- Returns:
HttpResponseCookie.
-
removeCookie
Description copied from interface:HttpResponseCookiesRemoves theHttpResponseCookie.- Specified by:
removeCookiein interfaceHttpResponseCookies- Parameters:
cookie-HttpResponseCookie.- Returns:
trueif theHttpResponseCookiewas removed.
-
getCookie
Description copied from interface:HttpResponseCookiesObtains theHttpResponseCookieby name.- Specified by:
getCookiein interfaceHttpResponseCookies- Parameters:
name- Name of theHttpResponseCookie.- Returns:
HttpResponseCookieornullif noHttpResponseCookieby the name.
-