FreePastry/docs/javadoc/rice/persistence/MemoryStorage.html

702 lines
32 KiB
HTML
Raw Normal View History

2019-05-13 16:45:05 +04:00
<!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_07) on Fri Mar 13 20:01:03 CET 2009 -->
<TITLE>
MemoryStorage (Rice Pastry - API Specifications)
</TITLE>
<META NAME="date" CONTENT="2009-03-13">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="MemoryStorage (Rice Pastry - API Specifications)";
}
}
</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>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/MemoryStorage.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>
Rice Pastry API</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../rice/persistence/LRUCache.html" title="class in rice.persistence"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../rice/persistence/PersistentStorage.html" title="class in rice.persistence"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?rice/persistence/MemoryStorage.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="MemoryStorage.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>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<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">
rice.persistence</FONT>
<BR>
Class MemoryStorage</H2>
<PRE>
java.lang.Object
<IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>rice.persistence.MemoryStorage</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../rice/persistence/Catalog.html" title="interface in rice.persistence">Catalog</A>, <A HREF="../../rice/persistence/Storage.html" title="interface in rice.persistence">Storage</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>MemoryStorage</B><DT>extends java.lang.Object<DT>implements <A HREF="../../rice/persistence/Storage.html" title="interface in rice.persistence">Storage</A></DL>
</PRE>
<P>
This class is an implementation of Storage which provides
in-memory storage. This class is specifically *NOT* designed
to provide persistent storage, and simply functions as an
enhanced hash table.
<P>
<P>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_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>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../rice/persistence/MemoryStorage.html#MemoryStorage(rice.p2p.commonapi.IdFactory)">MemoryStorage</A></B>(<A HREF="../../rice/p2p/commonapi/IdFactory.html" title="interface in rice.p2p.commonapi">IdFactory</A>&nbsp;factory)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Builds a MemoryStorage object.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== 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>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../rice/persistence/MemoryStorage.html#exists(rice.p2p.commonapi.Id)">exists</A></B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;id)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns whether or not the provided id exists</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../rice/persistence/MemoryStorage.html#flush(rice.Continuation)">flush</A></B>(<A HREF="../../rice/Continuation.html" title="interface in rice">Continuation</A>&nbsp;c)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method which is used to erase all data stored in the Storage.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.io.Serializable</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../rice/persistence/MemoryStorage.html#getMetadata(rice.p2p.commonapi.Id)">getMetadata</A></B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;id)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the metadata associated with the provided object, or null if
no metadata exists.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../rice/persistence/MemoryStorage.html#getObject(rice.p2p.commonapi.Id, rice.Continuation)">getObject</A></B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;id,
<A HREF="../../rice/Continuation.html" title="interface in rice">Continuation</A>&nbsp;c)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the object identified by the given id, or <code>null</code> if
there is no cooresponding object (through receiveResult on c).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../rice/persistence/MemoryStorage.html#getSize()">getSize</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of Ids currently stored in the catalog</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../rice/persistence/MemoryStorage.html#getTotalSize()">getTotalSize</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the total size of the stored data in bytes.The result
is returned via the receiveResult method on the provided
Continuation with an Integer representing the size.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../rice/persistence/MemoryStorage.html#rename(rice.p2p.commonapi.Id, rice.p2p.commonapi.Id, rice.Continuation)">rename</A></B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;oldId,
<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;newId,
<A HREF="../../rice/Continuation.html" title="interface in rice">Continuation</A>&nbsp;c)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Renames the given object to the new id.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../rice/p2p/commonapi/IdSet.html" title="interface in rice.p2p.commonapi">IdSet</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../rice/persistence/MemoryStorage.html#scan()">scan</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return all objects currently stored by this catalog
NOTE: This method blocks so if the behavior of this method changes and
no longer stored in memory, this method may be deprecated.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../rice/p2p/commonapi/IdSet.html" title="interface in rice.p2p.commonapi">IdSet</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../rice/persistence/MemoryStorage.html#scan(rice.p2p.commonapi.IdRange)">scan</A></B>(<A HREF="../../rice/p2p/commonapi/IdRange.html" title="interface in rice.p2p.commonapi">IdRange</A>&nbsp;range)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the objects identified by the given range of ids.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.SortedMap</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../rice/persistence/MemoryStorage.html#scanMetadata()">scanMetadata</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a map which contains keys mapping ids to the associated
metadata.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.SortedMap</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../rice/persistence/MemoryStorage.html#scanMetadata(rice.p2p.commonapi.IdRange)">scanMetadata</A></B>(<A HREF="../../rice/p2p/commonapi/IdRange.html" title="interface in rice.p2p.commonapi">IdRange</A>&nbsp;range)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a map which contains keys mapping ids to the associated
metadata.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.SortedMap</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../rice/persistence/MemoryStorage.html#scanMetadataValuesHead(java.lang.Object)">scanMetadataValuesHead</A></B>(java.lang.Object&nbsp;value)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the submapping of ids which have metadata less than the provided
value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.SortedMap</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../rice/persistence/MemoryStorage.html#scanMetadataValuesNull()">scanMetadataValuesNull</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the submapping of ids which have metadata null</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../rice/persistence/MemoryStorage.html#setMetadata(rice.p2p.commonapi.Id, java.io.Serializable, rice.Continuation)">setMetadata</A></B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;id,
java.io.Serializable&nbsp;metadata,
<A HREF="../../rice/Continuation.html" title="interface in rice">Continuation</A>&nbsp;command)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Updates the metadata stored under the given key to be the provided
value.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../rice/persistence/MemoryStorage.html#store(rice.p2p.commonapi.Id, java.io.Serializable, java.io.Serializable, rice.Continuation)">store</A></B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;id,
java.io.Serializable&nbsp;metadata,
java.io.Serializable&nbsp;obj,
<A HREF="../../rice/Continuation.html" title="interface in rice">Continuation</A>&nbsp;c)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Stores the object under the key <code>id</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../rice/persistence/MemoryStorage.html#unstore(rice.p2p.commonapi.Id, rice.Continuation)">unstore</A></B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;id,
<A HREF="../../rice/Continuation.html" title="interface in rice">Continuation</A>&nbsp;c)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes the object from the list of stored objects.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_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>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="MemoryStorage(rice.p2p.commonapi.IdFactory)"><!-- --></A><H3>
MemoryStorage</H3>
<PRE>
public <B>MemoryStorage</B>(<A HREF="../../rice/p2p/commonapi/IdFactory.html" title="interface in rice.p2p.commonapi">IdFactory</A>&nbsp;factory)</PRE>
<DL>
<DD>Builds a MemoryStorage object.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>factory</CODE> - The factory to build protocol-specific Ids from.</DL>
</DL>
<!-- ============ 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="flush(rice.Continuation)"><!-- --></A><H3>
flush</H3>
<PRE>
public void <B>flush</B>(<A HREF="../../rice/Continuation.html" title="interface in rice">Continuation</A>&nbsp;c)</PRE>
<DL>
<DD>Method which is used to erase all data stored in the Storage.
Use this method with care!
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/persistence/Catalog.html#flush(rice.Continuation)">flush</A></CODE> in interface <CODE><A HREF="../../rice/persistence/Catalog.html" title="interface in rice.persistence">Catalog</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>c</CODE> - The command to run once done</DL>
</DD>
</DL>
<HR>
<A NAME="rename(rice.p2p.commonapi.Id, rice.p2p.commonapi.Id, rice.Continuation)"><!-- --></A><H3>
rename</H3>
<PRE>
public void <B>rename</B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;oldId,
<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;newId,
<A HREF="../../rice/Continuation.html" title="interface in rice">Continuation</A>&nbsp;c)</PRE>
<DL>
<DD>Renames the given object to the new id. This method is potentially faster
than store/cache and unstore/uncache.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/persistence/Catalog.html#rename(rice.p2p.commonapi.Id, rice.p2p.commonapi.Id, rice.Continuation)">rename</A></CODE> in interface <CODE><A HREF="../../rice/persistence/Catalog.html" title="interface in rice.persistence">Catalog</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>oldId</CODE> - The id of the object in question.<DD><CODE>newId</CODE> - The new id of the object in question.<DD><CODE>c</CODE> - The command to run once the operation is complete</DL>
</DD>
</DL>
<HR>
<A NAME="store(rice.p2p.commonapi.Id, java.io.Serializable, java.io.Serializable, rice.Continuation)"><!-- --></A><H3>
store</H3>
<PRE>
public void <B>store</B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;id,
java.io.Serializable&nbsp;metadata,
java.io.Serializable&nbsp;obj,
<A HREF="../../rice/Continuation.html" title="interface in rice">Continuation</A>&nbsp;c)</PRE>
<DL>
<DD>Stores the object under the key <code>id</code>. If there is already
an object under <code>id</code>, that object is replaced.
This method completes by calling recieveResult() of the provided continuation
with the success or failure of the operation.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/persistence/Storage.html#store(rice.p2p.commonapi.Id, java.io.Serializable, java.io.Serializable, rice.Continuation)">store</A></CODE> in interface <CODE><A HREF="../../rice/persistence/Storage.html" title="interface in rice.persistence">Storage</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>obj</CODE> - The object to be made persistent.<DD><CODE>id</CODE> - The object's id.<DD><CODE>metadata</CODE> - The object's metadata<DD><CODE>c</CODE> - The command to run once the operation is complete</DL>
</DD>
</DL>
<HR>
<A NAME="unstore(rice.p2p.commonapi.Id, rice.Continuation)"><!-- --></A><H3>
unstore</H3>
<PRE>
public void <B>unstore</B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;id,
<A HREF="../../rice/Continuation.html" title="interface in rice">Continuation</A>&nbsp;c)</PRE>
<DL>
<DD>Removes the object from the list of stored objects. If the object was not
in the cached list in the first place, nothing happens and <code>false</code>
is returned.
This method completes by calling recieveResult() of the provided continuation
with the success or failure of the operation.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/persistence/Storage.html#unstore(rice.p2p.commonapi.Id, rice.Continuation)">unstore</A></CODE> in interface <CODE><A HREF="../../rice/persistence/Storage.html" title="interface in rice.persistence">Storage</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - The object's persistence id<DD><CODE>c</CODE> - The command to run once the operation is complete</DL>
</DD>
</DL>
<HR>
<A NAME="exists(rice.p2p.commonapi.Id)"><!-- --></A><H3>
exists</H3>
<PRE>
public boolean <B>exists</B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;id)</PRE>
<DL>
<DD>Returns whether or not the provided id exists
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/persistence/Catalog.html#exists(rice.p2p.commonapi.Id)">exists</A></CODE> in interface <CODE><A HREF="../../rice/persistence/Catalog.html" title="interface in rice.persistence">Catalog</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - The id to check
<DT><B>Returns:</B><DD>Whether or not the given id is stored</DL>
</DD>
</DL>
<HR>
<A NAME="getMetadata(rice.p2p.commonapi.Id)"><!-- --></A><H3>
getMetadata</H3>
<PRE>
public java.io.Serializable <B>getMetadata</B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;id)</PRE>
<DL>
<DD>Returns the metadata associated with the provided object, or null if
no metadata exists. The metadata must be stored in memory, so this
operation is guaranteed to be fast and non-blocking.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/persistence/Catalog.html#getMetadata(rice.p2p.commonapi.Id)">getMetadata</A></CODE> in interface <CODE><A HREF="../../rice/persistence/Catalog.html" title="interface in rice.persistence">Catalog</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - The id for which the metadata is needed
<DT><B>Returns:</B><DD>The metadata, or null of non exists</DL>
</DD>
</DL>
<HR>
<A NAME="setMetadata(rice.p2p.commonapi.Id, java.io.Serializable, rice.Continuation)"><!-- --></A><H3>
setMetadata</H3>
<PRE>
public void <B>setMetadata</B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;id,
java.io.Serializable&nbsp;metadata,
<A HREF="../../rice/Continuation.html" title="interface in rice">Continuation</A>&nbsp;command)</PRE>
<DL>
<DD>Updates the metadata stored under the given key to be the provided
value. As this may require a disk access, the requestor must
also provide a continuation to return the result to.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/persistence/Catalog.html#setMetadata(rice.p2p.commonapi.Id, java.io.Serializable, rice.Continuation)">setMetadata</A></CODE> in interface <CODE><A HREF="../../rice/persistence/Catalog.html" title="interface in rice.persistence">Catalog</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - The id for the metadata<DD><CODE>metadata</CODE> - The metadata to store<DD><CODE>c</CODE> - The command to run once the operation is complete</DL>
</DD>
</DL>
<HR>
<A NAME="getObject(rice.p2p.commonapi.Id, rice.Continuation)"><!-- --></A><H3>
getObject</H3>
<PRE>
public void <B>getObject</B>(<A HREF="../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;id,
<A HREF="../../rice/Continuation.html" title="interface in rice">Continuation</A>&nbsp;c)</PRE>
<DL>
<DD>Returns the object identified by the given id, or <code>null</code> if
there is no cooresponding object (through receiveResult on c).
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/persistence/Catalog.html#getObject(rice.p2p.commonapi.Id, rice.Continuation)">getObject</A></CODE> in interface <CODE><A HREF="../../rice/persistence/Catalog.html" title="interface in rice.persistence">Catalog</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - The id of the object in question.<DD><CODE>c</CODE> - The command to run once the operation is complete</DL>
</DD>
</DL>
<HR>
<A NAME="scan(rice.p2p.commonapi.IdRange)"><!-- --></A><H3>
scan</H3>
<PRE>
public <A HREF="../../rice/p2p/commonapi/IdSet.html" title="interface in rice.p2p.commonapi">IdSet</A> <B>scan</B>(<A HREF="../../rice/p2p/commonapi/IdRange.html" title="interface in rice.p2p.commonapi">IdRange</A>&nbsp;range)</PRE>
<DL>
<DD>Return the objects identified by the given range of ids. The IdSet
returned contains the Ids of the stored objects. The range is
partially inclusive, the lower range is inclusive, and the upper
exclusive.
NOTE: This method blocks so if the behavior of this method changes and
the guys don't fit in memory, this method may be deprecated.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/persistence/Catalog.html#scan(rice.p2p.commonapi.IdRange)">scan</A></CODE> in interface <CODE><A HREF="../../rice/persistence/Catalog.html" title="interface in rice.persistence">Catalog</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>range</CODE> - The range to query
<DT><B>Returns:</B><DD>The idset containg the keys</DL>
</DD>
</DL>
<HR>
<A NAME="scan()"><!-- --></A><H3>
scan</H3>
<PRE>
public <A HREF="../../rice/p2p/commonapi/IdSet.html" title="interface in rice.p2p.commonapi">IdSet</A> <B>scan</B>()</PRE>
<DL>
<DD>Return all objects currently stored by this catalog
NOTE: This method blocks so if the behavior of this method changes and
no longer stored in memory, this method may be deprecated.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/persistence/Catalog.html#scan()">scan</A></CODE> in interface <CODE><A HREF="../../rice/persistence/Catalog.html" title="interface in rice.persistence">Catalog</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>The idset containg the keys</DL>
</DD>
</DL>
<HR>
<A NAME="scanMetadata(rice.p2p.commonapi.IdRange)"><!-- --></A><H3>
scanMetadata</H3>
<PRE>
public java.util.SortedMap <B>scanMetadata</B>(<A HREF="../../rice/p2p/commonapi/IdRange.html" title="interface in rice.p2p.commonapi">IdRange</A>&nbsp;range)</PRE>
<DL>
<DD>Returns a map which contains keys mapping ids to the associated
metadata.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/persistence/Catalog.html#scanMetadata(rice.p2p.commonapi.IdRange)">scanMetadata</A></CODE> in interface <CODE><A HREF="../../rice/persistence/Catalog.html" title="interface in rice.persistence">Catalog</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>range</CODE> - The range to query
<DT><B>Returns:</B><DD>The map containg the keys</DL>
</DD>
</DL>
<HR>
<A NAME="scanMetadata()"><!-- --></A><H3>
scanMetadata</H3>
<PRE>
public java.util.SortedMap <B>scanMetadata</B>()</PRE>
<DL>
<DD>Returns a map which contains keys mapping ids to the associated
metadata.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/persistence/Catalog.html#scanMetadata()">scanMetadata</A></CODE> in interface <CODE><A HREF="../../rice/persistence/Catalog.html" title="interface in rice.persistence">Catalog</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>The treemap mapping ids to metadata</DL>
</DD>
</DL>
<HR>
<A NAME="scanMetadataValuesHead(java.lang.Object)"><!-- --></A><H3>
scanMetadataValuesHead</H3>
<PRE>
public java.util.SortedMap <B>scanMetadataValuesHead</B>(java.lang.Object&nbsp;value)</PRE>
<DL>
<DD>Returns the submapping of ids which have metadata less than the provided
value.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/persistence/Catalog.html#scanMetadataValuesHead(java.lang.Object)">scanMetadataValuesHead</A></CODE> in interface <CODE><A HREF="../../rice/persistence/Catalog.html" title="interface in rice.persistence">Catalog</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>value</CODE> - The maximal metadata value
<DT><B>Returns:</B><DD>The submapping</DL>
</DD>
</DL>
<HR>
<A NAME="scanMetadataValuesNull()"><!-- --></A><H3>
scanMetadataValuesNull</H3>
<PRE>
public java.util.SortedMap <B>scanMetadataValuesNull</B>()</PRE>
<DL>
<DD>Returns the submapping of ids which have metadata null
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/persistence/Catalog.html#scanMetadataValuesNull()">scanMetadataValuesNull</A></CODE> in interface <CODE><A HREF="../../rice/persistence/Catalog.html" title="interface in rice.persistence">Catalog</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>The submapping</DL>
</DD>
</DL>
<HR>
<A NAME="getTotalSize()"><!-- --></A><H3>
getTotalSize</H3>
<PRE>
public long <B>getTotalSize</B>()</PRE>
<DL>
<DD>Returns the total size of the stored data in bytes.The result
is returned via the receiveResult method on the provided
Continuation with an Integer representing the size.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/persistence/Catalog.html#getTotalSize()">getTotalSize</A></CODE> in interface <CODE><A HREF="../../rice/persistence/Catalog.html" title="interface in rice.persistence">Catalog</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>c</CODE> - The command to run once the operation is complete
<DT><B>Returns:</B><DD>The total storage size</DL>
</DD>
</DL>
<HR>
<A NAME="getSize()"><!-- --></A><H3>
getSize</H3>
<PRE>
public int <B>getSize</B>()</PRE>
<DL>
<DD>Returns the number of Ids currently stored in the catalog
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../rice/persistence/Catalog.html#getSize()">getSize</A></CODE> in interface <CODE><A HREF="../../rice/persistence/Catalog.html" title="interface in rice.persistence">Catalog</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>The number of ids in the catalog</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>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/MemoryStorage.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>
Rice Pastry API</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../rice/persistence/LRUCache.html" title="class in rice.persistence"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../rice/persistence/PersistentStorage.html" title="class in rice.persistence"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?rice/persistence/MemoryStorage.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="MemoryStorage.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>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<i>Copyright &#169; 2001-2005 - Rice Pastry.</i>
</BODY>
</HTML>