Class BasicHttpCache

java.lang.Object
org.apache.hc.client5.http.impl.cache.BasicHttpCache
All Implemented Interfaces:
HttpCache

class BasicHttpCache extends Object implements HttpCache
  • Field Details

  • Constructor Details

  • Method Details

    • storeInternal

      void storeInternal(String cacheKey, HttpCacheEntry entry)
    • updateInternal

      void updateInternal(String cacheKey, HttpCacheCASOperation casOperation)
    • getInternal

      HttpCacheEntry getInternal(String cacheKey)
    • removeInternal

      private void removeInternal(String cacheKey)
    • match

      public CacheMatch match(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request)
      Description copied from interface: HttpCache
      Returns a result with either a fully matching HttpCacheEntry a partial match with a list of known variants or null if no match could be found.
      Specified by:
      match in interface HttpCache
    • getVariants

      public List<CacheHit> getVariants(CacheHit hit)
      Description copied from interface: HttpCache
      Retrieves variant HttpCacheEntrys for the given hit.
      Specified by:
      getVariants in interface HttpCache
    • store

      CacheHit store(String rootKey, String variantKey, HttpCacheEntry entry)
    • store

      public CacheHit 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)
      Description copied from interface: HttpCache
      Stores HttpRequest / HttpResponse exchange details in the cache.
      Specified by:
      store in interface HttpCache
    • update

      public CacheHit 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)
      Description copied from interface: HttpCache
      Updates HttpCacheEntry using details from a 304 HttpResponse and updates the root entry if the given cache entry represents a variant.
      Specified by:
      update in interface HttpCache
    • storeFromNegotiated

      public CacheHit 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)
      Description copied from interface: HttpCache
      Stores HttpRequest / HttpResponse exchange details in the cache from the negotiated HttpCacheEntry.
      Specified by:
      storeFromNegotiated in interface HttpCache
    • evictAll

      private void evictAll(HttpCacheEntry root, String rootKey)
    • evict

      private void evict(String rootKey)
    • evict

      private void evict(String rootKey, org.apache.hc.core5.http.HttpResponse response)
    • evictInvalidatedEntries

      public void evictInvalidatedEntries(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse response)
      Description copied from interface: HttpCache
      Evicts HttpCacheEntrys invalidated by the given message exchange.
      Specified by:
      evictInvalidatedEntries in interface HttpCache