Class CacheUpdateHandler
java.lang.Object
org.apache.hc.client5.http.impl.cache.CacheUpdateHandler
Creates new
HttpCacheEntry
s and updates existing ones with new or updated information
based on the response from the origin server.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateCacheEntry
(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse originResponse, org.apache.hc.core5.util.ByteArrayBuffer content, Instant requestSent, Instant responseReceived) Creates a cache entry for the given request, origin response message and response content.private org.apache.hc.core5.http.Header[]
mergeHeaders
(HttpCacheEntry entry, org.apache.hc.core5.http.HttpResponse response) updateCacheEntry
(String requestId, HttpCacheEntry entry, Instant requestDate, Instant responseDate, org.apache.hc.core5.http.HttpResponse response) Update the entry with the new information from the response.updateParentCacheEntry
(String requestId, HttpCacheEntry existing, HttpCacheEntry entry, String variantKey, String variantCacheKey)
-
Field Details
-
resourceFactory
-
-
Constructor Details
-
CacheUpdateHandler
CacheUpdateHandler() -
CacheUpdateHandler
CacheUpdateHandler(ResourceFactory resourceFactory)
-
-
Method Details
-
createCacheEntry
public HttpCacheEntry createCacheEntry(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse originResponse, org.apache.hc.core5.util.ByteArrayBuffer content, Instant requestSent, Instant responseReceived) throws ResourceIOException Creates a cache entry for the given request, origin response message and response content.- Throws:
ResourceIOException
-
updateCacheEntry
public HttpCacheEntry updateCacheEntry(String requestId, HttpCacheEntry entry, Instant requestDate, Instant responseDate, org.apache.hc.core5.http.HttpResponse response) throws ResourceIOException Update the entry with the new information from the response. Should only be used for 304 responses.- Throws:
ResourceIOException
-
updateParentCacheEntry
public HttpCacheEntry updateParentCacheEntry(String requestId, HttpCacheEntry existing, HttpCacheEntry entry, String variantKey, String variantCacheKey) throws ResourceIOException - Throws:
ResourceIOException
-
mergeHeaders
private org.apache.hc.core5.http.Header[] mergeHeaders(HttpCacheEntry entry, org.apache.hc.core5.http.HttpResponse response)
-