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
ProcessState
awareHttpResponseCookies
.- 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 headWritableHttpCookie
to the linked list ofWritableHttpCookie
instances for theHttpResponseWriter
.- Returns:
- Head
WritableHttpCookie
to the linked list ofWritableHttpCookie
instances for theHttpResponseWriter
. May benull
.
-
iterator
public java.util.Iterator<HttpResponseCookie> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<HttpResponseCookie>
-
setCookie
public HttpResponseCookie setCookie(java.lang.String name, java.lang.String value)
Description copied from interface:HttpResponseCookies
Sets a
HttpResponseCookie
.If a
HttpResponseCookie
already exists by the name, it is updated to the value and returned. Otherwise a newHttpResponseCookie
is added for the name.- Specified by:
setCookie
in 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:HttpResponseCookies
Sets a
HttpResponseCookie
.If a
HttpResponseCookie
already exists by the name, it is updated to the value and returned. Otherwise a newHttpResponseCookie
is added for the name.- Specified by:
setCookie
in 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:HttpResponseCookies
Sets a
HttpResponseCookie
from aHttpRequestCookie
.If a
HttpResponseCookie
already exists by the name, it is updated to the value and returned. Otherwise a newHttpResponseCookie
is 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:
setCookie
in interfaceHttpResponseCookies
- Parameters:
cookie
-HttpRequestCookie
.- Returns:
HttpResponseCookie
.
-
setCookie
public HttpResponseCookie setCookie(HttpRequestCookie cookie, java.util.function.Consumer<HttpResponseCookie> initialiser)
Description copied from interface:HttpResponseCookies
Sets a
HttpResponseCookie
from aHttpRequestCookie
.If a
HttpResponseCookie
already exists by the name, it is updated to the value and returned. Otherwise a newHttpResponseCookie
is added for the name.- Specified by:
setCookie
in interfaceHttpResponseCookies
- Parameters:
cookie
-HttpRequestCookie
initialiser
- 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:HttpResponseCookies
Removes theHttpResponseCookie
.- Specified by:
removeCookie
in interfaceHttpResponseCookies
- Parameters:
cookie
-HttpResponseCookie
.- Returns:
true
if theHttpResponseCookie
was removed.
-
getCookie
public HttpResponseCookie getCookie(java.lang.String name)
Description copied from interface:HttpResponseCookies
Obtains theHttpResponseCookie
by name.- Specified by:
getCookie
in interfaceHttpResponseCookies
- Parameters:
name
- Name of theHttpResponseCookie
.- Returns:
HttpResponseCookie
ornull
if noHttpResponseCookie
by the name.
-
-