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
Fields Modifier and Type Field Description static DefaultAsyncCacheInvalidator
INSTANCE
private static org.slf4j.Logger
LOG
-
Constructor Summary
Constructors Constructor Description DefaultAsyncCacheInvalidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
flushAbsoluteUriFromSameHost(java.net.URI requestUri, java.net.URI uri, org.apache.hc.core5.function.Resolver<java.net.URI,java.lang.String> cacheKeyResolver, HttpAsyncCacheStorage storage)
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<java.net.URI,java.lang.String> cacheKeyResolver, HttpAsyncCacheStorage storage, org.apache.hc.core5.concurrent.FutureCallback<java.lang.Boolean> callback)
FlushHttpCacheEntry
s invalidated by the given message exchange.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<java.net.URI,java.lang.String> cacheKeyResolver, HttpAsyncCacheStorage storage, org.apache.hc.core5.concurrent.FutureCallback<java.lang.Boolean> callback)
FlushHttpCacheEntry
s invalidated by the given request.private void
flushRelativeUriFromSameHost(java.net.URI requestUri, java.net.URI uri, org.apache.hc.core5.function.Resolver<java.net.URI,java.lang.String> cacheKeyResolver, HttpAsyncCacheStorage storage)
private void
removeEntry(HttpAsyncCacheStorage storage, java.lang.String cacheKey)
-
Methods inherited from class org.apache.hc.client5.http.impl.cache.CacheInvalidatorBase
getContentLocationURI, getLocationURI, isAHeadCacheEntry, isSameHost, notGetOrHeadRequest, requestIsGet, requestShouldNotBeCached, responseAndEntryEtagsDiffer, responseDateOlderThanEntryDate, shouldInvalidateHeadCacheEntry
-
-
-
-
Field Detail
-
INSTANCE
public static final DefaultAsyncCacheInvalidator INSTANCE
-
LOG
private static final org.slf4j.Logger LOG
-
-
Method Detail
-
removeEntry
private void removeEntry(HttpAsyncCacheStorage storage, java.lang.String cacheKey)
-
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<java.net.URI,java.lang.String> cacheKeyResolver, HttpAsyncCacheStorage storage, org.apache.hc.core5.concurrent.FutureCallback<java.lang.Boolean> callback)
Description copied from interface:HttpAsyncCacheInvalidator
FlushHttpCacheEntry
s invalidated by the given request.- Specified by:
flushCacheEntriesInvalidatedByRequest
in interfaceHttpAsyncCacheInvalidator
- Parameters:
host
- backend hostrequest
- request messagecacheKeyResolver
- cache key resolver used by cache storagestorage
- internal cache storagecallback
- result callback
-
flushRelativeUriFromSameHost
private void flushRelativeUriFromSameHost(java.net.URI requestUri, java.net.URI uri, org.apache.hc.core5.function.Resolver<java.net.URI,java.lang.String> cacheKeyResolver, HttpAsyncCacheStorage storage)
-
flushAbsoluteUriFromSameHost
private boolean flushAbsoluteUriFromSameHost(java.net.URI requestUri, java.net.URI uri, org.apache.hc.core5.function.Resolver<java.net.URI,java.lang.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<java.net.URI,java.lang.String> cacheKeyResolver, HttpAsyncCacheStorage storage, org.apache.hc.core5.concurrent.FutureCallback<java.lang.Boolean> callback)
Description copied from interface:HttpAsyncCacheInvalidator
FlushHttpCacheEntry
s invalidated by the given message exchange.- Specified by:
flushCacheEntriesInvalidatedByExchange
in interfaceHttpAsyncCacheInvalidator
- Parameters:
host
- backend hostrequest
- request messageresponse
- response messagecacheKeyResolver
- cache key resolver used by cache storagestorage
- internal cache storagecallback
- result callback
-
-