public interface HttpCacheStorage
HttpCacheStorage
interface. They can then be plugged into the existing
CachingHttpClient
implementation.| Modifier and Type | Method and Description |
|---|---|
HttpCacheEntry |
getEntry(String key)
Retrieves the cache entry stored under the given key
or null if no entry exists under that key.
|
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.
|
void |
updateEntry(String key,
HttpCacheUpdateCallback callback)
Atomically applies the given callback to update an existing cache
entry under a given key.
|
void putEntry(String key, HttpCacheEntry entry) throws IOException
key - where in the cache to store the entryentry - cached response to storeIOExceptionHttpCacheEntry getEntry(String key) throws IOException
key - cache keyHttpCacheEntry or null if no
entry existsIOExceptionvoid removeEntry(String key) throws IOException
key - IOExceptionvoid updateEntry(String key, HttpCacheUpdateCallback callback) throws IOException, HttpCacheUpdateException
key - indicates which entry to modifycallback - performs the update; see
HttpCacheUpdateCallback for details, but roughly the
callback expects to be handed the current entry and will return
the new value for the entry.IOExceptionHttpCacheUpdateExceptionCopyright © 1999–2022 The Apache Software Foundation. All rights reserved.