public abstract class AbstractSerializingCacheStorage<T,CAS> extends Object implements HttpCacheStorage
| Constructor and Description |
|---|
AbstractSerializingCacheStorage(int maxUpdateRetries,
HttpCacheEntrySerializer<T> serializer) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Map<String,T> |
bulkRestore(Collection<String> storageKeys) |
protected abstract void |
delete(String storageKey) |
protected abstract String |
digestToStorageKey(String key) |
Map<String,HttpCacheEntry> |
getEntries(Collection<String> keys)
Retrieves multiple cache entries stored under the given keys.
|
HttpCacheEntry |
getEntry(String key)
Retrieves the cache entry stored under the given key
or null if no entry exists under that key.
|
protected abstract CAS |
getForUpdateCAS(String storageKey) |
protected abstract T |
getStorageObject(CAS cas) |
void |
putEntry(String key,
HttpCacheEntry entry)
Store a given cache entry under the given key.
|
void |
removeEntry(String key)
Deletes/invalidates/removes any cache entries currently
stored under the given key.
|
protected abstract T |
restore(String storageKey) |
protected abstract void |
store(String storageKey,
T storageObject) |
protected abstract boolean |
updateCAS(String storageKey,
CAS cas,
T storageObject) |
void |
updateEntry(String key,
HttpCacheCASOperation casOperation)
Atomically applies the given callback to processChallenge an existing cache
entry under a given key.
|
public AbstractSerializingCacheStorage(int maxUpdateRetries,
HttpCacheEntrySerializer<T> serializer)
protected abstract void store(String storageKey, T storageObject) throws ResourceIOException
ResourceIOExceptionprotected abstract T restore(String storageKey) throws ResourceIOException
ResourceIOExceptionprotected abstract CAS getForUpdateCAS(String storageKey) throws ResourceIOException
ResourceIOExceptionprotected abstract T getStorageObject(CAS cas) throws ResourceIOException
ResourceIOExceptionprotected abstract boolean updateCAS(String storageKey, CAS cas, T storageObject) throws ResourceIOException
ResourceIOExceptionprotected abstract void delete(String storageKey) throws ResourceIOException
ResourceIOExceptionprotected abstract Map<String,T> bulkRestore(Collection<String> storageKeys) throws ResourceIOException
ResourceIOExceptionpublic final void putEntry(String key, HttpCacheEntry entry) throws ResourceIOException
HttpCacheStorageputEntry in interface HttpCacheStoragekey - where in the cache to store the entryentry - cached response to storeResourceIOExceptionpublic final HttpCacheEntry getEntry(String key) throws ResourceIOException
HttpCacheStoragegetEntry in interface HttpCacheStoragekey - cache keyHttpCacheEntry or null if no
entry existsResourceIOExceptionpublic final void removeEntry(String key) throws ResourceIOException
HttpCacheStorageremoveEntry in interface HttpCacheStorageResourceIOExceptionpublic final void updateEntry(String key, HttpCacheCASOperation casOperation) throws HttpCacheUpdateException, ResourceIOException
HttpCacheStorageupdateEntry in interface HttpCacheStoragekey - indicates which entry to modifycasOperation - the CAS operation to perform.HttpCacheUpdateExceptionResourceIOExceptionpublic final Map<String,HttpCacheEntry> getEntries(Collection<String> keys) throws ResourceIOException
HttpCacheStoragegetEntries in interface HttpCacheStoragekeys - cache keysHttpCacheEntrys.ResourceIOExceptionCopyright © 1999–2021 The Apache Software Foundation. All rights reserved.