<!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.6.0-google-internal) on Fri Apr 23 12:07:50 CDT 2010 --> <TITLE> MemcacheService </TITLE> <META NAME="date" CONTENT="2010-04-23"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../dev_javadoc.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="MemcacheService"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= 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> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheSerialization.ValueAndFlags.html" title="class in com.google.appengine.api.memcache"><B>PREV CLASS</B></A> <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.SetPolicy.html" title="enum in com.google.appengine.api.memcache"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/google/appengine/api/memcache/MemcacheService.html" target="_top"><B>FRAMES</B></A> <A HREF="MemcacheService.html" target="_top"><B>NO FRAMES</B></A> <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> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> com.google.appengine.api.memcache</FONT> <BR> Interface MemcacheService</H2> <HR> <DL> <DT><PRE>public interface <B>MemcacheService</B></DL> </PRE> <P> The Java API for the App Engine Memcache service. This offers a fast distrubted cache for commonly-used data. The cache is limited both in duration and also in total space, so objects stored in it may be discarded at any time. <p> Note that <code>null</code> is a legal value to store in the cache, or to use as a cache key. Although the API is written for <CODE>Object</CODE>s, both keys and values should be <CODE>Serializable</CODE>, although future versions may someday accept specific types of non-<code>Serializable</code> <code>Objects</code>. <p> The values returned from this API are mutable copies from the cache; altering them has no effect upon the cached value itself until assigned with one of the <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#put(java.lang.Object, java.lang.Object)"><CODE>put</CODE></A> methods. Likewise, the methods returning collections return mutable collections, but changes do not affect the cache. <p> Except for the <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#increment(java.lang.Object, long)"><CODE>increment(java.lang.Object, long)</CODE></A> method, this service does not offer atomicity guarantees. In particular, the multi-key <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#getAll(java.util.Collection)"><CODE>getAll(java.util.Collection<java.lang.Object>)</CODE></A>, <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#putAll(java.util.Map, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)"><CODE>putAll(java.util.Map<java.lang.Object, java.lang.Object>, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)</CODE></A>, and <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#deleteAll(java.util.Collection)"><CODE>deleteAll(java.util.Collection<java.lang.Object>)</CODE></A> operations are non-atomic. <p> <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#increment(java.lang.Object, long)"><CODE>Increment</CODE></A> has a number of caveats to its use; please consult the method documentation. <P> <P> <HR> <P> <!-- ======== NESTED CLASS SUMMARY ======== --> <A NAME="nested_class_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Nested Class Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static class</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.SetPolicy.html" title="enum in com.google.appengine.api.memcache">MemcacheService.SetPolicy</A></B></CODE> <BR> Cache replacement strategies for <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#put(java.lang.Object, java.lang.Object, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)"><CODE>put(java.lang.Object, java.lang.Object, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)</CODE></A> operations, indicating how to handle putting a value that already exists.</TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#clearAll()">clearAll</A></B>()</CODE> <BR> Empties the cache of all values.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#contains(java.lang.Object)">contains</A></B>(java.lang.Object key)</CODE> <BR> Tests whether a given value is in cache, even if its value is <code>null</code>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#delete(java.lang.Object)">delete</A></B>(java.lang.Object key)</CODE> <BR> Removes <code>key</code> from the cache.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#delete(java.lang.Object, long)">delete</A></B>(java.lang.Object key, long millisNoReAdd)</CODE> <BR> Removes the given key from the cache, and prevents it from being added under the <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.SetPolicy.html#ADD_ONLY_IF_NOT_PRESENT"><CODE>MemcacheService.SetPolicy.ADD_ONLY_IF_NOT_PRESENT</CODE></A> policy for <code>millisNoReAdd</code> milliseconds thereafter.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.util.Set<java.lang.Object></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#deleteAll(java.util.Collection)">deleteAll</A></B>(java.util.Collection<java.lang.Object> keys)</CODE> <BR> Batch version of <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#delete(java.lang.Object)"><CODE>delete(Object)</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.util.Set<java.lang.Object></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#deleteAll(java.util.Collection, long)">deleteAll</A></B>(java.util.Collection<java.lang.Object> keys, long millisNoReAdd)</CODE> <BR> Batch version of <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#delete(java.lang.Object, long)"><CODE>delete(Object, long)</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.Object</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#get(java.lang.Object)">get</A></B>(java.lang.Object key)</CODE> <BR> Fetches a previously-stored value, or <code>null</code> if unset.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.util.Map<java.lang.Object,java.lang.Object></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#getAll(java.util.Collection)">getAll</A></B>(java.util.Collection<java.lang.Object> keys)</CODE> <BR> Performs a get of multiple keys at once.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../com/google/appengine/api/memcache/ErrorHandler.html" title="interface in com.google.appengine.api.memcache">ErrorHandler</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#getErrorHandler()">getErrorHandler</A></B>()</CODE> <BR> Fetches the current error handler.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#getNamespace()">getNamespace</A></B>()</CODE> <BR> Get the name of the namespace that will be used in API calls.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../com/google/appengine/api/memcache/Stats.html" title="interface in com.google.appengine.api.memcache">Stats</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#getStatistics()">getStatistics</A></B>()</CODE> <BR> Fetches some statistics about the cache and its usage.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.Long</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#increment(java.lang.Object, long)">increment</A></B>(java.lang.Object key, long delta)</CODE> <BR> Atomically fetches, increments, and stores a given integral value.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.Long</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#increment(java.lang.Object, long, java.lang.Long)">increment</A></B>(java.lang.Object key, long delta, java.lang.Long initialValue)</CODE> <BR> Like normal increment, but allows for an optional initial value for the key to take on if not already present in the cache.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.util.Map<java.lang.Object,java.lang.Long></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#incrementAll(java.util.Collection, long)">incrementAll</A></B>(java.util.Collection<java.lang.Object> keys, long delta)</CODE> <BR> Like normal increment, but increments a batch of separate keys in parallel by the same delta.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.util.Map<java.lang.Object,java.lang.Long></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#incrementAll(java.util.Collection, long, java.lang.Long)">incrementAll</A></B>(java.util.Collection<java.lang.Object> keys, long delta, java.lang.Long initialValue)</CODE> <BR> Like normal increment, but increments a batch of separate keys in parallel by the same delta and potentially sets a starting value.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.util.Map<java.lang.Object,java.lang.Long></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#incrementAll(java.util.Map)">incrementAll</A></B>(java.util.Map<java.lang.Object,java.lang.Long> offsets)</CODE> <BR> Like normal increment, but accepts a mapping of separate controllable offsets for each key individually.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.util.Map<java.lang.Object,java.lang.Long></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#incrementAll(java.util.Map, java.lang.Long)">incrementAll</A></B>(java.util.Map<java.lang.Object,java.lang.Long> offsets, java.lang.Long initialValue)</CODE> <BR> Like normal increment, but accepts a mapping of separate controllable offsets for each key individually.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#put(java.lang.Object, java.lang.Object)">put</A></B>(java.lang.Object key, java.lang.Object value)</CODE> <BR> A convenience shortcut, equivalent to <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#put(java.lang.Object, java.lang.Object, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)"><CODE>put(key, value, null, SetPolicy.SET_ALWAYS)</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#put(java.lang.Object, java.lang.Object, com.google.appengine.api.memcache.Expiration)">put</A></B>(java.lang.Object key, java.lang.Object value, <A HREF="../../../../../com/google/appengine/api/memcache/Expiration.html" title="class in com.google.appengine.api.memcache">Expiration</A> expires)</CODE> <BR> Convenience put, equivalent to <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#put(java.lang.Object, java.lang.Object, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)"><CODE>put(key, value, expiration, SetPolicy.SET_ALWAYS)</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#put(java.lang.Object, java.lang.Object, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)">put</A></B>(java.lang.Object key, java.lang.Object value, <A HREF="../../../../../com/google/appengine/api/memcache/Expiration.html" title="class in com.google.appengine.api.memcache">Expiration</A> expires, <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.SetPolicy.html" title="enum in com.google.appengine.api.memcache">MemcacheService.SetPolicy</A> policy)</CODE> <BR> Store a new value into the cache, using <code>key</code>, but subject to the <code>policy</code> regarding existing entries.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#putAll(java.util.Map)">putAll</A></B>(java.util.Map<java.lang.Object,java.lang.Object> values)</CODE> <BR> Convenience multi-put, equivalent to <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#putAll(java.util.Map, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)"><CODE>putAll(values, expires, SetPolicy.SET_ALWAYS)</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#putAll(java.util.Map, com.google.appengine.api.memcache.Expiration)">putAll</A></B>(java.util.Map<java.lang.Object,java.lang.Object> values, <A HREF="../../../../../com/google/appengine/api/memcache/Expiration.html" title="class in com.google.appengine.api.memcache">Expiration</A> expires)</CODE> <BR> Convenience multi-put, equivalent to <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#putAll(java.util.Map, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)"><CODE>putAll(values, expires, SetPolicy.SET_ALWAYS)</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.util.Set<java.lang.Object></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#putAll(java.util.Map, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)">putAll</A></B>(java.util.Map<java.lang.Object,java.lang.Object> values, <A HREF="../../../../../com/google/appengine/api/memcache/Expiration.html" title="class in com.google.appengine.api.memcache">Expiration</A> expires, <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.SetPolicy.html" title="enum in com.google.appengine.api.memcache">MemcacheService.SetPolicy</A> policy)</CODE> <BR> A batch-processing variant of <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#put(java.lang.Object, java.lang.Object, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)"><CODE>put(java.lang.Object, java.lang.Object, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)</CODE></A>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#setErrorHandler(com.google.appengine.api.memcache.ErrorHandler)">setErrorHandler</A></B>(<A HREF="../../../../../com/google/appengine/api/memcache/ErrorHandler.html" title="interface in com.google.appengine.api.memcache">ErrorHandler</A> handler)</CODE> <BR> Registers a new <code>ErrorHandler</code>.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#setNamespace(java.lang.String)">setNamespace</A></B>(java.lang.String newNamespace)</CODE> <BR> Change the namespace used in API calls.</TD> </TR> </TABLE> <P> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="getNamespace()"><!-- --></A><H3> getNamespace</H3> <PRE> java.lang.String <B>getNamespace</B>()</PRE> <DL> <DD>Get the name of the namespace that will be used in API calls. This is initially set based on <CODE>NamespaceManager.get()</CODE>. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="setNamespace(java.lang.String)"><!-- --></A><H3> setNamespace</H3> <PRE> void <B>setNamespace</B>(java.lang.String newNamespace)</PRE> <DL> <DD>Change the namespace used in API calls. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>newNamespace</CODE> - the new namespace to use. If <code>null</code>, switch back to the default namespace, as specified by <CODE>NamespaceManager.get()</CODE>.</DL> </DD> </DL> <HR> <A NAME="get(java.lang.Object)"><!-- --></A><H3> get</H3> <PRE> java.lang.Object <B>get</B>(java.lang.Object key)</PRE> <DL> <DD>Fetches a previously-stored value, or <code>null</code> if unset. Since <code>null</code> might be the set value in some cases, so we also have <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#contains(java.lang.Object)"><CODE>contains(Object)</CODE></A> which returns <code>boolean</code>. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>key</CODE> - the key object used to store the cache entry <DT><B>Returns:</B><DD>the value object previously stored, or <code>null</code> <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the type of the key cannot be supported. <DD><CODE><A HREF="../../../../../com/google/appengine/api/memcache/InvalidValueException.html" title="class in com.google.appengine.api.memcache">InvalidValueException</A></CODE> - for any error in reconstituting the cache value.</DL> </DD> </DL> <HR> <A NAME="contains(java.lang.Object)"><!-- --></A><H3> contains</H3> <PRE> boolean <B>contains</B>(java.lang.Object key)</PRE> <DL> <DD>Tests whether a given value is in cache, even if its value is <code>null</code>. <p> Note that, because an object may be removed from cache at any time, the following is not sound code: <pre> if (memcache.contains("key")) { foo = memcache.get("key"); if (foo == null) { // continue, assuming foo had the real value null } } </pre> The problem is that the cache could have dropped the entry between the call to <code>contains</code> and @{link <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#get(java.lang.Object)"><CODE>get</CODE></A>. This is a sounder pattern: <pre> foo = memcache.get("key"); if (foo == null) { if (memcache.contains("key")) { // continue, assuming foo had the real value null } else { // continue; foo may have had a real null, but has been dropped now } } </pre> Another alternative is to prefer <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#getAll(java.util.Collection)"><CODE>getAll(Collection)</CODE></A>, although it requires making an otherwise-unneeded <code>Collection</code> of some sort. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>key</CODE> - the key object used to store the cache entry <DT><B>Returns:</B><DD><code>true</code> if the cache contains an entry for the key <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the key cannot be serialized</DL> </DD> </DL> <HR> <A NAME="getAll(java.util.Collection)"><!-- --></A><H3> getAll</H3> <PRE> java.util.Map<java.lang.Object,java.lang.Object> <B>getAll</B>(java.util.Collection<java.lang.Object> keys)</PRE> <DL> <DD>Performs a get of multiple keys at once. This is more efficient than multiple separate calls to <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#get(java.lang.Object)"><CODE>get(Object)</CODE></A>, and allows a single call to both test for <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#contains(java.lang.Object)"><CODE>contains(Object)</CODE></A> and also fetch the value, because the return will not include mappings for keys not found. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>keys</CODE> - a collection of keys for which values should be retrieved <DT><B>Returns:</B><DD>a mapping from keys to values of any entries found. If a requested key is not found in the cache, the key will not be in the returned Map. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalArgumentException</CODE> - if an element of <code>keys</code> cannot be used as a cache key. They should be <CODE>Serializable</CODE>. <DD><CODE><A HREF="../../../../../com/google/appengine/api/memcache/InvalidValueException.html" title="class in com.google.appengine.api.memcache">InvalidValueException</A></CODE> - for any error in deserializing the cache value.</DL> </DD> </DL> <HR> <A NAME="put(java.lang.Object, java.lang.Object, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)"><!-- --></A><H3> put</H3> <PRE> boolean <B>put</B>(java.lang.Object key, java.lang.Object value, <A HREF="../../../../../com/google/appengine/api/memcache/Expiration.html" title="class in com.google.appengine.api.memcache">Expiration</A> expires, <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.SetPolicy.html" title="enum in com.google.appengine.api.memcache">MemcacheService.SetPolicy</A> policy)</PRE> <DL> <DD>Store a new value into the cache, using <code>key</code>, but subject to the <code>policy</code> regarding existing entries. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>key</CODE> - the key for the new cache entry<DD><CODE>value</CODE> - the value to be stored<DD><CODE>expires</CODE> - an <A HREF="../../../../../com/google/appengine/api/memcache/Expiration.html" title="class in com.google.appengine.api.memcache"><CODE>Expiration</CODE></A> object to set time-based expiration. <code>null</code> may be used indicate no specific expiration.<DD><CODE>policy</CODE> - Requests particular handling regarding pre-existing entries under the same key. This parameter must not be <code>null</code>. <DT><B>Returns:</B><DD><code>true</code> if a new entry was created, <code>false</code> if not because of the <code>policy</code>. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the key or value type can't be stored as a cache item. They should be <CODE>Serializable</CODE>.</DL> </DD> </DL> <HR> <A NAME="put(java.lang.Object, java.lang.Object, com.google.appengine.api.memcache.Expiration)"><!-- --></A><H3> put</H3> <PRE> void <B>put</B>(java.lang.Object key, java.lang.Object value, <A HREF="../../../../../com/google/appengine/api/memcache/Expiration.html" title="class in com.google.appengine.api.memcache">Expiration</A> expires)</PRE> <DL> <DD>Convenience put, equivalent to <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#put(java.lang.Object, java.lang.Object, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)"><CODE>put(key, value, expiration, SetPolicy.SET_ALWAYS)</CODE></A>. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>key</CODE> - key of the new entry<DD><CODE>value</CODE> - value for the new entry<DD><CODE>expires</CODE> - time-based <A HREF="../../../../../com/google/appengine/api/memcache/Expiration.html" title="class in com.google.appengine.api.memcache"><CODE>Expiration</CODE></A>, or <code>null</code> for none <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the key or value type can't be stored as a cache item. They should be <CODE>Serializable</CODE>.</DL> </DD> </DL> <HR> <A NAME="put(java.lang.Object, java.lang.Object)"><!-- --></A><H3> put</H3> <PRE> void <B>put</B>(java.lang.Object key, java.lang.Object value)</PRE> <DL> <DD>A convenience shortcut, equivalent to <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#put(java.lang.Object, java.lang.Object, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)"><CODE>put(key, value, null, SetPolicy.SET_ALWAYS)</CODE></A>. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>key</CODE> - key of the new entry<DD><CODE>value</CODE> - value for the new entry <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the key or value type can't be stored as a cache item. They should be <CODE>Serializable</CODE>.</DL> </DD> </DL> <HR> <A NAME="putAll(java.util.Map, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)"><!-- --></A><H3> putAll</H3> <PRE> java.util.Set<java.lang.Object> <B>putAll</B>(java.util.Map<java.lang.Object,java.lang.Object> values, <A HREF="../../../../../com/google/appengine/api/memcache/Expiration.html" title="class in com.google.appengine.api.memcache">Expiration</A> expires, <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.SetPolicy.html" title="enum in com.google.appengine.api.memcache">MemcacheService.SetPolicy</A> policy)</PRE> <DL> <DD>A batch-processing variant of <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#put(java.lang.Object, java.lang.Object, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)"><CODE>put(java.lang.Object, java.lang.Object, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)</CODE></A>. This is more efficiently implemented by the service than multiple calls. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>values</CODE> - the key/value mappings to add to the cache<DD><CODE>expires</CODE> - the expiration time for all <code>values</code>, or <code>null</code> for no time-based expiration.<DD><CODE>policy</CODE> - what to do if the entry is or is not already present <DT><B>Returns:</B><DD>the set of keys for which entries were created. Keys in <code>values</code> may not be in the returned set because of the <code>policy</code> regarding pre-existing entries. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the key or value type can't be stored as a cache item. They should be <CODE>Serializable</CODE>.</DL> </DD> </DL> <HR> <A NAME="putAll(java.util.Map, com.google.appengine.api.memcache.Expiration)"><!-- --></A><H3> putAll</H3> <PRE> void <B>putAll</B>(java.util.Map<java.lang.Object,java.lang.Object> values, <A HREF="../../../../../com/google/appengine/api/memcache/Expiration.html" title="class in com.google.appengine.api.memcache">Expiration</A> expires)</PRE> <DL> <DD>Convenience multi-put, equivalent to <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#putAll(java.util.Map, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)"><CODE>putAll(values, expires, SetPolicy.SET_ALWAYS)</CODE></A>. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>values</CODE> - key/value mappings to add to the cache<DD><CODE>expires</CODE> - expiration time for the new values, or <code>null</code> for no time-based expiration <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the key or value type can't be stored as a cache item. They should be <CODE>Serializable</CODE>.</DL> </DD> </DL> <HR> <A NAME="putAll(java.util.Map)"><!-- --></A><H3> putAll</H3> <PRE> void <B>putAll</B>(java.util.Map<java.lang.Object,java.lang.Object> values)</PRE> <DL> <DD>Convenience multi-put, equivalent to <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#putAll(java.util.Map, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)"><CODE>putAll(values, expires, SetPolicy.SET_ALWAYS)</CODE></A>. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>values</CODE> - key/value mappings for new entries to add to the cache <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the key or value type can't be stored as a cache item. They should be <CODE>Serializable</CODE>.</DL> </DD> </DL> <HR> <A NAME="delete(java.lang.Object)"><!-- --></A><H3> delete</H3> <PRE> boolean <B>delete</B>(java.lang.Object key)</PRE> <DL> <DD>Removes <code>key</code> from the cache. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>key</CODE> - the key of the entry to delete. <DT><B>Returns:</B><DD><code>true</code> if an entry existed, but was discarded <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the key can't be used in the cache because it is not <CODE>Serializable</CODE>.</DL> </DD> </DL> <HR> <A NAME="delete(java.lang.Object, long)"><!-- --></A><H3> delete</H3> <PRE> boolean <B>delete</B>(java.lang.Object key, long millisNoReAdd)</PRE> <DL> <DD>Removes the given key from the cache, and prevents it from being added under the <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.SetPolicy.html#ADD_ONLY_IF_NOT_PRESENT"><CODE>MemcacheService.SetPolicy.ADD_ONLY_IF_NOT_PRESENT</CODE></A> policy for <code>millisNoReAdd</code> milliseconds thereafter. Calls to a <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#put(java.lang.Object, java.lang.Object, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)"><CODE>put(java.lang.Object, java.lang.Object, com.google.appengine.api.memcache.Expiration, com.google.appengine.api.memcache.MemcacheService.SetPolicy)</CODE></A> method using <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.SetPolicy.html#SET_ALWAYS"><CODE>MemcacheService.SetPolicy.SET_ALWAYS</CODE></A> are not blocked, however. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>key</CODE> - key to delete<DD><CODE>millisNoReAdd</CODE> - time during which calls to put using ADD_IF_NOT_PRESENT should be denied. <DT><B>Returns:</B><DD><code>true</code> if an entry existed to delete <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the key can't be used in the cache because it is not <CODE>Serializable</CODE>.</DL> </DD> </DL> <HR> <A NAME="deleteAll(java.util.Collection)"><!-- --></A><H3> deleteAll</H3> <PRE> java.util.Set<java.lang.Object> <B>deleteAll</B>(java.util.Collection<java.lang.Object> keys)</PRE> <DL> <DD>Batch version of <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#delete(java.lang.Object)"><CODE>delete(Object)</CODE></A>. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>keys</CODE> - a collection of keys for entries to delete <DT><B>Returns:</B><DD>the Set of keys deleted. Any keys in <code>keys</code> but not in the returned set were not found in the cache. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalArgumentException</CODE> - if a key can't be used in the cache because it is not <CODE>Serializable</CODE>.</DL> </DD> </DL> <HR> <A NAME="deleteAll(java.util.Collection, long)"><!-- --></A><H3> deleteAll</H3> <PRE> java.util.Set<java.lang.Object> <B>deleteAll</B>(java.util.Collection<java.lang.Object> keys, long millisNoReAdd)</PRE> <DL> <DD>Batch version of <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#delete(java.lang.Object, long)"><CODE>delete(Object, long)</CODE></A>. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>keys</CODE> - the keys to be deleted<DD><CODE>millisNoReAdd</CODE> - time during which calls to put using <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.SetPolicy.html#ADD_ONLY_IF_NOT_PRESENT"><CODE>MemcacheService.SetPolicy.ADD_ONLY_IF_NOT_PRESENT</CODE></A> should be denied. <DT><B>Returns:</B><DD>the set of keys deleted. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the key can't be used in the cache because it is not <CODE>Serializable</CODE>.</DL> </DD> </DL> <HR> <A NAME="increment(java.lang.Object, long)"><!-- --></A><H3> increment</H3> <PRE> java.lang.Long <B>increment</B>(java.lang.Object key, long delta)</PRE> <DL> <DD>Atomically fetches, increments, and stores a given integral value. "Integral" types are <CODE>Byte</CODE>, <CODE>Short</CODE>, <CODE>Integer</CODE>, <CODE>Long</CODE>, and in some cases <CODE>String</CODE> (if the string is parseable as a number, for example via <CODE>Long.parseLong(String)</CODE>. The entry must already exist, and have a non-negative value. <p> Incrementing by positive amounts will reach signed 64-bit max (<code>2^63 - 1</code>) and then wrap-around to signed 64-bit min (<code>-2^63</code>), continuing increments from that point. <p> To facilitate use as an atomic countdown, incrementing by a negative value (i.e. decrementing) will not go below zero: incrementing <code>2</code> by <code>-5</code> will return <code>0</code>, not <code>-3</code>. However, due to the way numbers are stored, decrementing <code>-3</code> by <code>-5</code> will result in <code>-8</code>; so the zero-floor rule only applies to decrementing numbers that were positive. <p> Note: The actual representation of all numbers in Memcache is a string. This means if you initially stored a number as a string (e.g., "10") and then increment it, everything will work properly, including wrapping beyond signed 64-bit int max. However, if you <CODE>get</CODE> the key past the point of wrapping, you will receive an unsigned integer value, <em>not</em> a signed integer value. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>key</CODE> - the key of the entry to manipulate<DD><CODE>delta</CODE> - the size of the increment, positive or negative. <DT><B>Returns:</B><DD>the post-increment value, as a long. However, a <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.html#get(java.lang.Object)"><CODE>get(Object)</CODE></A> of the key will still have the original type (<CODE>Byte</CODE>, <CODE>Short</CODE>, etc.). If there is no entry for <code>key</code>, returns <code>null</code>. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalArgumentException</CODE> - if the key can't be used in the cache because it is not <CODE>Serializable</CODE>. <DD><CODE><A HREF="../../../../../com/google/appengine/api/memcache/InvalidValueException.html" title="class in com.google.appengine.api.memcache">InvalidValueException</A></CODE> - if the object incremented is not of a integral type</DL> </DD> </DL> <HR> <A NAME="increment(java.lang.Object, long, java.lang.Long)"><!-- --></A><H3> increment</H3> <PRE> java.lang.Long <B>increment</B>(java.lang.Object key, long delta, java.lang.Long initialValue)</PRE> <DL> <DD>Like normal increment, but allows for an optional initial value for the key to take on if not already present in the cache. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>initialValue</CODE> - value to insert into the cache if the key is not present</DL> </DD> </DL> <HR> <A NAME="incrementAll(java.util.Collection, long)"><!-- --></A><H3> incrementAll</H3> <PRE> java.util.Map<java.lang.Object,java.lang.Long> <B>incrementAll</B>(java.util.Collection<java.lang.Object> keys, long delta)</PRE> <DL> <DD>Like normal increment, but increments a batch of separate keys in parallel by the same delta. <P> <DD><DL> <DT><B>Returns:</B><DD>mapping keys to their new values; values will be null if they could not be incremented or were not present in the cache</DL> </DD> </DL> <HR> <A NAME="incrementAll(java.util.Collection, long, java.lang.Long)"><!-- --></A><H3> incrementAll</H3> <PRE> java.util.Map<java.lang.Object,java.lang.Long> <B>incrementAll</B>(java.util.Collection<java.lang.Object> keys, long delta, java.lang.Long initialValue)</PRE> <DL> <DD>Like normal increment, but increments a batch of separate keys in parallel by the same delta and potentially sets a starting value. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>initialValue</CODE> - value to insert into the cache if the key is not present <DT><B>Returns:</B><DD>mapping keys to their new values; values will be null if they could not be incremented for whatever reason</DL> </DD> </DL> <HR> <A NAME="incrementAll(java.util.Map)"><!-- --></A><H3> incrementAll</H3> <PRE> java.util.Map<java.lang.Object,java.lang.Long> <B>incrementAll</B>(java.util.Map<java.lang.Object,java.lang.Long> offsets)</PRE> <DL> <DD>Like normal increment, but accepts a mapping of separate controllable offsets for each key individually. Good for incrementing by a sum and a count in parallel. <P> <DD><DL> <DT><B>Returns:</B><DD>mapping keys to their new values; values will be null if they could not be incremented for whatever reason</DL> </DD> </DL> <HR> <A NAME="incrementAll(java.util.Map, java.lang.Long)"><!-- --></A><H3> incrementAll</H3> <PRE> java.util.Map<java.lang.Object,java.lang.Long> <B>incrementAll</B>(java.util.Map<java.lang.Object,java.lang.Long> offsets, java.lang.Long initialValue)</PRE> <DL> <DD>Like normal increment, but accepts a mapping of separate controllable offsets for each key individually. Good for incrementing by a sum and a count in parallel. Callers may also pass an initial value for the keys to take on if they are not already present in the cache. <P> <DD><DL> <DT><B>Returns:</B><DD>mapping keys to their new values; values will be null if they could not be incremented for whatever reason</DL> </DD> </DL> <HR> <A NAME="clearAll()"><!-- --></A><H3> clearAll</H3> <PRE> void <B>clearAll</B>()</PRE> <DL> <DD>Empties the cache of all values. Statistics are not affected. Note that <code>clearAll()</code> does not respect namespaces - this flushes the cache for every namespace. <P> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getStatistics()"><!-- --></A><H3> getStatistics</H3> <PRE> <A HREF="../../../../../com/google/appengine/api/memcache/Stats.html" title="interface in com.google.appengine.api.memcache">Stats</A> <B>getStatistics</B>()</PRE> <DL> <DD>Fetches some statistics about the cache and its usage. <P> <DD><DL> <DT><B>Returns:</B><DD>statistics for the cache. Note that <code>getStatistics()</code> does not respect namespaces - this will return stats for every namespace. The response will never be <code>null</code>.</DL> </DD> </DL> <HR> <A NAME="setErrorHandler(com.google.appengine.api.memcache.ErrorHandler)"><!-- --></A><H3> setErrorHandler</H3> <PRE> void <B>setErrorHandler</B>(<A HREF="../../../../../com/google/appengine/api/memcache/ErrorHandler.html" title="interface in com.google.appengine.api.memcache">ErrorHandler</A> handler)</PRE> <DL> <DD>Registers a new <code>ErrorHandler</code>. The <code>handler</code> is used to field any errors which aren't necessarily the application programmer's fault: things like network timeouts, for example. Value correctness and usage errors <CODE>IllegalArgumentException</CODE>, <A HREF="../../../../../com/google/appengine/api/memcache/InvalidValueException.html" title="class in com.google.appengine.api.memcache"><CODE>InvalidValueException</CODE></A> are still thrown normally. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>handler</CODE> - the new <code>ErrorHandler</code> to use. May not be <code>null</code>; use <CODE>ErrorHandler#LOGGING_ERROR_HANDLER</CODE> to explicitly restore default behavior.</DL> </DD> </DL> <HR> <A NAME="getErrorHandler()"><!-- --></A><H3> getErrorHandler</H3> <PRE> <A HREF="../../../../../com/google/appengine/api/memcache/ErrorHandler.html" title="interface in com.google.appengine.api.memcache">ErrorHandler</A> <B>getErrorHandler</B>()</PRE> <DL> <DD>Fetches the current error handler. <P> <DD><DL> </DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <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> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheSerialization.ValueAndFlags.html" title="class in com.google.appengine.api.memcache"><B>PREV CLASS</B></A> <A HREF="../../../../../com/google/appengine/api/memcache/MemcacheService.SetPolicy.html" title="enum in com.google.appengine.api.memcache"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/google/appengine/api/memcache/MemcacheService.html" target="_top"><B>FRAMES</B></A> <A HREF="MemcacheService.html" target="_top"><B>NO FRAMES</B></A> <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> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>