Class BaseCookieHandler
java.lang.Object
org.apache.camel.http.base.cookie.BaseCookieHandler
- All Implemented Interfaces:
CookieHandler
- Direct Known Subclasses:
ExchangeCookieHandler,InstanceCookieHandler
A basic implementation of a CamelCookie handler based on the JDK CookieManager.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract CookieManagergetCookieManager(org.apache.camel.Exchange exchange) getCookieStore(org.apache.camel.Exchange exchange) Get the CookieStore.loadCookies(org.apache.camel.Exchange exchange, URI uri) Create cookie headers from the stored cookies appropriate for a given URI.voidStore cookies for a HTTP response in the cookie handlerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.http.base.cookie.CookieHandler
setCookiePolicy
-
Constructor Details
-
BaseCookieHandler
public BaseCookieHandler()
-
-
Method Details
-
storeCookies
public void storeCookies(org.apache.camel.Exchange exchange, URI uri, Map<String, List<String>> headerMap) throws IOExceptionDescription copied from interface:CookieHandlerStore cookies for a HTTP response in the cookie handler- Specified by:
storeCookiesin interfaceCookieHandler- Parameters:
exchange- the exchangeuri- the URI of the called HTTP serviceheaderMap- a map containing the HTTP headers returned by the server- Throws:
IOException- if the cookies cannot be stored
-
loadCookies
public Map<String,List<String>> loadCookies(org.apache.camel.Exchange exchange, URI uri) throws IOException Description copied from interface:CookieHandlerCreate cookie headers from the stored cookies appropriate for a given URI.- Specified by:
loadCookiesin interfaceCookieHandler- Parameters:
exchange- the exchangeuri- the URI of the called HTTP service- Returns:
- a map containing the cookie headers that can be set to the HTTP request. Only cookies that are supposed to be sent to the URI in question are considered.
- Throws:
IOException- if the cookies cannot be loaded
-
getCookieStore
Description copied from interface:CookieHandlerGet the CookieStore. This method can be used if the is using a CookieHandler by itself.- Specified by:
getCookieStorein interfaceCookieHandler- Parameters:
exchange- the exchange- Returns:
- the CookieStore
-
getCookieManager
-