public DomainBareJid findService(String feature, boolean useCache) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return findService(feature, useCache, null, null); }
/** * Returns the address of the multiple recipients service. To obtain such address service * discovery is going to be used on the connected server and if none was found then another * attempt will be tried on the server items. The discovered information is going to be * cached for 24 hours. * * @param connection the connection to use for disco. The connected server is going to be * queried. * @return the address of the multiple recipients service or <tt>null</tt> if none was found. * @throws NoResponseException if there was no response from the server. * @throws XMPPErrorException * @throws NotConnectedException * @throws InterruptedException */ private static DomainBareJid getMultipleRecipientServiceAddress(XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection); return sdm.findService(MultipleAddresses.NAMESPACE, true); }
/** * Get the "default" PubSub service for a given XMPP connection. The default PubSub service is * simply an arbitrary XMPP service with the PubSub feature and an identity of category "pubsub" * and type "service". * * @param connection * @return the default PubSub service or <code>null</code>. * @throws NoResponseException * @throws XMPPErrorException * @throws NotConnectedException * @throws InterruptedException * @see <a href="http://xmpp.org/extensions/xep-0060.html#entity-features">XEP-60 § 5.1 Discover * Features</a> */ public static DomainBareJid getPubSubService(XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return ServiceDiscoveryManager.getInstanceFor(connection).findService(PubSub.NAMESPACE, true, "pubsub", "service"); } }