📄 discoveryserviceinterface.html
字号:
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><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/discovery/DiscoveryService.html#getRemoteAdvertisements(java.lang.String, int, java.lang.String, java.lang.String, int)">getRemoteAdvertisements</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/discovery/DiscoveryService.html" title="interface in net.jxta.discovery">DiscoveryService</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>peer</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 peer, int type, java.lang.String attribute, java.lang.String value, int threshold, <A HREF="../../../../net/jxta/discovery/DiscoveryListener.html" title="interface in net.jxta.discovery">DiscoveryListener</A> 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><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/discovery/DiscoveryService.html#getRemoteAdvertisements(java.lang.String, int, java.lang.String, java.lang.String, int, net.jxta.discovery.DiscoveryListener)">getRemoteAdvertisements</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/discovery/DiscoveryService.html" title="interface in net.jxta.discovery">DiscoveryService</A></CODE></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>peer</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 type, java.lang.String attribute, java.lang.String value) throws java.io.IOException</PRE><DL><DD>Retrieve Stored Peer, Group, and General Advertisements<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/discovery/DiscoveryService.html#getLocalAdvertisements(int, java.lang.String, java.lang.String)">getLocalAdvertisements</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/discovery/DiscoveryService.html" title="interface in net.jxta.discovery">DiscoveryService</A></CODE></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="flushAdvertisement(net.jxta.document.Advertisement)"><!-- --></A><H3>flushAdvertisement</H3><PRE>public void <B>flushAdvertisement</B>(<A HREF="../../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A> adv) throws java.io.IOException</PRE><DL><DD>flush a stored Advertisement<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/discovery/DiscoveryService.html#flushAdvertisement(net.jxta.document.Advertisement)">flushAdvertisement</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/discovery/DiscoveryService.html" title="interface in net.jxta.discovery">DiscoveryService</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>adv</CODE> - Advertisement to remove<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - - If an I/O error occurs</DL></DD></DL><HR><A NAME="flushAdvertisements(java.lang.String, int)"><!-- --></A><H3>flushAdvertisements</H3><PRE>public void <B>flushAdvertisements</B>(java.lang.String id, int type) throws java.io.IOException</PRE><DL><DD>flushs stored Advertisement(s),<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/discovery/DiscoveryService.html#flushAdvertisements(java.lang.String, int)">flushAdvertisements</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/discovery/DiscoveryService.html" title="interface in net.jxta.discovery">DiscoveryService</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>id</CODE> - Document ID, Peer ID, or PeerGroup ID flushs all content of type "type"<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="getAdvExpirationTime(net.jxta.id.ID, int)"><!-- --></A><H3>getAdvExpirationTime</H3><PRE>public long <B>getAdvExpirationTime</B>(<A HREF="../../../../net/jxta/id/ID.html" title="class in net.jxta.id">ID</A> id, int type)</PRE><DL><DD>Returns the maximum duration in milliseconds for which this document should be cached by those other than the publisher. This value is either the cache lifetime or the remaining lifetime of the document, whichever is less.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/discovery/DiscoveryService.html#getAdvExpirationTime(net.jxta.id.ID, int)">getAdvExpirationTime</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/discovery/DiscoveryService.html" title="interface in net.jxta.discovery">DiscoveryService</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>id</CODE> - Document ID, Peer ID, or PeerGroup ID<DD><CODE>type</CODE> - Discovery type PEER, GROUP, ADV<DT><B>Returns:</B><DD>the relative time in milliseconds at which remote peers should refresh this document. -1 is returned if the file is not known or already expired</DL></DD></DL><HR><A NAME="getAdvLifeTime(net.jxta.id.ID, int)"><!-- --></A><H3>getAdvLifeTime</H3><PRE>public long <B>getAdvLifeTime</B>(<A HREF="../../../../net/jxta/id/ID.html" title="class in net.jxta.id">ID</A> id, int type)</PRE><DL><DD>Returns the maximum duration in milliseconds for which this document should be kept in local cache<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/discovery/DiscoveryService.html#getAdvLifeTime(net.jxta.id.ID, int)">getAdvLifeTime</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/discovery/DiscoveryService.html" title="interface in net.jxta.discovery">DiscoveryService</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>id</CODE> - Document ID, Peer ID, or PeerGroup ID<DD><CODE>type</CODE> - Discovery type PEER, GROUP, ADV<DT><B>Returns:</B><DD>the relative time in milliseconds at which remote peers should refresh this document. -1 is returned if the file is not known or already expired</DL></DD></DL><HR><A NAME="getAdvExpirationTime(net.jxta.document.Advertisement)"><!-- --></A><H3>getAdvExpirationTime</H3><PRE>public long <B>getAdvExpirationTime</B>(<A HREF="../../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A> adv)</PRE><DL><DD>Returns the maximum duration in milliseconds for which this document should be cached by those other than the publisher. This value is either the cache lifetime or the remaining lifetime of the document, whichever is less.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/discovery/DiscoveryService.html#getAdvExpirationTime(net.jxta.document.Advertisement)">getAdvExpirationTime</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/discovery/DiscoveryService.html" title="interface in net.jxta.discovery">DiscoveryService</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>adv</CODE> - Advertisement<DT><B>Returns:</B><DD>the relative time in milliseconds at which remote peers should refresh this document. -1 is returned if the file is not known or already expired</DL></DD></DL><HR><A NAME="getAdvLifeTime(net.jxta.document.Advertisement)"><!-- --></A><H3>getAdvLifeTime</H3><PRE>public long <B>getAdvLifeTime</B>(<A HREF="../../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A> adv)</PRE><DL><DD>Returns the maximum duration in milliseconds for which this document should be kept in local cache<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/discovery/DiscoveryService.html#getAdvLifeTime(net.jxta.document.Advertisement)">getAdvLifeTime</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/discovery/DiscoveryService.html" title="interface in net.jxta.discovery">DiscoveryService</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>adv</CODE> - Advertisement<DT><B>Returns:</B><DD>the relative time in milliseconds at which remote peers should refresh this document. -1 is returned if the file is not known or already expired</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> adv, int type) 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><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../net/jxta/discovery/DiscoveryService.html#publish(net.jxta.document.Advertisement, int)">publish</A></CODE> in interface <CODE><A HREF="../../../../net/jxta/discovery/DiscoveryService.html" title="interface in net.jxta.discovery">DiscoveryService</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>adv</CODE> - publish an adverisement within this group<DD><CODE>type</CODE> - Discovery type PEER, GROUP, ADV
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -