public interface

HttpCacheStorage

org.apache.http.client.cache.HttpCacheStorage
Known Indirect Subclasses

Class Overview

New storage backends should implement this HttpCacheStorage interface. They can then be plugged into the existing CachingHttpClient implementation.

Summary

Public Methods
abstract HttpCacheEntry getEntry(String key)
Retrieves the cache entry stored under the given key or null if no entry exists under that key.
abstract void putEntry(String key, HttpCacheEntry entry)
Store a given cache entry under the given key.
abstract void removeEntry(String key)
Deletes/invalidates/removes any cache entries currently stored under the given key.
abstract void updateEntry(String key, HttpCacheUpdateCallback callback)
Atomically applies the given callback to update an existing cache entry under a given key.

Public Methods

public abstract HttpCacheEntry getEntry (String key)

Retrieves the cache entry stored under the given key or null if no entry exists under that key.

Parameters
key cache key
Returns
Throws
IOException

public abstract void putEntry (String key, HttpCacheEntry entry)

Store a given cache entry under the given key.

Parameters
key where in the cache to store the entry
entry cached response to store
Throws
IOException

public abstract void removeEntry (String key)

Deletes/invalidates/removes any cache entries currently stored under the given key.

Throws
IOException

public abstract void updateEntry (String key, HttpCacheUpdateCallback callback)

Atomically applies the given callback to update an existing cache entry under a given key.

Parameters
key indicates which entry to modify
callback 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.