FreePastry/docs/javadoc/rice/tutorial/lookup/LookupService.html

527 lines
26 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:35 CET 2009 -->
<TITLE>
LookupService (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="LookupService (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/LookupService.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;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../rice/tutorial/lookup/LookupService.NodeLookupQuery.html" title="class in rice.tutorial.lookup"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?rice/tutorial/lookup/LookupService.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="LookupService.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;<A HREF="#nested_class_summary">NESTED</A>&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.tutorial.lookup</FONT>
<BR>
Class LookupService</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>rice.tutorial.lookup.LookupService</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../rice/p2p/commonapi/Application.html" title="interface in rice.p2p.commonapi">Application</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>LookupService</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../rice/p2p/commonapi/Application.html" title="interface in rice.p2p.commonapi">Application</A></DL>
</PRE>
<P>
The LookupService provides a way to find out what nodes are responsible for a
given Id. It does this by routing a request across the ring, doing a
replicaSet lookup at the destination, and sending the result back. It is
perhaps the simplest useful application.
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>jstewart</DD>
</DL>
<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&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/tutorial/lookup/LookupService.NodeLookupQuery.html" title="class in rice.tutorial.lookup">LookupService.NodeLookupQuery</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The query message</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/tutorial/lookup/LookupService.NodeLookupResponse.html" title="class in rice.tutorial.lookup">LookupService.NodeLookupResponse</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The response message</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/tutorial/lookup/LookupService.NodeLookupTimeout.html" title="class in rice.tutorial.lookup">LookupService.NodeLookupTimeout</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is a message used internally for implementing timeouts</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/tutorial/lookup/LookupService.NodeLookupTimeoutException.html" title="class in rice.tutorial.lookup">LookupService.NodeLookupTimeoutException</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returned by continuations handed to requestNodeHandles when a request times
out.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== 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/tutorial/lookup/LookupService.html#LookupService(rice.p2p.commonapi.Node)">LookupService</A></B>(<A HREF="../../../rice/p2p/commonapi/Node.html" title="interface in rice.p2p.commonapi">Node</A>&nbsp;node)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Build a LookupService application with the default lookup timeout</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../rice/tutorial/lookup/LookupService.html#LookupService(rice.p2p.commonapi.Node, long)">LookupService</A></B>(<A HREF="../../../rice/p2p/commonapi/Node.html" title="interface in rice.p2p.commonapi">Node</A>&nbsp;node,
long&nbsp;timeout)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Build a LookupService application with a specified timeout</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;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/tutorial/lookup/LookupService.html#deliver(rice.p2p.commonapi.Id, rice.p2p.commonapi.Message)">deliver</A></B>(<A HREF="../../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;id,
<A HREF="../../../rice/p2p/commonapi/Message.html" title="interface in rice.p2p.commonapi">Message</A>&nbsp;message)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This method is called on the application at the destination node
for the given id.</TD>
</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/tutorial/lookup/LookupService.html#forward(rice.p2p.commonapi.RouteMessage)">forward</A></B>(<A HREF="../../../rice/p2p/commonapi/RouteMessage.html" title="interface in rice.p2p.commonapi">RouteMessage</A>&nbsp;message)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This Application always forwards its messages</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/tutorial/lookup/LookupService.html#requestNodeHandle(rice.p2p.commonapi.Id, rice.Continuation)">requestNodeHandle</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>&lt;<A HREF="../../../rice/p2p/commonapi/NodeHandle.html" title="class in rice.p2p.commonapi">NodeHandle</A>,java.lang.Exception&gt;&nbsp;cont)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Find the primary replica of a key.</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/tutorial/lookup/LookupService.html#requestNodeHandles(rice.p2p.commonapi.Id, int, rice.Continuation)">requestNodeHandles</A></B>(<A HREF="../../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;id,
int&nbsp;num,
<A HREF="../../../rice/Continuation.html" title="interface in rice">Continuation</A>&lt;<A HREF="../../../rice/p2p/commonapi/NodeHandleSet.html" title="interface in rice.p2p.commonapi">NodeHandleSet</A>,java.lang.Exception&gt;&nbsp;cont)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Requests a replicaSet from a node across the ring.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/tutorial/lookup/LookupService.html#sendMessage(int, rice.p2p.commonapi.Id, int, rice.Continuation, long)">sendMessage</A></B>(int&nbsp;seq,
<A HREF="../../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;id,
int&nbsp;num,
<A HREF="../../../rice/Continuation.html" title="interface in rice">Continuation</A>&lt;<A HREF="../../../rice/p2p/commonapi/NodeHandleSet.html" title="interface in rice.p2p.commonapi">NodeHandleSet</A>,java.lang.Exception&gt;&nbsp;cont,
long&nbsp;timeout)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This does the internal processing for requestNodeHandle(s).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rice/tutorial/lookup/LookupService.html#sendMessageWithRetries(rice.p2p.commonapi.Id, int, rice.Continuation)">sendMessageWithRetries</A></B>(<A HREF="../../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;id,
int&nbsp;num,
<A HREF="../../../rice/Continuation.html" title="interface in rice">Continuation</A>&lt;<A HREF="../../../rice/p2p/commonapi/NodeHandleSet.html" title="interface in rice.p2p.commonapi">NodeHandleSet</A>,java.lang.Exception&gt;&nbsp;cont)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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/tutorial/lookup/LookupService.html#update(rice.p2p.commonapi.NodeHandle, boolean)">update</A></B>(<A HREF="../../../rice/p2p/commonapi/NodeHandle.html" title="class in rice.p2p.commonapi">NodeHandle</A>&nbsp;handle,
boolean&nbsp;joined)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This method is invoked to inform the application that the given node
has either joined or left the neighbor set of the local node, as the set
would be returned by the neighborSet call.</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="LookupService(rice.p2p.commonapi.Node, long)"><!-- --></A><H3>
LookupService</H3>
<PRE>
public <B>LookupService</B>(<A HREF="../../../rice/p2p/commonapi/Node.html" title="interface in rice.p2p.commonapi">Node</A>&nbsp;node,
long&nbsp;timeout)</PRE>
<DL>
<DD>Build a LookupService application with a specified timeout
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - the local node<DD><CODE>timeout</CODE> - query timeout in milliseconds</DL>
</DL>
<HR>
<A NAME="LookupService(rice.p2p.commonapi.Node)"><!-- --></A><H3>
LookupService</H3>
<PRE>
public <B>LookupService</B>(<A HREF="../../../rice/p2p/commonapi/Node.html" title="interface in rice.p2p.commonapi">Node</A>&nbsp;node)</PRE>
<DL>
<DD>Build a LookupService application with the default lookup timeout
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>node</CODE> - the local node</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="forward(rice.p2p.commonapi.RouteMessage)"><!-- --></A><H3>
forward</H3>
<PRE>
public boolean <B>forward</B>(<A HREF="../../../rice/p2p/commonapi/RouteMessage.html" title="interface in rice.p2p.commonapi">RouteMessage</A>&nbsp;message)</PRE>
<DL>
<DD>This Application always forwards its messages
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../rice/p2p/commonapi/Application.html#forward(rice.p2p.commonapi.RouteMessage)">forward</A></CODE> in interface <CODE><A HREF="../../../rice/p2p/commonapi/Application.html" title="interface in rice.p2p.commonapi">Application</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>message</CODE> - The message being sent, containing an internal message
along with a destination key and nodeHandle next hop.
<DT><B>Returns:</B><DD>Whether or not to forward the message further<DT><B>See Also:</B><DD><A HREF="../../../rice/p2p/commonapi/Application.html#forward(rice.p2p.commonapi.RouteMessage)"><CODE>Application.forward(rice.p2p.commonapi.RouteMessage)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="deliver(rice.p2p.commonapi.Id, rice.p2p.commonapi.Message)"><!-- --></A><H3>
deliver</H3>
<PRE>
public void <B>deliver</B>(<A HREF="../../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;id,
<A HREF="../../../rice/p2p/commonapi/Message.html" title="interface in rice.p2p.commonapi">Message</A>&nbsp;message)</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../rice/p2p/commonapi/Application.html#deliver(rice.p2p.commonapi.Id, rice.p2p.commonapi.Message)">Application</A></CODE></B></DD>
<DD>This method is called on the application at the destination node
for the given id.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../rice/p2p/commonapi/Application.html#deliver(rice.p2p.commonapi.Id, rice.p2p.commonapi.Message)">deliver</A></CODE> in interface <CODE><A HREF="../../../rice/p2p/commonapi/Application.html" title="interface in rice.p2p.commonapi">Application</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - The destination id of the message<DD><CODE>message</CODE> - The message being sent</DL>
</DD>
</DL>
<HR>
<A NAME="update(rice.p2p.commonapi.NodeHandle, boolean)"><!-- --></A><H3>
update</H3>
<PRE>
public void <B>update</B>(<A HREF="../../../rice/p2p/commonapi/NodeHandle.html" title="class in rice.p2p.commonapi">NodeHandle</A>&nbsp;handle,
boolean&nbsp;joined)</PRE>
<DL>
<DD><B>Description copied from interface: <CODE><A HREF="../../../rice/p2p/commonapi/Application.html#update(rice.p2p.commonapi.NodeHandle, boolean)">Application</A></CODE></B></DD>
<DD>This method is invoked to inform the application that the given node
has either joined or left the neighbor set of the local node, as the set
would be returned by the neighborSet call.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../rice/p2p/commonapi/Application.html#update(rice.p2p.commonapi.NodeHandle, boolean)">update</A></CODE> in interface <CODE><A HREF="../../../rice/p2p/commonapi/Application.html" title="interface in rice.p2p.commonapi">Application</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>handle</CODE> - The handle that has joined/left<DD><CODE>joined</CODE> - Whether the node has joined or left</DL>
</DD>
</DL>
<HR>
<A NAME="requestNodeHandles(rice.p2p.commonapi.Id, int, rice.Continuation)"><!-- --></A><H3>
requestNodeHandles</H3>
<PRE>
public void <B>requestNodeHandles</B>(<A HREF="../../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;id,
int&nbsp;num,
<A HREF="../../../rice/Continuation.html" title="interface in rice">Continuation</A>&lt;<A HREF="../../../rice/p2p/commonapi/NodeHandleSet.html" title="interface in rice.p2p.commonapi">NodeHandleSet</A>,java.lang.Exception&gt;&nbsp;cont)</PRE>
<DL>
<DD>Requests a replicaSet from a node across the ring. This method will return
via its continuation the set of <tt>num</tt> NodeHandles that are in
<tt>id</tt>'s replicaSet. Calling requestNodeHandles with a <tt>num</tt>
of 1 will return the node currently responsible for Id id.
If there is a network problem or the Id of interest is not currently owned
by any node (for example due to churn in the overlay), the continuation
will receive a NodeLookupTimeoutException.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - the Id of interest<DD><CODE>num</CODE> - the number of nodes to return<DD><CODE>cont</CODE> - the continuation to return the result to</DL>
</DD>
</DL>
<HR>
<A NAME="sendMessageWithRetries(rice.p2p.commonapi.Id, int, rice.Continuation)"><!-- --></A><H3>
sendMessageWithRetries</H3>
<PRE>
protected void <B>sendMessageWithRetries</B>(<A HREF="../../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;id,
int&nbsp;num,
<A HREF="../../../rice/Continuation.html" title="interface in rice">Continuation</A>&lt;<A HREF="../../../rice/p2p/commonapi/NodeHandleSet.html" title="interface in rice.p2p.commonapi">NodeHandleSet</A>,java.lang.Exception&gt;&nbsp;cont)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="sendMessage(int, rice.p2p.commonapi.Id, int, rice.Continuation, long)"><!-- --></A><H3>
sendMessage</H3>
<PRE>
protected void <B>sendMessage</B>(int&nbsp;seq,
<A HREF="../../../rice/p2p/commonapi/Id.html" title="interface in rice.p2p.commonapi">Id</A>&nbsp;id,
int&nbsp;num,
<A HREF="../../../rice/Continuation.html" title="interface in rice">Continuation</A>&lt;<A HREF="../../../rice/p2p/commonapi/NodeHandleSet.html" title="interface in rice.p2p.commonapi">NodeHandleSet</A>,java.lang.Exception&gt;&nbsp;cont,
long&nbsp;timeout)</PRE>
<DL>
<DD>This does the internal processing for requestNodeHandle(s). It adds the
continuation to the pending table, updates the sequence number, schedules
this timeout, and finally sends the actual message.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - the Id of interest<DD><CODE>num</CODE> - the number of nodes to return<DD><CODE>cont</CODE> - the continuation to return the result to</DL>
</DD>
</DL>
<HR>
<A NAME="requestNodeHandle(rice.p2p.commonapi.Id, rice.Continuation)"><!-- --></A><H3>
requestNodeHandle</H3>
<PRE>
public void <B>requestNodeHandle</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>&lt;<A HREF="../../../rice/p2p/commonapi/NodeHandle.html" title="class in rice.p2p.commonapi">NodeHandle</A>,java.lang.Exception&gt;&nbsp;cont)</PRE>
<DL>
<DD>Find the primary replica of a key. This is the node with the Id closest to
the key in pastry. This method will return via its continuation the
NodeHandle that is closest to <tt>id</tt>.
If there is a network problem or the Id of interest is not currently owned
by any node (for example due to churn in the overlay), the continuation
will receive a NodeLookupTimeoutException.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - the Id of interest<DD><CODE>cont</CODE> - the continuation to return the result to</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/LookupService.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;PREV CLASS&nbsp;
&nbsp;<A HREF="../../../rice/tutorial/lookup/LookupService.NodeLookupQuery.html" title="class in rice.tutorial.lookup"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?rice/tutorial/lookup/LookupService.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="LookupService.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;<A HREF="#nested_class_summary">NESTED</A>&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>