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

    • generateKey

      public String generateKey(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, HttpCacheEntry cacheEntry)
      Specified by:
      generateKey in interface HttpCache
    • flushCacheEntriesFor

      public void flushCacheEntriesFor(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request)
      Description copied from interface: HttpCache
      Clear all matching HttpCacheEntrys.
      Specified by:
      flushCacheEntriesFor in interface HttpCache
    • flushCacheEntriesInvalidatedByRequest

      public void flushCacheEntriesInvalidatedByRequest(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request)
      Description copied from interface: HttpCache
      Flush HttpCacheEntrys invalidated by the given request
      Specified by:
      flushCacheEntriesInvalidatedByRequest in interface HttpCache
    • 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)
      Description copied from interface: HttpCache
      Flush HttpCacheEntrys invalidated by the given message exchange.
      Specified by:
      flushCacheEntriesInvalidatedByExchange in interface HttpCache
    • storeInCache

      void storeInCache(String cacheKey, org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, HttpCacheEntry entry)
    • storeEntry

      void storeEntry(String cacheKey, HttpCacheEntry entry)
    • storeVariantEntry

      void storeVariantEntry(String cacheKey, org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest req, HttpCacheEntry entry)
    • reuseVariantEntryFor

      public void reuseVariantEntryFor(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, Variant variant)
      Description copied from interface: HttpCache
      Specifies cache should reuse the given cached variant to satisfy requests whose varying headers match those of the given client request.
      Specified by:
      reuseVariantEntryFor in interface HttpCache
    • updateCacheEntry

      public HttpCacheEntry updateCacheEntry(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, HttpCacheEntry stale, org.apache.hc.core5.http.HttpResponse originResponse, Instant requestSent, Instant responseReceived)
      Description copied from interface: HttpCache
      Update a HttpCacheEntry using a 304 HttpResponse.
      Specified by:
      updateCacheEntry in interface HttpCache
    • updateVariantCacheEntry

      public HttpCacheEntry updateVariantCacheEntry(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.HttpResponse originResponse, Variant variant, Instant requestSent, Instant responseReceived)
      Description copied from interface: HttpCache
      Update a specific HttpCacheEntry representing a cached variant using a 304 HttpResponse.
      Specified by:
      updateVariantCacheEntry in interface HttpCache
    • createCacheEntry

      public HttpCacheEntry createCacheEntry(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
      Store a HttpResponse in the cache if possible, and return
      Specified by:
      createCacheEntry in interface HttpCache
    • getCacheEntry

      public HttpCacheEntry getCacheEntry(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request)
      Description copied from interface: HttpCache
      Retrieve matching HttpCacheEntry from the cache if it exists.
      Specified by:
      getCacheEntry in interface HttpCache
    • getVariantCacheEntriesWithEtags

      public Map<String,Variant> getVariantCacheEntriesWithEtags(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request)
      Description copied from interface: HttpCache
      Retrieve all variants from the cache, if there are no variants then an empty Map is returned
      Specified by:
      getVariantCacheEntriesWithEtags in interface HttpCache