You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

316 lines
16 KiB

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_80) on Wed Nov 30 19:45:05 CET 2022 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.apache.http.client.cache (Apache HttpComponents Client 4.5.14 API)</title>
<meta name="date" content="2022-11-30">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="org.apache.http.client.cache (Apache HttpComponents Client 4.5.14 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/http/client/package-summary.html">Prev Package</a></li>
<li><a href="../../../../../org/apache/http/client/config/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/http/client/cache/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package&nbsp;org.apache.http.client.cache</h1>
<div class="docSummary">
<div class="block">
This package consists largely of constants and interfaces that are
necessary for building new storage backends for the
<a href="../../../../../org/apache/http/impl/client/cache/CachingHttpClient.html" title="class in org.apache.http.impl.client.cache"><code>CachingHttpClient</code></a> or for
those clients wanting to get a little more behavioral information
out of the cache module (for example, whether a particular response
was a cache hit or not).</div>
</div>
<p>See:&nbsp;<a href="#package_description">Description</a></p>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation">
<caption><span>Interface Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Interface</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../org/apache/http/client/cache/HttpCacheEntrySerializer.html" title="interface in org.apache.http.client.cache">HttpCacheEntrySerializer</a></td>
<td class="colLast">
<div class="block">Used by some <a href="../../../../../org/apache/http/client/cache/HttpCacheStorage.html" title="interface in org.apache.http.client.cache"><code>HttpCacheStorage</code></a> implementations to serialize
<a href="../../../../../org/apache/http/client/cache/HttpCacheEntry.html" title="class in org.apache.http.client.cache"><code>HttpCacheEntry</code></a> instances to a byte representation before
storage.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../org/apache/http/client/cache/HttpCacheInvalidator.html" title="interface in org.apache.http.client.cache">HttpCacheInvalidator</a></td>
<td class="colLast">
<div class="block">Given a particular HttpRequest, flush any cache entries that this request
would invalidate.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../org/apache/http/client/cache/HttpCacheStorage.html" title="interface in org.apache.http.client.cache">HttpCacheStorage</a></td>
<td class="colLast">
<div class="block">New storage backends should implement this <a href="../../../../../org/apache/http/client/cache/HttpCacheStorage.html" title="interface in org.apache.http.client.cache"><code>HttpCacheStorage</code></a>
interface.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../org/apache/http/client/cache/HttpCacheUpdateCallback.html" title="interface in org.apache.http.client.cache">HttpCacheUpdateCallback</a></td>
<td class="colLast">
<div class="block">Used for atomically updating entries in a <a href="../../../../../org/apache/http/client/cache/HttpCacheStorage.html" title="interface in org.apache.http.client.cache"><code>HttpCacheStorage</code></a>
implementation.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../org/apache/http/client/cache/Resource.html" title="interface in org.apache.http.client.cache">Resource</a></td>
<td class="colLast">
<div class="block">Represents a disposable system resource used for handling
cached response bodies.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../org/apache/http/client/cache/ResourceFactory.html" title="interface in org.apache.http.client.cache">ResourceFactory</a></td>
<td class="colLast">
<div class="block">Generates <a href="../../../../../org/apache/http/client/cache/Resource.html" title="interface in org.apache.http.client.cache"><code>Resource</code></a> instances for handling cached
HTTP response bodies.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../org/apache/http/client/cache/HeaderConstants.html" title="class in org.apache.http.client.cache">HeaderConstants</a></td>
<td class="colLast">
<div class="block">Records static constants for various HTTP header names.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../org/apache/http/client/cache/HttpCacheContext.html" title="class in org.apache.http.client.cache">HttpCacheContext</a></td>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../org/apache/http/client/cache/HttpCacheEntry.html" title="class in org.apache.http.client.cache">HttpCacheEntry</a></td>
<td class="colLast">
<div class="block">Structure used to store an <code>HttpResponse</code> in a cache.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../org/apache/http/client/cache/InputLimit.html" title="class in org.apache.http.client.cache">InputLimit</a></td>
<td class="colLast">
<div class="block">Used to limiting the size of an incoming response body of
unknown size that is optimistically being read in anticipation
of caching it.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Summary table, listing enums, and an explanation">
<caption><span>Enum Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Enum</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../org/apache/http/client/cache/CacheResponseStatus.html" title="enum in org.apache.http.client.cache">CacheResponseStatus</a></td>
<td class="colLast">
<div class="block">This enumeration represents the various ways a response can be generated
by the <a href="../../../../../org/apache/http/impl/client/cache/CachingHttpClient.html" title="class in org.apache.http.impl.client.cache"><code>CachingHttpClient</code></a>;
if a request is executed with an <code>HttpContext</code>
then a parameter with one of these values will be registered in the
context under the key
<a href="../../../../../org/apache/http/impl/client/cache/CachingHttpClient.html#CACHE_RESPONSE_STATUS"><code>CachingHttpClient.CACHE_RESPONSE_STATUS</code></a>.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Exception Summary table, listing exceptions, and an explanation">
<caption><span>Exception Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Exception</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../org/apache/http/client/cache/HttpCacheEntrySerializationException.html" title="class in org.apache.http.client.cache">HttpCacheEntrySerializationException</a></td>
<td class="colLast">
<div class="block">Thrown if serialization or deserialization of an <a href="../../../../../org/apache/http/client/cache/HttpCacheEntry.html" title="class in org.apache.http.client.cache"><code>HttpCacheEntry</code></a>
fails.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../org/apache/http/client/cache/HttpCacheUpdateException.html" title="class in org.apache.http.client.cache">HttpCacheUpdateException</a></td>
<td class="colLast">
<div class="block">Signals that <a href="../../../../../org/apache/http/client/cache/HttpCacheStorage.html" title="interface in org.apache.http.client.cache"><code>HttpCacheStorage</code></a> encountered an error performing an
update operation.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
<a name="package_description">
<!-- -->
</a>
<h2 title="Package org.apache.http.client.cache Description">Package org.apache.http.client.cache Description</h2>
<div class="block"><p>
This package consists largely of constants and interfaces that are
necessary for building new storage backends for the
<a href="../../../../../org/apache/http/impl/client/cache/CachingHttpClient.html" title="class in org.apache.http.impl.client.cache"><code>CachingHttpClient</code></a> or for
those clients wanting to get a little more behavioral information
out of the cache module (for example, whether a particular response
was a cache hit or not). Developers that simply want to instantiate
and make use of the caching module will be better off looking at
the <code>CachingHttpClient</code> documentation itself.
</p>
<p>
The classes in this package can be divided into two main groups:
reference constants and interfaces needed for storage backends. In
the former group,
<a href="../../../../../org/apache/http/client/cache/HeaderConstants.html" title="class in org.apache.http.client.cache"><code>HeaderConstants</code></a> contains a list
of HTTP header names encoded as static fields, and the
<a href="../../../../../org/apache/http/client/cache/CacheResponseStatus.html" title="enum in org.apache.http.client.cache"><code>CacheResponseStatus</code></a> enumeration
values are set in an <code>HttpContext</code> by
the <code>CachingHttpClient</code> to indicate how the request was
processed by the caching module itself.
</p>
<p>
New storage backends will need to implement the
<a href="../../../../../org/apache/http/client/cache/HttpCacheStorage.html" title="interface in org.apache.http.client.cache"><code>HttpCacheStorage</code></a>
interface; they can then be passed to one of the <code>CachingHttpClient</code>
constructors, which will happily make use of the new storage mechanism.
The <a href="../../../../../org/apache/http/client/cache/HttpCacheEntry.html" title="class in org.apache.http.client.cache"><code>HttpCacheEntry</code></a> class shows the
datastructure for a cache entry that must be stored by the
<code>HttpCacheStorage</code>.
There is, in addition, the notion of a
<a href="../../../../../org/apache/http/client/cache/Resource.html" title="interface in org.apache.http.client.cache"><code>Resource</code></a> and an associated
<a href="../../../../../org/apache/http/client/cache/ResourceFactory.html" title="interface in org.apache.http.client.cache"><code>ResourceFactory</code></a>, which are used for
managing the handling of cached response bodies. The default implementation
used by the <code>CachingHttpClient</code> stores response bodies in memory;
alternative implementations might involve storing these in a filesystem. A new
<code>ResourceFactory</code> can be provided along with a <code>HttpCacheStorage</code>
in one of the constructors to the <code>CachingHttpClient</code>. Finally, some
of the additional storage backends we provide, like the
<a href="../../../../../org/apache/http/impl/client/cache/ehcache/EhcacheHttpCacheStorage.html" title="class in org.apache.http.impl.client.cache.ehcache"><code>EhcacheHttpCacheStorage</code></a> and
<a href="../../../../../org/apache/http/impl/client/cache/memcached/MemcachedHttpCacheStorage.html" title="class in org.apache.http.impl.client.cache.memcached"><code>MemcachedHttpCacheStorage</code></a>,
can be provided with different serializers for the cache entry metadata;
developers wanting to experiment with different serialization techniques
should implement the
<a href="../../../../../org/apache/http/client/cache/HttpCacheEntrySerializer.html" title="interface in org.apache.http.client.cache"><code>HttpCacheEntrySerializer</code></a> interface.
</p></div>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/http/client/package-summary.html">Prev Package</a></li>
<li><a href="../../../../../org/apache/http/client/config/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/http/client/cache/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 1999&#x2013;2022 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>