org.apache.hc.client5.http.cache

## Interface HttpAsyncCacheStorage

- All Known Implementing Classes:
    AbstractBinaryAsyncCacheStorage, AbstractSerializingAsyncCacheStorage, HttpAsyncCacheStorageAdaptor, MemcachedHttpAsyncCacheStorage

      @Contract(threading=SAFE)
      public interface HttpAsyncCacheStorage

  HttpAsyncCacheStorage represents an abstract HTTP cache storage backend that can then be plugged into the asynchronous (non-blocking ) request execution pipeline.

  Implementations of this interface are expected to be threading-safe.

  Since:
    5.0

- - ### Method Summary

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

- - ### Method Detail

    - #### putEntry

          Cancellable putEntry(String key,
                               HttpCacheEntry entry,
                               FutureCallback<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

          Cancellable getEntry(String key,
                               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

          Cancellable removeEntry(String key,
                                  FutureCallback<Boolean> callback)

      Deletes/invalidates/removes any cache entries currently stored under the given key.
      Parameters:
        `key` -
        `callback` - result callback

    - #### updateEntry

          Cancellable updateEntry(String key,
                                  HttpCacheCASOperation casOperation,
                                  FutureCallback<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

          Cancellable getEntries(Collection<String> keys,
                                 FutureCallback<Map<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

Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.