Class JdkPerInstanceCookieStore
java.lang.Object
de.codecentric.boot.admin.server.web.client.cookies.JdkPerInstanceCookieStore
- All Implemented Interfaces:
PerInstanceCookieStore
A
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 Summary
ConstructorsConstructorDescriptionCreates a newJdkPerInstanceCookieStore.JdkPerInstanceCookieStore(CookiePolicy cookiePolicy) Creates a newJdkPerInstanceCookieStoreusing the givenCookiePolicy. -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanupInstance(InstanceId instanceId) Informs the store that the cookies of the giveninstanceIdcould be removed.protected CookieHandlercreateCookieHandler(InstanceId instanceId) 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 giveninstanceIdand the specified uri in the request header.protected CookieHandlergetCookieHandler(InstanceId instanceId) Returns the storedCookieHandlerfor the identifiedInstanceor creates a new one, stores and returns it.voidput(InstanceId instanceId, URI requestUrl, org.springframework.util.MultiValueMap<String, String> headers) Stores all the applicable cookies (examples are response header fields that are namedSet-Cookie) present in the response headers.
-
Constructor Details
-
JdkPerInstanceCookieStore
public JdkPerInstanceCookieStore()Creates a newJdkPerInstanceCookieStore. Same asnew JdkPerInstanceCookieStore(CookiePolicy.ACCEPT_ORIGINAL_SERVER);
-
JdkPerInstanceCookieStore
Creates a newJdkPerInstanceCookieStoreusing the givenCookiePolicy.- Parameters:
cookiePolicy- policy used by createdCookieStores
-
-
Method Details
-
get
public org.springframework.util.MultiValueMap<String,String> get(InstanceId instanceId, URI requestUri, org.springframework.util.MultiValueMap<String, String> requestHeaders) Description copied from interface:PerInstanceCookieStoreGets all the applicable cookies (cookie name => string representation of cookie) for the giveninstanceIdand the specified uri in the request header. The URI passed as an argument specifies the intended use for the cookies.- Specified by:
getin interfacePerInstanceCookieStore- Parameters:
instanceId- 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 request- Returns:
- an immutable map from cookie names to text representations of cookies to be included into a request header
-
put
public void put(InstanceId instanceId, URI requestUrl, org.springframework.util.MultiValueMap<String, String> headers) Description copied from interface:PerInstanceCookieStoreStores all the applicable cookies (examples are response header fields that are namedSet-Cookie) present in the response headers.- Specified by:
putin interfacePerInstanceCookieStore- Parameters:
instanceId- 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 fields
-
cleanupInstance
Description copied from interface:PerInstanceCookieStoreInforms the store that the cookies of the giveninstanceIdcould be removed.- Specified by:
cleanupInstancein interfacePerInstanceCookieStore- Parameters:
instanceId- identifies theInstance
-
getCookieHandler
Returns the storedCookieHandlerfor the identifiedInstanceor creates a new one, stores and returns it.- Parameters:
instanceId- identifies theInstance- Returns:
CookieHandlerresponsible for the giveninstanceId
-
createCookieHandler
-