Class BasicHttpCache

  • All Implemented Interfaces:
    HttpCache

    class BasicHttpCache
    extends java.lang.Object
    implements HttpCache
    • Method Detail

      • storeInternal

        void storeInternal​(java.lang.String cacheKey,
                           HttpCacheEntry entry)
      • updateInternal

        void updateInternal​(java.lang.String cacheKey,
                            HttpCacheCASOperation casOperation)
      • getInternal

        HttpCacheEntry getInternal​(java.lang.String cacheKey)
      • removeInternal

        private void removeInternal​(java.lang.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
      • 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,
                              java.time.Instant requestSent,
                              java.time.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,
                               java.time.Instant requestSent,
                               java.time.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,
                                            java.time.Instant requestSent,
                                            java.time.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,
                              java.lang.String rootKey)
      • evict

        private void evict​(java.lang.String rootKey)
      • evict

        private void evict​(java.lang.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