Class BasicHttpAsyncCache

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private org.apache.hc.core5.concurrent.Cancellable evict​(java.lang.String rootKey)  
      private org.apache.hc.core5.concurrent.Cancellable evict​(java.lang.String rootKey, org.apache.hc.core5.http.HttpResponse response)  
      private void evictAll​(HttpCacheEntry root, java.lang.String rootKey)  
      org.apache.hc.core5.concurrent.Cancellable evictInvalidatedEntries​(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.concurrent.FutureCallback<java.lang.Boolean> callback)
      Evicts HttpCacheEntrys invalidated by the given message exchange.
      org.apache.hc.core5.concurrent.Cancellable getVariants​(CacheHit hit, org.apache.hc.core5.concurrent.FutureCallback<java.util.Collection<CacheHit>> callback)
      Retrieves variant HttpCacheEntrys for the given hit.
      org.apache.hc.core5.concurrent.Cancellable match​(org.apache.hc.core5.http.HttpHost host, org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.concurrent.FutureCallback<CacheMatch> callback)
      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.
      private void removeInternal​(java.lang.String cacheKey)  
      (package private) org.apache.hc.core5.concurrent.Cancellable store​(java.lang.String rootKey, java.lang.String variantKey, HttpCacheEntry entry, org.apache.hc.core5.concurrent.FutureCallback<CacheHit> callback)  
      org.apache.hc.core5.concurrent.Cancellable 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, org.apache.hc.core5.concurrent.FutureCallback<CacheHit> callback)
      Stores HttpRequest / HttpResponse exchange details in the cache.
      org.apache.hc.core5.concurrent.Cancellable 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, org.apache.hc.core5.concurrent.FutureCallback<CacheHit> callback)
      Stores HttpRequest / HttpResponse exchange details in the cache from the negotiated HttpCacheEntry.
      (package private) org.apache.hc.core5.concurrent.Cancellable storeInternal​(java.lang.String cacheKey, HttpCacheEntry entry, org.apache.hc.core5.concurrent.FutureCallback<java.lang.Boolean> callback)  
      org.apache.hc.core5.concurrent.Cancellable 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, org.apache.hc.core5.concurrent.FutureCallback<CacheHit> callback)
      Updates HttpCacheEntry using details from a 304 HttpResponse and updates the root entry if the given cache entry represents a variant.
      (package private) org.apache.hc.core5.concurrent.Cancellable updateInternal​(java.lang.String cacheKey, HttpCacheCASOperation casOperation, org.apache.hc.core5.concurrent.FutureCallback<java.lang.Boolean> callback)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • match

        public org.apache.hc.core5.concurrent.Cancellable match​(org.apache.hc.core5.http.HttpHost host,
                                                                org.apache.hc.core5.http.HttpRequest request,
                                                                org.apache.hc.core5.concurrent.FutureCallback<CacheMatch> callback)
        Description copied from interface: HttpAsyncCache
        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 HttpAsyncCache
      • storeInternal

        org.apache.hc.core5.concurrent.Cancellable storeInternal​(java.lang.String cacheKey,
                                                                 HttpCacheEntry entry,
                                                                 org.apache.hc.core5.concurrent.FutureCallback<java.lang.Boolean> callback)
      • updateInternal

        org.apache.hc.core5.concurrent.Cancellable updateInternal​(java.lang.String cacheKey,
                                                                  HttpCacheCASOperation casOperation,
                                                                  org.apache.hc.core5.concurrent.FutureCallback<java.lang.Boolean> callback)
      • removeInternal

        private void removeInternal​(java.lang.String cacheKey)
      • store

        org.apache.hc.core5.concurrent.Cancellable store​(java.lang.String rootKey,
                                                         java.lang.String variantKey,
                                                         HttpCacheEntry entry,
                                                         org.apache.hc.core5.concurrent.FutureCallback<CacheHit> callback)
      • store

        public org.apache.hc.core5.concurrent.Cancellable 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,
                                                                org.apache.hc.core5.concurrent.FutureCallback<CacheHit> callback)
        Description copied from interface: HttpAsyncCache
        Stores HttpRequest / HttpResponse exchange details in the cache.
        Specified by:
        store in interface HttpAsyncCache
      • update

        public org.apache.hc.core5.concurrent.Cancellable 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,
                                                                 org.apache.hc.core5.concurrent.FutureCallback<CacheHit> callback)
        Description copied from interface: HttpAsyncCache
        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 HttpAsyncCache
      • storeFromNegotiated

        public org.apache.hc.core5.concurrent.Cancellable 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,
                                                                              org.apache.hc.core5.concurrent.FutureCallback<CacheHit> callback)
        Description copied from interface: HttpAsyncCache
        Stores HttpRequest / HttpResponse exchange details in the cache from the negotiated HttpCacheEntry.
        Specified by:
        storeFromNegotiated in interface HttpAsyncCache
      • evictAll

        private void evictAll​(HttpCacheEntry root,
                              java.lang.String rootKey)
      • evict

        private org.apache.hc.core5.concurrent.Cancellable evict​(java.lang.String rootKey)
      • evict

        private org.apache.hc.core5.concurrent.Cancellable evict​(java.lang.String rootKey,
                                                                 org.apache.hc.core5.http.HttpResponse response)
      • evictInvalidatedEntries

        public org.apache.hc.core5.concurrent.Cancellable evictInvalidatedEntries​(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.concurrent.FutureCallback<java.lang.Boolean> callback)
        Description copied from interface: HttpAsyncCache
        Evicts HttpCacheEntrys invalidated by the given message exchange.
        Specified by:
        evictInvalidatedEntries in interface HttpAsyncCache