⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 srdi.html

📁 jxta的api库
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><TITLE>Srdi (Project JXTA J2SE)</TITLE><META NAME="keywords" CONTENT="net.jxta.impl.cm.Srdi class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){    parent.document.title="Srdi (Project JXTA J2SE)";}</SCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 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/Srdi.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><a href='http://www.jxta.org' target='_blank'>Project JXTA</a></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../../net/jxta/impl/cm/Indexer.SearchCallback.html" title="class in net.jxta.impl.cm"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../../net/jxta/impl/cm/SrdiCache.html" title="class in net.jxta.impl.cm"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Srdi.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;<A HREF="#field_summary">FIELD</A>&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;<A HREF="#field_detail">FIELD</A>&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">net.jxta.impl.cm</FONT><BR>Class Srdi</H2><PRE>java.lang.Object  <IMG SRC="../../../../resources/inherit.gif" ALT="extended by"><B>net.jxta.impl.cm.Srdi</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD>java.util.EventListener, <A HREF="../../../../net/jxta/rendezvous/RendezvousListener.html" title="interface in net.jxta.rendezvous">RendezvousListener</A>, java.lang.Runnable</DD></DL><HR><DL><DT>public class <B>Srdi</B><DT>extends java.lang.Object<DT>implements java.lang.Runnable, <A HREF="../../../../net/jxta/rendezvous/RendezvousListener.html" title="interface in net.jxta.rendezvous">RendezvousListener</A></DL><P>Srdi is a service which provides Srdi functionalities such as : <ul>  <li>pushing of Srdi messages to a another peer/propagate</li>  <li>replication of an Srdi Message to other peers in q given peerview</li>  <li>given an expression Srdi provides a independantly calculated starting point</li>  <li>Forwarding a ResolverQuery, and taking care of hopCount, random selection</li>  <li>registers with the RendezvousService to determine when to share Srdi Entries</li>    and whether to push deltas, or full a index</li>  <li>provides a SrdiInterface giving to provide a generic  srdi message definintion</li> </ul> <p/>If Srdi is started as a thread it performs periodic srdi pushes of indecies and also has the ability to respond to rendezvous events. <p/>ResolverSrdiMessages define a ttl, to indicate to the receiving service whether to replicate such message or not. <p/>In addition A ResolverQuery defines a hopCount to indicate how many hops a query has been forwarded. This element could be used to detect/stop a query forward loopback hopCount is checked to make ensure a query is not forwarded more than twice.<P><P><DL><DT><B>See Also:</B><DD><a href="http://spec.jxta.org/nonav/v1.0/docbook/JXTAProtocols.html#proto-prp" target="_blank">JXTA Protocols Specification : Peer Resolver Protocol</a></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"><TD COLSPAN=2><FONT SIZE="+2"><B>Nested Class Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;interface</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/cm/Srdi.SrdiInterface.html" title="interface in net.jxta.impl.cm">Srdi.SrdiInterface</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Interface for pushing entries.</TD></TR></TABLE>&nbsp;<!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/cm/Srdi.html#RPV_REPLICATION_THRESHOLD">RPV_REPLICATION_THRESHOLD</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../net/jxta/impl/cm/Srdi.html#Srdi(net.jxta.peergroup.PeerGroup, java.lang.String, net.jxta.impl.cm.Srdi.SrdiInterface, net.jxta.impl.cm.SrdiIndex, long, long)">Srdi</A></B>(<A HREF="../../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A>&nbsp;group,     java.lang.String&nbsp;handlername,     <A HREF="../../../../net/jxta/impl/cm/Srdi.SrdiInterface.html" title="interface in net.jxta.impl.cm">Srdi.SrdiInterface</A>&nbsp;srdiService,     <A HREF="../../../../net/jxta/impl/cm/SrdiIndex.html" title="class in net.jxta.impl.cm">SrdiIndex</A>&nbsp;srdiIndex,     long&nbsp;connectPollInterval,     long&nbsp;pushInterval)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Starts the Srdi Service. wait for connectPollInterval prior to  pushing the index if connected to a rdv, otherwise index is  as soon as the Rendezvous connect occurs</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"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected static&nbsp;<A HREF="../../../../net/jxta/peer/PeerID.html" title="class in net.jxta.peer">PeerID</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/cm/Srdi.html#createPeerID(java.lang.String)">createPeerID</A></B>(java.lang.String&nbsp;id)</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="../../../../net/jxta/impl/cm/Srdi.html#forwardQuery(java.lang.Object, net.jxta.protocol.ResolverQueryMsg)">forwardQuery</A></B>(java.lang.Object&nbsp;peer,             <A HREF="../../../../net/jxta/protocol/ResolverQueryMsg.html" title="class in net.jxta.protocol">ResolverQueryMsg</A>&nbsp;query)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Forwards a Query to a specific peer  hopCount is incremented to indicate this query is forwarded</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="../../../../net/jxta/impl/cm/Srdi.html#forwardQuery(java.util.Vector, net.jxta.protocol.ResolverQueryMsg)">forwardQuery</A></B>(java.util.Vector&nbsp;peers,             <A HREF="../../../../net/jxta/protocol/ResolverQueryMsg.html" title="class in net.jxta.protocol">ResolverQueryMsg</A>&nbsp;query)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Forwards a Query to a list of peers  hopCount is incremented to indicate this query is forwarded</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="../../../../net/jxta/impl/cm/Srdi.html#forwardQuery(java.util.Vector, net.jxta.protocol.ResolverQueryMsg, int)">forwardQuery</A></B>(java.util.Vector&nbsp;peers,             <A HREF="../../../../net/jxta/protocol/ResolverQueryMsg.html" title="class in net.jxta.protocol">ResolverQueryMsg</A>&nbsp;query,             int&nbsp;threshold)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Forwards a Query to a list of peers if the list of peers exceeds threshold, and random threshold is picked from <code>peers</code> hopCount is incremented to indicate this query is forwarded</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="../../../../net/jxta/impl/cm/Srdi.html#forwardSrdiMessage(net.jxta.peer.PeerID, net.jxta.peer.PeerID, java.lang.String, java.lang.String, java.lang.String, long)">forwardSrdiMessage</A></B>(<A HREF="../../../../net/jxta/peer/PeerID.html" title="class in net.jxta.peer">PeerID</A>&nbsp;peerid,                   <A HREF="../../../../net/jxta/peer/PeerID.html" title="class in net.jxta.peer">PeerID</A>&nbsp;srcPid,                   java.lang.String&nbsp;primaryKey,                   java.lang.String&nbsp;secondarykey,                   java.lang.String&nbsp;value,                   long&nbsp;expiration)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;forward srdi message to another peer</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.util.Vector</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/cm/Srdi.html#getGlobalPeerView()">getGlobalPeerView</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;get the global peerview as the rendezvous service only returns the peerview without the local RDV peer.  </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../net/jxta/peer/PeerID.html" title="class in net.jxta.peer">PeerID</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/cm/Srdi.html#getReplicaPeer(java.lang.String)">getReplicaPeer</A></B>(java.lang.String&nbsp;expression)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Given an expression return a peer from the list peers in the peerview  this function is used to to give a replication point, and entry point  to query on a pipe</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="../../../../net/jxta/impl/cm/Srdi.html#pushSrdi(java.lang.String, net.jxta.protocol.SrdiMessage)">pushSrdi</A></B>(java.lang.String&nbsp;peer,         <A HREF="../../../../net/jxta/protocol/SrdiMessage.html" title="class in net.jxta.protocol">SrdiMessage</A>&nbsp;srdi)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Push an SRDI message to a peer  ttl is 1, and therefore services receiving this message could  choose to replicate this message</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;java.util.Vector</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/cm/Srdi.html#randomResult(java.util.Vector, int)">randomResult</A></B>(java.util.Vector&nbsp;result,             int&nbsp;threshold)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;returns a random vector(threshold) from a given vector</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="../../../../net/jxta/impl/cm/Srdi.html#rendezvousEvent(net.jxta.rendezvous.RendezvousEvent)">rendezvousEvent</A></B>(<A HREF="../../../../net/jxta/rendezvous/RendezvousEvent.html" title="class in net.jxta.rendezvous">RendezvousEvent</A>&nbsp;event)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rendezvousEvent the rendezvous event</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="../../../../net/jxta/impl/cm/Srdi.html#replicateEntries(net.jxta.protocol.SrdiMessage)">replicateEntries</A></B>(<A HREF="../../../../net/jxta/protocol/SrdiMessage.html" title="class in net.jxta.protocol">SrdiMessage</A>&nbsp;srdiMsg)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Replicates a SRDI messge to other rendezvous' entries are replicated by breaking out entries out of the message and sorted out into rdv distribution bins. after which smaller messages are sent to other rdv's</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="../../../../net/jxta/impl/cm/Srdi.html#run()">run</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Main processing method for the SRDI Worker thread  Send all entries, wait for pushInterval, then send deltas</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="../../../../net/jxta/impl/cm/Srdi.html#stop()">stop</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stop the current running thread</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"><TD><B>Methods inherited from class java.lang.Object</B></TD></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><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -