@Contract(threading=SAFE_CONDITIONAL) public final class HttpAsyncCacheStorageAdaptor extends Object implements HttpAsyncCacheStorage
HttpAsyncCacheStorage implementation that emulates asynchronous
behavior using an instance of classic HttpCacheStorage.| Constructor and Description |
|---|
HttpAsyncCacheStorageAdaptor(HttpCacheStorage cacheStorage) |
| 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.
|
public HttpAsyncCacheStorageAdaptor(HttpCacheStorage cacheStorage)
public Cancellable putEntry(String key, HttpCacheEntry entry, FutureCallback<Boolean> callback)
HttpAsyncCacheStorageputEntry in interface HttpAsyncCacheStoragekey - where in the cache to store the entryentry - cached response to storecallback - result callbackpublic Cancellable getEntry(String key, FutureCallback<HttpCacheEntry> callback)
HttpAsyncCacheStoragegetEntry in interface HttpAsyncCacheStoragekey - cache keycallback - result callbackHttpCacheEntry or null if no
entry existspublic Cancellable removeEntry(String key, FutureCallback<Boolean> callback)
HttpAsyncCacheStorageremoveEntry in interface HttpAsyncCacheStoragecallback - result callbackpublic Cancellable updateEntry(String key, HttpCacheCASOperation casOperation, FutureCallback<Boolean> callback)
HttpAsyncCacheStorageupdateEntry in interface HttpAsyncCacheStoragekey - indicates which entry to modifycasOperation - the CAS operation to perform.callback - result callbackpublic Cancellable getEntries(Collection<String> keys, FutureCallback<Map<String,HttpCacheEntry>> callback)
HttpAsyncCacheStoragegetEntries in interface HttpAsyncCacheStoragekeys - cache keyscallback - result callbackCopyright © 1999–2021 The Apache Software Foundation. All rights reserved.