Class BasicHttpAsyncCache
java.lang.Object
org.apache.hc.client5.http.impl.cache.BasicHttpAsyncCache
- All Implemented Interfaces:
HttpAsyncCache
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HttpCacheEntryFactoryprivate final CacheKeyGeneratorprivate static final org.slf4j.Loggerprivate final ResourceFactoryprivate final HttpAsyncCacheStorage -
Constructor Summary
ConstructorsConstructorDescriptionBasicHttpAsyncCache(ResourceFactory resourceFactory, HttpAsyncCacheStorage storage) BasicHttpAsyncCache(ResourceFactory resourceFactory, HttpAsyncCacheStorage storage, CacheKeyGenerator cacheKeyGenerator) BasicHttpAsyncCache(ResourceFactory resourceFactory, HttpCacheEntryFactory cacheEntryFactory, HttpAsyncCacheStorage storage, CacheKeyGenerator cacheKeyGenerator) -
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hc.core5.concurrent.Cancellableprivate org.apache.hc.core5.concurrent.Cancellableprivate voidevictAll(HttpCacheEntry root, String rootKey) org.apache.hc.core5.concurrent.CancellableevictInvalidatedEntries(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.concurrent.FutureCallback<Boolean> callback) EvictsHttpCacheEntrys invalidated by the given message exchange.org.apache.hc.core5.concurrent.CancellablegetVariants(CacheHit hit, org.apache.hc.core5.concurrent.FutureCallback<Collection<CacheHit>> callback) Retrieves variantHttpCacheEntrys for the given hit.org.apache.hc.core5.concurrent.Cancellablematch(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.concurrent.FutureCallback<CacheMatch> callback) Returns a result with either a fully matchingHttpCacheEntrya partial match with a list of known variants or null if no match could be found.private voidremoveInternal(String cacheKey) (package private) org.apache.hc.core5.concurrent.Cancellablestore(String rootKey, String variantKey, HttpCacheEntry entry, org.apache.hc.core5.concurrent.FutureCallback<CacheHit> callback) org.apache.hc.core5.concurrent.Cancellablestore(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, Instant requestSent, Instant responseReceived, org.apache.hc.core5.concurrent.FutureCallback<CacheHit> callback) StoresHttpRequest/HttpResponseexchange details in the cache.org.apache.hc.core5.concurrent.CancellablestoreFromNegotiated(CacheHit negotiated, org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse originResponse, Instant requestSent, Instant responseReceived, org.apache.hc.core5.concurrent.FutureCallback<CacheHit> callback) (package private) org.apache.hc.core5.concurrent.CancellablestoreInternal(String cacheKey, HttpCacheEntry entry, org.apache.hc.core5.concurrent.FutureCallback<Boolean> callback) org.apache.hc.core5.concurrent.Cancellableupdate(CacheHit stale, org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse originResponse, Instant requestSent, Instant responseReceived, org.apache.hc.core5.concurrent.FutureCallback<CacheHit> callback) UpdatesHttpCacheEntryusing details from a 304HttpResponseand updates the root entry if the given cache entry represents a variant.(package private) org.apache.hc.core5.concurrent.CancellableupdateInternal(String cacheKey, HttpCacheCASOperation casOperation, org.apache.hc.core5.concurrent.FutureCallback<Boolean> callback)
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
resourceFactory
-
cacheEntryFactory
-
cacheKeyGenerator
-
storage
-
-
Constructor Details
-
BasicHttpAsyncCache
public BasicHttpAsyncCache(ResourceFactory resourceFactory, HttpCacheEntryFactory cacheEntryFactory, HttpAsyncCacheStorage storage, CacheKeyGenerator cacheKeyGenerator) -
BasicHttpAsyncCache
public BasicHttpAsyncCache(ResourceFactory resourceFactory, HttpAsyncCacheStorage storage, CacheKeyGenerator cacheKeyGenerator) -
BasicHttpAsyncCache
-
-
Method Details
-
match
public org.apache.hc.core5.concurrent.Cancellable match(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.concurrent.FutureCallback<CacheMatch> callback) Description copied from interface:HttpAsyncCacheReturns a result with either a fully matchingHttpCacheEntrya partial match with a list of known variants or null if no match could be found.- Specified by:
matchin interfaceHttpAsyncCache
-
getVariants
public org.apache.hc.core5.concurrent.Cancellable getVariants(CacheHit hit, org.apache.hc.core5.concurrent.FutureCallback<Collection<CacheHit>> callback) Description copied from interface:HttpAsyncCacheRetrieves variantHttpCacheEntrys for the given hit.- Specified by:
getVariantsin interfaceHttpAsyncCache
-
storeInternal
org.apache.hc.core5.concurrent.Cancellable storeInternal(String cacheKey, HttpCacheEntry entry, org.apache.hc.core5.concurrent.FutureCallback<Boolean> callback) -
updateInternal
org.apache.hc.core5.concurrent.Cancellable updateInternal(String cacheKey, HttpCacheCASOperation casOperation, org.apache.hc.core5.concurrent.FutureCallback<Boolean> callback) -
removeInternal
-
store
org.apache.hc.core5.concurrent.Cancellable store(String rootKey, String variantKey, HttpCacheEntry entry, org.apache.hc.core5.concurrent.FutureCallback<CacheHit> callback) -
store
public org.apache.hc.core5.concurrent.Cancellable store(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, Instant requestSent, Instant responseReceived, org.apache.hc.core5.concurrent.FutureCallback<CacheHit> callback) Description copied from interface:HttpAsyncCacheStoresHttpRequest/HttpResponseexchange details in the cache.- Specified by:
storein interfaceHttpAsyncCache
-
update
public org.apache.hc.core5.concurrent.Cancellable update(CacheHit stale, org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse originResponse, Instant requestSent, Instant responseReceived, org.apache.hc.core5.concurrent.FutureCallback<CacheHit> callback) Description copied from interface:HttpAsyncCacheUpdatesHttpCacheEntryusing details from a 304HttpResponseand updates the root entry if the given cache entry represents a variant.- Specified by:
updatein interfaceHttpAsyncCache
-
storeFromNegotiated
public org.apache.hc.core5.concurrent.Cancellable storeFromNegotiated(CacheHit negotiated, org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse originResponse, Instant requestSent, Instant responseReceived, org.apache.hc.core5.concurrent.FutureCallback<CacheHit> callback) Description copied from interface:HttpAsyncCache- Specified by:
storeFromNegotiatedin interfaceHttpAsyncCache
-
evictAll
-
evict
-
evict
private org.apache.hc.core5.concurrent.Cancellable evict(String rootKey, org.apache.hc.core5.http.HttpResponse response) -
evictInvalidatedEntries
public org.apache.hc.core5.concurrent.Cancellable evictInvalidatedEntries(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse response, org.apache.hc.core5.concurrent.FutureCallback<Boolean> callback) Description copied from interface:HttpAsyncCacheEvictsHttpCacheEntrys invalidated by the given message exchange.- Specified by:
evictInvalidatedEntriesin interfaceHttpAsyncCache
-