blob: 280f15265ae37c69b60631966c2d95cd39a3e497 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_22) on Sun Oct 21 11:03:15 GMT+01:00 2012 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
org.apache.http.client.cache (HttpComponents Client 4.2.2 API)
</TITLE>
<META NAME="keywords" CONTENT="org.apache.http.client.cache package">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="org.apache.http.client.cache (HttpComponents Client 4.2.2 API)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/http/client/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/http/client/entity/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/http/client/cache/package-summary.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<H2>
Package org.apache.http.client.cache
</H2>
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).
<P>
<B>See:</B>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="#package_description"><B>Description</B></A>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Interface Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/http/client/cache/HttpCacheEntrySerializer.html" title="interface in org.apache.http.client.cache">HttpCacheEntrySerializer</A></B></TD>
<TD>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.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/http/client/cache/HttpCacheStorage.html" title="interface in org.apache.http.client.cache">HttpCacheStorage</A></B></TD>
<TD>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.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/http/client/cache/HttpCacheUpdateCallback.html" title="interface in org.apache.http.client.cache">HttpCacheUpdateCallback</A></B></TD>
<TD>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.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/http/client/cache/Resource.html" title="interface in org.apache.http.client.cache">Resource</A></B></TD>
<TD>Represents a disposable system resource used for handling
cached response bodies.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/http/client/cache/ResourceFactory.html" title="interface in org.apache.http.client.cache">ResourceFactory</A></B></TD>
<TD>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.</TD>
</TR>
</TABLE>
&nbsp;
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/http/client/cache/HeaderConstants.html" title="class in org.apache.http.client.cache">HeaderConstants</A></B></TD>
<TD>Records static constants for various HTTP header names.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/http/client/cache/HttpCacheEntry.html" title="class in org.apache.http.client.cache">HttpCacheEntry</A></B></TD>
<TD>Structure used to store an <A HREF="http://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/HttpResponse.html" title="class or interface in org.apache.http"><CODE>HttpResponse</CODE></A> in a cache.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/http/client/cache/InputLimit.html" title="class in org.apache.http.client.cache">InputLimit</A></B></TD>
<TD>Used to limiting the size of an incoming response body of
unknown size that is optimistically being read in anticipation
of caching it.</TD>
</TR>
</TABLE>
&nbsp;
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Enum Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/http/client/cache/CacheResponseStatus.html" title="enum in org.apache.http.client.cache">CacheResponseStatus</A></B></TD>
<TD>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 <A HREF="http://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/protocol/HttpContext.html" title="class or interface in org.apache.http.protocol"><CODE>HttpContext</CODE></A>
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>.</TD>
</TR>
</TABLE>
&nbsp;
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Exception Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/http/client/cache/HttpCacheEntrySerializationException.html" title="class in org.apache.http.client.cache">HttpCacheEntrySerializationException</A></B></TD>
<TD>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.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="../../../../../org/apache/http/client/cache/HttpCacheUpdateException.html" title="class in org.apache.http.client.cache">HttpCacheUpdateException</A></B></TD>
<TD>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.</TD>
</TR>
</TABLE>
&nbsp;
<P>
<A NAME="package_description"><!-- --></A><H2>
Package org.apache.http.client.cache Description
</H2>
<P>
<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 <A HREF="http://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/protocol/HttpContext.html" title="class or interface in org.apache.http.protocol"><CODE>HttpContext</CODE></A> 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>
<P>
<P>
<DL>
</DL>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/http/client/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/http/client/entity/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/http/client/cache/package-summary.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright &#169; 1999-2012 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>