Class ProcessAwareHttpResponseCookies
- java.lang.Object
-
- net.officefloor.server.http.impl.ProcessAwareHttpResponseCookies
-
- All Implemented Interfaces:
java.lang.Iterable<HttpResponseCookie>,HttpResponseCookies
public class ProcessAwareHttpResponseCookies extends java.lang.Object implements HttpResponseCookies
ProcessStateawareHttpResponseCookies.- Author:
- Daniel Sagenschneider
-
-
Constructor Summary
Constructors Constructor Description ProcessAwareHttpResponseCookies(ManagedObjectContext context)Instantiate.
-
Method Summary
-
-
-
Constructor Detail
-
ProcessAwareHttpResponseCookies
public ProcessAwareHttpResponseCookies(ManagedObjectContext context)
Instantiate.- Parameters:
context-ManagedObjectContext.
-
-
Method Detail
-
getWritableHttpCookie
public WritableHttpCookie getWritableHttpCookie()
Obtains the headWritableHttpCookieto the linked list ofWritableHttpCookieinstances for theHttpResponseWriter.- Returns:
- Head
WritableHttpCookieto the linked list ofWritableHttpCookieinstances for theHttpResponseWriter. May benull.
-
iterator
public java.util.Iterator<HttpResponseCookie> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<HttpResponseCookie>
-
setCookie
public HttpResponseCookie setCookie(java.lang.String name, java.lang.String value)
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(java.lang.String name, java.lang.String value, java.util.function.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
public HttpResponseCookie setCookie(HttpRequestCookie cookie)
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, java.util.function.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
public boolean removeCookie(HttpResponseCookie cookie)
Description copied from interface:HttpResponseCookiesRemoves theHttpResponseCookie.- Specified by:
removeCookiein interfaceHttpResponseCookies- Parameters:
cookie-HttpResponseCookie.- Returns:
trueif theHttpResponseCookiewas removed.
-
getCookie
public HttpResponseCookie getCookie(java.lang.String name)
Description copied from interface:HttpResponseCookiesObtains theHttpResponseCookieby name.- Specified by:
getCookiein interfaceHttpResponseCookies- Parameters:
name- Name of theHttpResponseCookie.- Returns:
HttpResponseCookieornullif noHttpResponseCookieby the name.
-
-