public class JdkPerInstanceCookieStore extends Object implements PerInstanceCookieStore
PerInstanceCookieStore that is using per
Instance a CookieStore
from JDK as back end store.
As Cookie2 cookies are
not
recommended any more only
Cookie
cookies are supported.| Constructor and Description |
|---|
JdkPerInstanceCookieStore()
Creates a new
JdkPerInstanceCookieStore. |
JdkPerInstanceCookieStore(CookiePolicy cookiePolicy)
Creates a new
JdkPerInstanceCookieStore using the given
CookiePolicy. |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanupInstance(InstanceId instanceId)
Informs the store that the cookies of the given
instanceId could be
removed. |
protected CookieHandler |
createCookieHandler(InstanceId instanceId) |
org.springframework.util.MultiValueMap<String,String> |
get(InstanceId instanceId,
URI requestUri,
org.springframework.util.MultiValueMap<String,String> requestHeaders)
Gets all the applicable cookies (cookie name => string representation of cookie)
for the given
instanceId and the specified uri in the request header. |
protected CookieHandler |
getCookieHandler(InstanceId instanceId)
Returns the stored
CookieHandler for the identified
Instance or creates a new
one, stores and returns it. |
void |
put(InstanceId instanceId,
URI requestUrl,
org.springframework.util.MultiValueMap<String,String> headers)
Stores all the applicable cookies (examples are response header fields that are
named
Set-Cookie) present in the response headers. |
public JdkPerInstanceCookieStore()
JdkPerInstanceCookieStore.
Same as
new JdkPerInstanceCookieStore(CookiePolicy.ACCEPT_ORIGINAL_SERVER);
public JdkPerInstanceCookieStore(CookiePolicy cookiePolicy)
JdkPerInstanceCookieStore using the given
CookiePolicy.cookiePolicy - policy used by created CookieStorespublic org.springframework.util.MultiValueMap<String,String> get(InstanceId instanceId, URI requestUri, org.springframework.util.MultiValueMap<String,String> requestHeaders)
PerInstanceCookieStoreinstanceId and the specified uri in the request header.
The URI passed as an argument specifies the intended use for the cookies.get in interface PerInstanceCookieStoreinstanceId - identifies the web client instancerequestUri - a URI representing the intended use for the cookiesrequestHeaders - a Map from request header field names to lists of field
values representing the current requestpublic void put(InstanceId instanceId, URI requestUrl, org.springframework.util.MultiValueMap<String,String> headers)
PerInstanceCookieStoreSet-Cookie) present in the response headers.put in interface PerInstanceCookieStoreinstanceId - identifies the web client instancerequestUrl - an URI where the cookies come fromheaders - a map from field names to lists of field values representing
the response header fieldspublic void cleanupInstance(InstanceId instanceId)
PerInstanceCookieStoreinstanceId could be
removed.cleanupInstance in interface PerInstanceCookieStoreinstanceId - identifies the Instanceprotected CookieHandler getCookieHandler(InstanceId instanceId)
CookieHandler for the identified
Instance or creates a new
one, stores and returns it.instanceId - identifies the
InstanceCookieHandler responsible for the given instanceIdprotected CookieHandler createCookieHandler(InstanceId instanceId)
Copyright © 2022 codecentric AG. All rights reserved.