Interface HttpCache
-
- All Known Implementing Classes:
BasicHttpCache
interface HttpCache
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HttpCacheEntrycreateCacheEntry(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse originResponse, org.apache.hc.core5.util.ByteArrayBuffer content, java.time.Instant requestSent, java.time.Instant responseReceived)Store aHttpResponsein the cache if possible, and returnvoidflushCacheEntriesFor(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request)Clear all matchingHttpCacheEntrys.voidflushCacheEntriesInvalidatedByExchange(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse response)FlushHttpCacheEntrys invalidated by the given message exchange.voidflushCacheEntriesInvalidatedByRequest(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request)FlushHttpCacheEntrys invalidated by the given requestjava.lang.StringgenerateKey(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, HttpCacheEntry cacheEntry)HttpCacheEntrygetCacheEntry(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request)Retrieve matchingHttpCacheEntryfrom the cache if it exists.java.util.Map<java.lang.String,Variant>getVariantCacheEntriesWithEtags(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request)Retrieve all variants from the cache, if there are no variants then an emptyMapis returnedvoidreuseVariantEntryFor(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, Variant variant)Specifies cache should reuse the given cached variant to satisfy requests whose varying headers match those of the given client request.HttpCacheEntryupdateCacheEntry(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, HttpCacheEntry stale, org.apache.hc.core5.http.HttpResponse originResponse, java.time.Instant requestSent, java.time.Instant responseReceived)Update aHttpCacheEntryusing a 304HttpResponse.HttpCacheEntryupdateVariantCacheEntry(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse originResponse, Variant variant, java.time.Instant requestSent, java.time.Instant responseReceived)Update a specificHttpCacheEntryrepresenting a cached variant using a 304HttpResponse.
-
-
-
Method Detail
-
generateKey
java.lang.String generateKey(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, HttpCacheEntry cacheEntry)
-
flushCacheEntriesFor
void flushCacheEntriesFor(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request)Clear all matchingHttpCacheEntrys.
-
flushCacheEntriesInvalidatedByRequest
void flushCacheEntriesInvalidatedByRequest(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request)FlushHttpCacheEntrys invalidated by the given request
-
flushCacheEntriesInvalidatedByExchange
void flushCacheEntriesInvalidatedByExchange(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse response)FlushHttpCacheEntrys invalidated by the given message exchange.
-
getCacheEntry
HttpCacheEntry getCacheEntry(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request)
Retrieve matchingHttpCacheEntryfrom the cache if it exists.
-
getVariantCacheEntriesWithEtags
java.util.Map<java.lang.String,Variant> getVariantCacheEntriesWithEtags(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request)
Retrieve all variants from the cache, if there are no variants then an emptyMapis returned
-
createCacheEntry
HttpCacheEntry createCacheEntry(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse originResponse, org.apache.hc.core5.util.ByteArrayBuffer content, java.time.Instant requestSent, java.time.Instant responseReceived)
Store aHttpResponsein the cache if possible, and return
-
updateCacheEntry
HttpCacheEntry updateCacheEntry(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, HttpCacheEntry stale, org.apache.hc.core5.http.HttpResponse originResponse, java.time.Instant requestSent, java.time.Instant responseReceived)
Update aHttpCacheEntryusing a 304HttpResponse.
-
updateVariantCacheEntry
HttpCacheEntry updateVariantCacheEntry(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse originResponse, Variant variant, java.time.Instant requestSent, java.time.Instant responseReceived)
Update a specificHttpCacheEntryrepresenting a cached variant using a 304HttpResponse.
-
reuseVariantEntryFor
void reuseVariantEntryFor(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, Variant variant)Specifies cache should reuse the given cached variant to satisfy requests whose varying headers match those of the given client request.
-
-