| Modifier and Type | Field and Description |
|---|---|
| private static ResponseCache | theResponseCache
The system wide cache that provides access to a url caching mechanism. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract CacheResponse | Returns: aCacheResponse instance if available
from cache, or null otherwisea uri, String URI used to reference the requested
network resourcea rqstMethod, Map<String, List<String>> String representing the request
methoda Map from request header
field names to lists of field values representing
the current request headers rqstHeaders)Retrieve the cached response based on the requesting uri, request method and request headers. |
| public static synchronized ResponseCache | |
| public abstract CacheRequest | Returns: aCacheRequest for recording the
response to be cached. Null return indicates that
the caller does not intend to cache the response.a uri, URLConnection URI used to reference the requested
network resourcea URLConnection instance that is used to fetch
the response to be cached conn)The protocol handler calls this method after a resource has been retrieved, and the ResponseCache must decide whether or not to store the resource in its cache. |
| public static synchronized void | setDefault(ResponseCache
The response cache, or
responseCache)null to unset the cache.Sets (or unsets) the system-wide cache. |
| theResponseCache | back to summary |
|---|---|
| private static ResponseCache theResponseCache The system wide cache that provides access to a url caching mechanism.
| |
| ResponseCache | back to summary |
|---|---|
| public ResponseCache() Constructor for subclasses to call. | |
| get | back to summary |
|---|---|
| public abstract CacheResponse get(URI uri, String rqstMethod, Map<String, List<String>> rqstHeaders) throws IOException Retrieve the cached response based on the requesting uri, request method and request headers. Typically this method is called by the protocol handler before it sends out the request to get the network resource. If a cached response is returned, that resource is used instead.
| |
| getDefault | back to summary |
|---|---|
| public static synchronized ResponseCache getDefault() Gets the system-wide response cache.
| |
| put | back to summary |
|---|---|
| public abstract CacheRequest put(URI uri, URLConnection conn) throws IOException The protocol handler calls this method after a resource has been retrieved, and the ResponseCache must decide whether or not to store the resource in its cache. If the resource is to be cached, then put() must return a CacheRequest object which contains an OutputStream that the protocol handler will use to write the resource into the cache. If the resource is not to be cached, then put must return null.
| |
| setDefault | back to summary |
|---|---|
| public static synchronized void setDefault(ResponseCache responseCache) Sets (or unsets) the system-wide cache. Note non-standard protocol handlers may ignore this setting.
| |