Interface HttpAsyncCacheStorage

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      org.apache.hc.core5.concurrent.Cancellable getEntries​(java.util.Collection<java.lang.String> keys, org.apache.hc.core5.concurrent.FutureCallback<java.util.Map<java.lang.String,​HttpCacheEntry>> callback)
      Retrieves multiple cache entries stored under the given keys.
      org.apache.hc.core5.concurrent.Cancellable getEntry​(java.lang.String key, org.apache.hc.core5.concurrent.FutureCallback<HttpCacheEntry> callback)
      Retrieves the cache entry stored under the given key or null if no entry exists under that key.
      org.apache.hc.core5.concurrent.Cancellable putEntry​(java.lang.String key, HttpCacheEntry entry, org.apache.hc.core5.concurrent.FutureCallback<java.lang.Boolean> callback)
      Store a given cache entry under the given key.
      org.apache.hc.core5.concurrent.Cancellable removeEntry​(java.lang.String key, org.apache.hc.core5.concurrent.FutureCallback<java.lang.Boolean> callback)
      Deletes/invalidates/removes any cache entries currently stored under the given key.
      org.apache.hc.core5.concurrent.Cancellable updateEntry​(java.lang.String key, HttpCacheCASOperation casOperation, org.apache.hc.core5.concurrent.FutureCallback<java.lang.Boolean> callback)
      Atomically applies the given callback to processChallenge an existing cache entry under a given key.
    • Method Detail

      • putEntry

        org.apache.hc.core5.concurrent.Cancellable putEntry​(java.lang.String key,
                                                            HttpCacheEntry entry,
                                                            org.apache.hc.core5.concurrent.FutureCallback<java.lang.Boolean> callback)
        Store a given cache entry under the given key.
        Parameters:
        key - where in the cache to store the entry
        entry - cached response to store
        callback - result callback
      • getEntry

        org.apache.hc.core5.concurrent.Cancellable getEntry​(java.lang.String key,
                                                            org.apache.hc.core5.concurrent.FutureCallback<HttpCacheEntry> callback)
        Retrieves the cache entry stored under the given key or null if no entry exists under that key.
        Parameters:
        key - cache key
        callback - result callback
        Returns:
        an HttpCacheEntry or null if no entry exists
      • removeEntry

        org.apache.hc.core5.concurrent.Cancellable removeEntry​(java.lang.String key,
                                                               org.apache.hc.core5.concurrent.FutureCallback<java.lang.Boolean> callback)
        Deletes/invalidates/removes any cache entries currently stored under the given key.
        Parameters:
        key -
        callback - result callback
      • updateEntry

        org.apache.hc.core5.concurrent.Cancellable updateEntry​(java.lang.String key,
                                                               HttpCacheCASOperation casOperation,
                                                               org.apache.hc.core5.concurrent.FutureCallback<java.lang.Boolean> callback)
        Atomically applies the given callback to processChallenge an existing cache entry under a given key.
        Parameters:
        key - indicates which entry to modify
        casOperation - the CAS operation to perform.
        callback - result callback
      • getEntries

        org.apache.hc.core5.concurrent.Cancellable getEntries​(java.util.Collection<java.lang.String> keys,
                                                              org.apache.hc.core5.concurrent.FutureCallback<java.util.Map<java.lang.String,​HttpCacheEntry>> callback)
        Retrieves multiple cache entries stored under the given keys. Some implementations may use a single bulk operation to do the retrieval.
        Parameters:
        keys - cache keys
        callback - result callback