public boolean serverSupportsFeatures(Collection<? extends CharSequence> features) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return supportsFeatures(connection().getXMPPServiceDomain(), features); }
/** * Find all services under the users service that provide a given feature. * * @param feature the feature to search for * @param stopOnFirst if true, stop searching after the first service was found * @param useCache if true, query a cache first to avoid network I/O * @param encounteredExceptions an optional map which will be filled with the exceptions encountered * @return a possible empty list of services providing the given feature * @throws NoResponseException * @throws XMPPErrorException * @throws NotConnectedException * @throws InterruptedException * @since 4.2.2 */ public List<DiscoverInfo> findServicesDiscoverInfo(String feature, boolean stopOnFirst, boolean useCache, Map<? super Jid, Exception> encounteredExceptions) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { DomainBareJid serviceName = connection().getXMPPServiceDomain(); return findServicesDiscoverInfo(serviceName, feature, stopOnFirst, useCache, encounteredExceptions); }
/** * Check if the given collection of features are supported by the connection account. This means that the discovery * information lookup will be performed on the bare JID of the connection managed by this ServiceDiscoveryManager. * * @param features a collection of features * @return <code>true</code> if all features are supported by the connection account, <code>false</code> otherwise * @throws NoResponseException * @throws XMPPErrorException * @throws NotConnectedException * @throws InterruptedException * @since 4.2.2 */ public boolean accountSupportsFeatures(Collection<? extends CharSequence> features) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { EntityBareJid accountJid = connection().getUser().asEntityBareJid(); return supportsFeatures(accountJid, features); }
/** * Returns the discovered items of a given XMPP entity addressed by its JID and * note attribute. Use this message only when trying to query information which is not * directly addressable. * * @param entityID the address of the XMPP entity. * @param node the optional attribute that supplements the 'jid' attribute. * @return the discovered items. * @throws XMPPErrorException if the operation failed for some reason. * @throws NoResponseException if there was no response from the server. * @throws NotConnectedException * @throws InterruptedException */ public DiscoverItems discoverItems(Jid entityID, String node) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { // Discover the entity's items DiscoverItems disco = new DiscoverItems(); disco.setType(IQ.Type.get); disco.setTo(entityID); disco.setNode(node); Stanza result = connection().createStanzaCollectorAndSend(disco).nextResultOrThrow(); return (DiscoverItems) result; }
/** * Returns the discovered information of a given XMPP entity addressed by its JID and * note attribute. Use this message only when trying to query information which is not * directly addressable. * * @see <a href="http://xmpp.org/extensions/xep-0030.html#info-basic">XEP-30 Basic Protocol</a> * @see <a href="http://xmpp.org/extensions/xep-0030.html#info-nodes">XEP-30 Info Nodes</a> * * @param entityID the address of the XMPP entity. * @param node the optional attribute that supplements the 'jid' attribute. * @return the discovered information. * @throws XMPPErrorException if the operation failed for some reason. * @throws NoResponseException if there was no response from the server. * @throws NotConnectedException * @throws InterruptedException */ public DiscoverInfo discoverInfo(Jid entityID, String node) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { // Discover the entity's info DiscoverInfo disco = new DiscoverInfo(); disco.setType(IQ.Type.get); disco.setTo(entityID); disco.setNode(node); Stanza result = connection().createStanzaCollectorAndSend(disco).nextResultOrThrow(); return (DiscoverInfo) result; }