@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 |
---|---|
org.apache.hc.core5.concurrent.Cancellable |
getEntries(Collection<String> keys,
org.apache.hc.core5.concurrent.FutureCallback<Map<String,HttpCacheEntry>> callback)
Retrieves multiple cache entries stored under the given keys.
|
org.apache.hc.core5.concurrent.Cancellable |
getEntry(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(String key,
HttpCacheEntry entry,
org.apache.hc.core5.concurrent.FutureCallback<Boolean> callback)
Store a given cache entry under the given key.
|
org.apache.hc.core5.concurrent.Cancellable |
removeEntry(String key,
org.apache.hc.core5.concurrent.FutureCallback<Boolean> callback)
Deletes/invalidates/removes any cache entries currently
stored under the given key.
|
org.apache.hc.core5.concurrent.Cancellable |
updateEntry(String key,
HttpCacheCASOperation casOperation,
org.apache.hc.core5.concurrent.FutureCallback<Boolean> callback)
Atomically applies the given callback to processChallenge an existing cache
entry under a given key.
|
public HttpAsyncCacheStorageAdaptor(HttpCacheStorage cacheStorage)
public org.apache.hc.core5.concurrent.Cancellable putEntry(String key, HttpCacheEntry entry, org.apache.hc.core5.concurrent.FutureCallback<Boolean> callback)
HttpAsyncCacheStorage
putEntry
in interface HttpAsyncCacheStorage
key
- where in the cache to store the entryentry
- cached response to storecallback
- result callbackpublic org.apache.hc.core5.concurrent.Cancellable getEntry(String key, org.apache.hc.core5.concurrent.FutureCallback<HttpCacheEntry> callback)
HttpAsyncCacheStorage
getEntry
in interface HttpAsyncCacheStorage
key
- cache keycallback
- result callbackHttpCacheEntry
or null
if no
entry existspublic org.apache.hc.core5.concurrent.Cancellable removeEntry(String key, org.apache.hc.core5.concurrent.FutureCallback<Boolean> callback)
HttpAsyncCacheStorage
removeEntry
in interface HttpAsyncCacheStorage
callback
- result callbackpublic org.apache.hc.core5.concurrent.Cancellable updateEntry(String key, HttpCacheCASOperation casOperation, org.apache.hc.core5.concurrent.FutureCallback<Boolean> callback)
HttpAsyncCacheStorage
updateEntry
in interface HttpAsyncCacheStorage
key
- indicates which entry to modifycasOperation
- the CAS operation to perform.callback
- result callbackpublic org.apache.hc.core5.concurrent.Cancellable getEntries(Collection<String> keys, org.apache.hc.core5.concurrent.FutureCallback<Map<String,HttpCacheEntry>> callback)
HttpAsyncCacheStorage
getEntries
in interface HttpAsyncCacheStorage
keys
- cache keyscallback
- result callbackCopyright © 2010–2021 The Apache Software Foundation. All rights reserved.