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

📄 discoveryserviceimpl.html

📁 jxta的api库
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/discovery/DiscoveryServiceImpl.html#getAdvExpirationTime(net.jxta.id.ID, int)">getAdvExpirationTime</A></B>(<A HREF="../../../../net/jxta/id/ID.html" title="class in net.jxta.id">ID</A>&nbsp;id,                     int&nbsp;type)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/discovery/DiscoveryServiceImpl.html#getAdvLifeTime(net.jxta.document.Advertisement)">getAdvLifeTime</A></B>(<A HREF="../../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A>&nbsp;adv)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the maximum duration in milliseconds for which this document  should be kept in local cache</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;long</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/discovery/DiscoveryServiceImpl.html#getAdvLifeTime(net.jxta.id.ID, int)">getAdvLifeTime</A></B>(<A HREF="../../../../net/jxta/id/ID.html" title="class in net.jxta.id">ID</A>&nbsp;id,               int&nbsp;type)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the maximum duration in milliseconds for which this document  should be kept in local cache</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/discovery/DiscoveryServiceImpl.html#getGroup()">getGroup</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the group to which this service is attached.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/discovery/DiscoveryServiceImpl.html#getImplAdvertisement()">getImplAdvertisement</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the advertisment for this service.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../../net/jxta/service/Service.html" title="interface in net.jxta.service">Service</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/discovery/DiscoveryServiceImpl.html#getInterface()">getInterface</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Service objects are not manipulated directly to protect usage of the service. A Service interface is returned to access the service methods.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.util.Enumeration</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/discovery/DiscoveryServiceImpl.html#getLocalAdvertisements(int, java.lang.String, java.lang.String)">getLocalAdvertisements</A></B>(int&nbsp;type,                       java.lang.String&nbsp;attribute,                       java.lang.String&nbsp;value)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieve Stored Peer, Group, and General Advertisements</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/discovery/DiscoveryServiceImpl.html#getRemoteAdvertisements(java.lang.String, int, java.lang.String, java.lang.String, int)">getRemoteAdvertisements</A></B>(java.lang.String&nbsp;peer,                        int&nbsp;type,                        java.lang.String&nbsp;attribute,                        java.lang.String&nbsp;value,                        int&nbsp;threshold)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/discovery/DiscoveryServiceImpl.html#getRemoteAdvertisements(java.lang.String, int, java.lang.String, java.lang.String, int, net.jxta.discovery.DiscoveryListener)">getRemoteAdvertisements</A></B>(java.lang.String&nbsp;peer,                        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)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</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/discovery/DiscoveryServiceImpl.html#init(net.jxta.peergroup.PeerGroup, net.jxta.id.ID, net.jxta.document.Advertisement)">init</A></B>(<A HREF="../../../../net/jxta/peergroup/PeerGroup.html" title="interface in net.jxta.peergroup">PeerGroup</A>&nbsp;pg,     <A HREF="../../../../net/jxta/id/ID.html" title="class in net.jxta.id">ID</A>&nbsp;assignedID,     <A HREF="../../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A>&nbsp;impl)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initialize the module, passing it its peer group and advertisement.  <p/>Note: when subclassing one of the existing PeerGroup implementations (which implement Module), it may not be recommended to overload the init method. See the documentation of the PeerGroup class being subclassed.</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/discovery/DiscoveryServiceImpl.html#messageSendFailed(net.jxta.peer.PeerID, net.jxta.endpoint.OutgoingMessageEvent)">messageSendFailed</A></B>(<A HREF="../../../../net/jxta/peer/PeerID.html" title="class in net.jxta.peer">PeerID</A>&nbsp;peerid,                  <A HREF="../../../../net/jxta/endpoint/OutgoingMessageEvent.html" title="class in net.jxta.endpoint">OutgoingMessageEvent</A>&nbsp;e)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Resolver calls this method when a failure to send a message to specified  peer occurs</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../net/jxta/impl/discovery/DiscoveryServiceImpl.html#processQuery(net.jxta.protocol.ResolverQueryMsg)">processQuery</A></B>(<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;Process the resolver query, and generate response it is the responsibilty of the handler to send the response <p/><pre> result = processIncommingQuery(query); if (result != null) {   resolver.sendResponse(query.getSrc(), response);   return ResolverService.OK;  } else return ResolverService.Repropagate; </pre></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/discovery/DiscoveryServiceImpl.html#processResponse(net.jxta.protocol.ResolverResponseMsg)">processResponse</A></B>(<A HREF="../../../../net/jxta/protocol/ResolverResponseMsg.html" title="class in net.jxta.protocol">ResolverResponseMsg</A>&nbsp;response)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called when messages are received by the ResolverService it calls back this method to deal with received responses</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="../../../../net/jxta/impl/discovery/DiscoveryServiceImpl.html#processSrdi(net.jxta.protocol.ResolverSrdiMsg)">processSrdi</A></B>(<A HREF="../../../../net/jxta/protocol/ResolverSrdiMsg.html" title="class in net.jxta.protocol">ResolverSrdiMsg</A>&nbsp;message)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Process the SrdiMessage message, returns true if the message was  processed properly</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/discovery/DiscoveryServiceImpl.html#publish(net.jxta.document.Advertisement)">publish</A></B>(<A HREF="../../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A>&nbsp;adv)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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</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/discovery/DiscoveryServiceImpl.html#publish(net.jxta.document.Advertisement, int)">publish</A></B>(<A HREF="../../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A>&nbsp;adv,        int&nbsp;type)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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</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/discovery/DiscoveryServiceImpl.html#publish(net.jxta.document.Advertisement, int, long, long)">publish</A></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;expiration)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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</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/discovery/DiscoveryServiceImpl.html#publish(net.jxta.document.Advertisement, long, long)">publish</A></B>(<A HREF="../../../../net/jxta/document/Advertisement.html" title="class in net.jxta.document">Advertisement</A>&nbsp;adv,        long&nbsp;lifetime,        long&nbsp;expiration)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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</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/discovery/DiscoveryServiceImpl.html#pushEntries(boolean)">pushEntries</A></B>(boolean&nbsp;all)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Pushe SRDI entries.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;void</CODE></FONT></TD>

⌨️ 快捷键说明

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