public abstract class AbstractSerializingAsyncCacheStorage<T,CAS> extends Object implements HttpAsyncCacheStorage
| Constructor and Description |
|---|
AbstractSerializingAsyncCacheStorage(int maxUpdateRetries,
HttpCacheEntrySerializer<T> serializer) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Cancellable |
bulkRestore(Collection<String> storageKeys,
FutureCallback<Map<String,T>> callback) |
protected abstract Cancellable |
delete(String storageKey,
FutureCallback<Boolean> callback) |
protected abstract String |
digestToStorageKey(String key) |
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.
|
protected abstract Cancellable |
getForUpdateCAS(String storageKey,
FutureCallback<CAS> callback) |
protected abstract T |
getStorageObject(CAS cas) |
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.
|
protected abstract Cancellable |
restore(String storageKey,
FutureCallback<T> callback) |
protected abstract Cancellable |
store(String storageKey,
T storageObject,
FutureCallback<Boolean> callback) |
protected abstract Cancellable |
updateCAS(String storageKey,
CAS cas,
T storageObject,
FutureCallback<Boolean> callback) |
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 AbstractSerializingAsyncCacheStorage(int maxUpdateRetries,
HttpCacheEntrySerializer<T> serializer)
protected abstract T getStorageObject(CAS cas) throws ResourceIOException
ResourceIOExceptionprotected abstract Cancellable store(String storageKey, T storageObject, FutureCallback<Boolean> callback)
protected abstract Cancellable restore(String storageKey, FutureCallback<T> callback)
protected abstract Cancellable getForUpdateCAS(String storageKey, FutureCallback<CAS> callback)
protected abstract Cancellable updateCAS(String storageKey, CAS cas, T storageObject, FutureCallback<Boolean> callback)
protected abstract Cancellable delete(String storageKey, FutureCallback<Boolean> callback)
protected abstract Cancellable bulkRestore(Collection<String> storageKeys, FutureCallback<Map<String,T>> callback)
public final 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 final Cancellable getEntry(String key, FutureCallback<HttpCacheEntry> callback)
HttpAsyncCacheStoragegetEntry in interface HttpAsyncCacheStoragekey - cache keycallback - result callbackHttpCacheEntry or null if no
entry existspublic final Cancellable removeEntry(String key, FutureCallback<Boolean> callback)
HttpAsyncCacheStorageremoveEntry in interface HttpAsyncCacheStoragecallback - result callbackpublic final 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 final 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.