Class DefaultAsyncCacheInvalidator
java.lang.Object
org.apache.hc.client5.http.impl.cache.CacheInvalidatorBase
org.apache.hc.client5.http.impl.cache.DefaultAsyncCacheInvalidator
- All Implemented Interfaces:
HttpAsyncCacheInvalidator
@Contract(threading=STATELESS)
@Internal
public class DefaultAsyncCacheInvalidator
extends CacheInvalidatorBase
implements HttpAsyncCacheInvalidator
Given a particular HTTP request / response pair, flush any cache entries
that this exchange would invalidate.
- Since:
- 5.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DefaultAsyncCacheInvalidatorprivate static final org.slf4j.Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanflushAbsoluteUriFromSameHost(URI requestUri, URI uri, org.apache.hc.core5.function.Resolver<URI, String> cacheKeyResolver, HttpAsyncCacheStorage storage) org.apache.hc.core5.concurrent.CancellableflushCacheEntriesInvalidatedByExchange(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.function.Resolver<URI, String> cacheKeyResolver, HttpAsyncCacheStorage storage, org.apache.hc.core5.concurrent.FutureCallback<Boolean> callback) FlushHttpCacheEntrys invalidated by the given message exchange.org.apache.hc.core5.concurrent.CancellableflushCacheEntriesInvalidatedByRequest(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.function.Resolver<URI, String> cacheKeyResolver, HttpAsyncCacheStorage storage, org.apache.hc.core5.concurrent.FutureCallback<Boolean> callback) FlushHttpCacheEntrys invalidated by the given request.private voidflushRelativeUriFromSameHost(URI requestUri, URI uri, org.apache.hc.core5.function.Resolver<URI, String> cacheKeyResolver, HttpAsyncCacheStorage storage) private voidremoveEntry(HttpAsyncCacheStorage storage, String cacheKey)
-
Field Details
-
INSTANCE
-
LOG
private static final org.slf4j.Logger LOG
-
-
Constructor Details
-
DefaultAsyncCacheInvalidator
public DefaultAsyncCacheInvalidator()
-
-
Method Details
-
removeEntry
-
flushCacheEntriesInvalidatedByRequest
public org.apache.hc.core5.concurrent.Cancellable flushCacheEntriesInvalidatedByRequest(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.function.Resolver<URI, String> cacheKeyResolver, HttpAsyncCacheStorage storage, org.apache.hc.core5.concurrent.FutureCallback<Boolean> callback) Description copied from interface:HttpAsyncCacheInvalidatorFlushHttpCacheEntrys invalidated by the given request.- Specified by:
flushCacheEntriesInvalidatedByRequestin interfaceHttpAsyncCacheInvalidator- Parameters:
host- backend hostrequest- request messagecacheKeyResolver- cache key resolver used by cache storagestorage- internal cache storagecallback- result callback
-
flushRelativeUriFromSameHost
private void flushRelativeUriFromSameHost(URI requestUri, URI uri, org.apache.hc.core5.function.Resolver<URI, String> cacheKeyResolver, HttpAsyncCacheStorage storage) -
flushAbsoluteUriFromSameHost
private boolean flushAbsoluteUriFromSameHost(URI requestUri, URI uri, org.apache.hc.core5.function.Resolver<URI, String> cacheKeyResolver, HttpAsyncCacheStorage storage) -
flushCacheEntriesInvalidatedByExchange
public org.apache.hc.core5.concurrent.Cancellable flushCacheEntriesInvalidatedByExchange(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.function.Resolver<URI, String> cacheKeyResolver, HttpAsyncCacheStorage storage, org.apache.hc.core5.concurrent.FutureCallback<Boolean> callback) Description copied from interface:HttpAsyncCacheInvalidatorFlushHttpCacheEntrys invalidated by the given message exchange.- Specified by:
flushCacheEntriesInvalidatedByExchangein interfaceHttpAsyncCacheInvalidator- Parameters:
host- backend hostrequest- request messageresponse- response messagecacheKeyResolver- cache key resolver used by cache storagestorage- internal cache storagecallback- result callback
-