?? srdi.html
字號:
<!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> </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="class-use/Srdi.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </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><a href='http://www.jxta.org' target='_blank'>Project JXTA</a></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../net/jxta/impl/cm/Indexer.SearchCallback.html" title="class in net.jxta.impl.cm"><B>PREV CLASS</B></A> <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> <A HREF="Srdi.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> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <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 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> Interface for pushing entries.</TD></TR></TABLE> <!-- =========== 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 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> </TD></TR></TABLE> <!-- ======== 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> group, java.lang.String handlername, <A HREF="../../../../net/jxta/impl/cm/Srdi.SrdiInterface.html" title="interface in net.jxta.impl.cm">Srdi.SrdiInterface</A> srdiService, <A HREF="../../../../net/jxta/impl/cm/SrdiIndex.html" title="class in net.jxta.impl.cm">SrdiIndex</A> srdiIndex, long connectPollInterval, long pushInterval)</CODE><BR> 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> <!-- ========== 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 <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 id)</CODE><BR> </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="../../../../net/jxta/impl/cm/Srdi.html#forwardQuery(java.lang.Object, net.jxta.protocol.ResolverQueryMsg)">forwardQuery</A></B>(java.lang.Object peer, <A HREF="../../../../net/jxta/protocol/ResolverQueryMsg.html" title="class in net.jxta.protocol">ResolverQueryMsg</A> query)</CODE><BR> 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> 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 peers, <A HREF="../../../../net/jxta/protocol/ResolverQueryMsg.html" title="class in net.jxta.protocol">ResolverQueryMsg</A> query)</CODE><BR> 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> 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 peers, <A HREF="../../../../net/jxta/protocol/ResolverQueryMsg.html" title="class in net.jxta.protocol">ResolverQueryMsg</A> query, int threshold)</CODE><BR> 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> 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> peerid, <A HREF="../../../../net/jxta/peer/PeerID.html" title="class in net.jxta.peer">PeerID</A> srcPid, java.lang.String primaryKey, java.lang.String secondarykey, java.lang.String value, long expiration)</CODE><BR> forward srdi message to another peer</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.util.Vector</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/cm/Srdi.html#getGlobalPeerView()">getGlobalPeerView</A></B>()</CODE><BR> 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> <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 expression)</CODE><BR> 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> 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 peer, <A HREF="../../../../net/jxta/protocol/SrdiMessage.html" title="class in net.jxta.protocol">SrdiMessage</A> srdi)</CODE><BR> 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 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 result, int threshold)</CODE><BR> 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> 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> event)</CODE><BR> rendezvousEvent the rendezvous event</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="../../../../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> srdiMsg)</CODE><BR> 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> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/cm/Srdi.html#run()">run</A></B>()</CODE><BR> 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> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/cm/Srdi.html#stop()">stop</A></B>()</CODE><BR> stop the current running thread</TD></TR></TABLE> <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> <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 + -