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

📄 discoveryservice.html

📁 jxta的api库
💻 HTML
📖 第 1 页 / 共 4 页
字号:
</DL><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getRemoteAdvertisements(java.lang.String, int, java.lang.String, java.lang.String, int)"><!-- --></A><H3>getRemoteAdvertisements</H3><PRE>public int <B>getRemoteAdvertisements</B>(java.lang.String&nbsp;peerid,                                   int&nbsp;type,                                   java.lang.String&nbsp;attribute,                                   java.lang.String&nbsp;value,                                   int&nbsp;threshold)</PRE><DL><DD>This method discovers PeerAdvertisements, GroupAdvertisements and other  jxta Advertisements. jxta Advertisements are documents that describe pipes,  services, etc. The discovery scope can be narrowed down firstly by Name and  Value pair where the match is an exact match, secondly by setting a upper  limit where the responding peer will not exceed. Discovery can be performed  in two ways 1. by specifying a null peerid, the discovery message is  propagated on the local sub-net utilizing ip multicast. In addition to the  multicast it is also propagated to rendezvous points. 2. by passing a  peerid, the EndpointRouter will attempt to resolve destination peer's  endpoints or route the message to other routers in attempt to reach the  peer.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>peerid</CODE> - id of a peer, specifying null results in a propagate      within the group<DD><CODE>type</CODE> - Discovery type PEER, GROUP, ADV<DD><CODE>attribute</CODE> - attribute name to narrow disocvery to Valid values for      this parameter are null (don't care), or exact element name in the      advertisement of interest (e.g. "Name")<DD><CODE>value</CODE> - value of attribute to narrow disocvery to valid values for      this parameter are null (don't care), Exact value, or use of wild      card(s) (e.g. if a Advertisement defines <Name>FooBar</name> , a value      of "*bar", "foo*", or "*ooB*", will return the Advertisement<DD><CODE>threshold</CODE> - the upper limit of responses from one peer        threshold of 0, and type od PEER has a special behaviour        peers respond with own adv only.<DT><B>Returns:</B><DD>query ID for this discovery query</DL></DD></DL><HR><A NAME="getRemoteAdvertisements(java.lang.String, int, java.lang.String, java.lang.String, int, net.jxta.discovery.DiscoveryListener)"><!-- --></A><H3>getRemoteAdvertisements</H3><PRE>public int <B>getRemoteAdvertisements</B>(java.lang.String&nbsp;peerid,                                   int&nbsp;type,                                   java.lang.String&nbsp;attribute,                                   java.lang.String&nbsp;value,                                   int&nbsp;threshold,                                   <A HREF="../../../net/jxta/discovery/DiscoveryListener.html" title="interface in net.jxta.discovery">DiscoveryListener</A>&nbsp;listener)</PRE><DL><DD>This method discovers PeerAdvertisements, GroupAdvertisements and jxta  Advertisements. jxta Advertisements are documents that describe pipes,  services, etc. The discovery scope can be narrowed down firstly by Name and  Value pair where the match is an exact match, secondly by setting a upper  limit where the responding peer will not exceed. DiscoveryServiceImpl can  be performed in two ways 1. by specifying a null peerid, the discovery  message is propagated on the local sub-net utilizing ip multicast. In  addition to the multicast it is also propagated to rendezvous points. 2. by  passing a peerid, the EndpointRouter will attempt to resolve destination  peer's endpoints or route the message to other routers in attempt to reach  the peer.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>attribute</CODE> - attribute name to narrow disocvery to Valid values for      this parameter are null (don't care), or exact element name in the      advertisement of interest (e.g. "Name")<DD><CODE>value</CODE> - value of attribute to narrow disocvery to valid values for      this parameter are null (don't care), Exact value, or use of wild      card(s) (e.g. if a Advertisement defines <Name>FooBar</name> , a value      of "*bar", "foo*", or "*ooB*", will return the Advertisement<DD><CODE>threshold</CODE> - the upper limit of responses from one peer        threshold of 0, and type od PEER has a special behaviour<DD><CODE>peerid</CODE> - id of a peer, specifying null results in a propagate      within the group<DD><CODE>type</CODE> - Discovery type PEER, GROUP, ADV<DD><CODE>listener</CODE> - the listener which will be called back with found      advertisements.<DT><B>Returns:</B><DD>query ID for this discovery query</DL></DD></DL><HR><A NAME="getLocalAdvertisements(int, java.lang.String, java.lang.String)"><!-- --></A><H3>getLocalAdvertisements</H3><PRE>public java.util.Enumeration <B>getLocalAdvertisements</B>(int&nbsp;type,                                                    java.lang.String&nbsp;attribute,                                                    java.lang.String&nbsp;value)                                             throws java.io.IOException</PRE><DL><DD>Retrieve Stored Peer, Group, and General Advertisements<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>type</CODE> - Discovery type PEER, GROUP, ADV<DD><CODE>attribute</CODE> - attribute name to narrow disocvery to Valid values      for this parameter are null (don't care), or exact element name in the      advertisement of interest (e.g. "Name")<DD><CODE>value</CODE> - value of attribute to narrow disocvery to valid      values for this parameter are null (don't care), Exact value, or use of      wild card(s) (e.g. if a Advertisement defines <Name>FooBar</name> , a      value of "*bar", "foo*", or "*ooB*", will return the Advertisement<DT><B>Returns:</B><DD>Enumeration of stored advertisements/structured      documents<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - - If an I/O error occurs</DL></DD></DL><HR><A NAME="publish(net.jxta.document.Advertisement)"><!-- --></A><H3>publish</H3><PRE>public void <B>publish</B>(<A HREF="../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A>&nbsp;advertisement)             throws java.io.IOException</PRE><DL><DD>Publish an advertisement with a default lifetime of <code>  DEFAULT_LIFETIME</code> and default expiration time for "others" of <code>DEFAULT_EXPIRATION</code>  Advertisement indexes are shared with a rendezvous peer upon connect,  and subsequent publications are shared at a an implementation specified interval<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>advertisement</CODE> - publish an adverisement within this group<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - - If an I/O error occurs</DL></DD></DL><HR><A NAME="publish(net.jxta.document.Advertisement, int)"><!-- --></A><H3>publish</H3><PRE>public void <B>publish</B>(<A HREF="../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A>&nbsp;advertisement,                    int&nbsp;type)             throws java.io.IOException</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>Advertisement type is no longer required to publish an advertisement</I><P><DD>Publish an advertisement with a default lifetime of <code>  DEFAULT_LIFETIME</code> and default expiration time for "others" of <code>DEFAULT_EXPIRATION</code>  Advertisement indexes are shared with a rendezvous peer upon connect,  and subsequent publications are shared at a an implementation specified interval<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>advertisement</CODE> - publish an adverisement within this group<DD><CODE>type</CODE> - Discovery type PEER, GROUP, ADV<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - - If an I/O error occurs</DL></DD></DL><HR><A NAME="publish(net.jxta.document.Advertisement, long, long)"><!-- --></A><H3>publish</H3><PRE>public void <B>publish</B>(<A HREF="../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A>&nbsp;adv,                    long&nbsp;lifetime,                    long&nbsp;lifetimeForOthers)             throws java.io.IOException</PRE><DL><DD>Publish an advertisement that will expire after a certain time. A node that  finds this advertisement will hold it for about <i> lifetimeForOthers</i>  milliseconds, or <i>lifetime</i> whichever is smaller  Advertisement indexes are shared with a rendezvous peer upon connect,  and subsequent publications are shared at  an implementation specified interval<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>lifetime</CODE> - the amount of time this advertisement will live in      my cache in milliseconds<DD><CODE>lifetimeForOthers</CODE> - the amount of time this advertisement will live in      other people's caches in milliseconds.<DD><CODE>adv</CODE> - advertisement to publish<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - - If an I/O error occurs</DL></DD></DL><HR><A NAME="publish(net.jxta.document.Advertisement, int, long, long)"><!-- --></A><H3>publish</H3><PRE>public void <B>publish</B>(<A HREF="../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A>&nbsp;adv,                    int&nbsp;type,                    long&nbsp;lifetime,                    long&nbsp;lifetimeForOthers)             throws java.io.IOException</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>Advertisement type is no longer required to publish an advertisement</I><P><DD>Publish an advertisement that will expire after a certain time. A node that  finds this advertisement will hold it for about <i> lifetimeForOthers</i>  milliseconds, or <i>lifetime</i> whichever is smaller  Advertisement indexes are shared with a rendezvous peer upon connect,  and subsequent publications are shared at an implementation specified interval<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>type</CODE> - Discovery type PEER, GROUP, ADV<DD><CODE>lifetime</CODE> - the amount of time this advertisement will live in      my cache in milliseconds<DD><CODE>lifetimeForOthers</CODE> - the amount of time this advertisement will live in      other people's caches in milliseconds.<DD><CODE>adv</CODE> - advertisement to publish<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - - If an I/O error occurs</DL></DD></DL><HR><A NAME="remotePublish(net.jxta.document.Advertisement, int)"><!-- --></A><H3>remotePublish</H3><PRE>public void <B>remotePublish</B>(<A HREF="../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A>&nbsp;adv,                          int&nbsp;type)</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>Advertisement type is no longer required to remote publish an advertisement</I><P><DD>Remote Publish an advertisement will attempt to remote publish adv on all  configured transports, the Advertisement will carry a lifetime of  Expiration time, or lifetime whichever is smaller<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>type</CODE> - Discovery type PEER, GROUP, ADV<DD><CODE>adv</CODE> - advertisement to publish</DL></DD></DL><HR><A NAME="remotePublish(net.jxta.document.Advertisement)"><!-- --></A><H3>remotePublish</H3><PRE>public void <B>remotePublish</B>(<A HREF="../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A>&nbsp;adv)</PRE><DL><DD>Remote Publish an advertisement will attempt to remote publish adv on all  configured transports, the Advertisement will carry a lifetime of  Expiration time, or lifetime whichever is smaller<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>adv</CODE> - advertisement to publish</DL></DD></DL><HR><A NAME="remotePublish(net.jxta.document.Advertisement, int, long)"><!-- --></A><H3>remotePublish</H3><PRE>public void <B>remotePublish</B>(<A HREF="../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A>&nbsp;adv,                          int&nbsp;type,                          long&nbsp;lifetime)</PRE><DL><DD><B>Deprecated.</B>&nbsp;<I>Advertisement type is no longer required to remote publish an advertisement</I><P><DD>Remote Publish an advertisement will attempt to remote publish adv on all  configured transports, the Advertisement will carry a a expiration of <i>  lifetime</i><P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>type</CODE> - Discovery type PEER, GROUP, ADV<DD><CODE>lifetime</CODE> - the amount of time to advise other nodes to hold this      advertisement in their caches.<DD><CODE>adv</CODE> - advertisement to publish</DL></DD></DL><HR><A NAME="remotePublish(net.jxta.document.Advertisement, long)"><!-- --></A><H3>remotePublish</H3><PRE>public void <B>remotePublish</B>(<A HREF="../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A>&nbsp;adv,                          long&nbsp;lifetime)</PRE><DL><DD>Remote Publish an advertisement will attempt to remote publish adv on all  configured transports, the Advertisement will carry a a expiration of <i>  lifetime</i><P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>lifetime</CODE> - the amount of time to advise other nodes to hold this      advertisement in their caches.<DD><CODE>adv</CODE> - advertisement to publish</DL></DD></DL><HR><A NAME="remotePublish(java.lang.String, net.jxta.document.Advertisement, int)"><!-- --></A><H3>remotePublish</H3>

⌨️ 快捷键说明

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