Class DefaultCacheInvalidator

java.lang.Object
org.apache.hc.client5.http.impl.cache.CacheInvalidatorBase
org.apache.hc.client5.http.impl.cache.DefaultCacheInvalidator
All Implemented Interfaces:
HttpCacheInvalidator

@Contract(threading=STATELESS) @Internal public class DefaultCacheInvalidator extends CacheInvalidatorBase implements HttpCacheInvalidator
Given a particular HTTP request / response pair, flush any cache entries that this exchange would invalidate.
Since:
4.1
  • Field Details

  • Constructor Details

    • DefaultCacheInvalidator

      public DefaultCacheInvalidator()
  • Method Details

    • getEntry

      private HttpCacheEntry getEntry(HttpCacheStorage storage, String cacheKey)
    • removeEntry

      private void removeEntry(HttpCacheStorage storage, String cacheKey)
    • flushCacheEntriesInvalidatedByRequest

      public void flushCacheEntriesInvalidatedByRequest(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.function.Resolver<URI,String> cacheKeyResolver, HttpCacheStorage storage)
      Description copied from interface: HttpCacheInvalidator
      Flush HttpCacheEntrys invalidated by the given request.
      Specified by:
      flushCacheEntriesInvalidatedByRequest in interface HttpCacheInvalidator
      Parameters:
      host - backend host
      request - request message
      cacheKeyResolver - cache key resolver used by cache storage
      storage - internal cache storage
    • flushRelativeUriFromSameHost

      private void flushRelativeUriFromSameHost(URI requestUri, URI uri, org.apache.hc.core5.function.Resolver<URI,String> cacheKeyResolver, HttpCacheStorage storage)
    • flushAbsoluteUriFromSameHost

      private boolean flushAbsoluteUriFromSameHost(URI requestUri, URI uri, org.apache.hc.core5.function.Resolver<URI,String> cacheKeyResolver, HttpCacheStorage storage)
    • flushCacheEntriesInvalidatedByExchange

      public void 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, HttpCacheStorage storage)
      Description copied from interface: HttpCacheInvalidator
      Flush HttpCacheEntrys invalidated by the given message exchange.
      Specified by:
      flushCacheEntriesInvalidatedByExchange in interface HttpCacheInvalidator
      Parameters:
      host - backend host
      request - request message
      response - response message
      cacheKeyResolver - cache key resolver used by cache storage
      storage - internal cache storage
    • flushLocationCacheEntry

      private void flushLocationCacheEntry(org.apache.hc.core5.http.HttpResponse response, URI location, HttpCacheStorage storage, org.apache.hc.core5.function.Resolver<URI,String> cacheKeyResolver)