mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-18 16:47:58 +01:00
Add findServicesDiscoverInfo() with service argument
to ServiceDiscoveryManager.
This commit is contained in:
parent
31244ae982
commit
2065a7ed01
1 changed files with 22 additions and 1 deletions
|
@ -793,8 +793,29 @@ public final class ServiceDiscoveryManager extends Manager {
|
||||||
*/
|
*/
|
||||||
public List<DiscoverInfo> findServicesDiscoverInfo(String feature, boolean stopOnFirst, boolean useCache, Map<? super Jid, Exception> encounteredExceptions)
|
public List<DiscoverInfo> findServicesDiscoverInfo(String feature, boolean stopOnFirst, boolean useCache, Map<? super Jid, Exception> encounteredExceptions)
|
||||||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||||
List<DiscoverInfo> serviceDiscoInfo;
|
|
||||||
DomainBareJid serviceName = connection().getXMPPServiceDomain();
|
DomainBareJid serviceName = connection().getXMPPServiceDomain();
|
||||||
|
return findServicesDiscoverInfo(serviceName, feature, stopOnFirst, useCache, encounteredExceptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find all services under a given service that provide a given feature.
|
||||||
|
*
|
||||||
|
* @param serviceName the service to query
|
||||||
|
* @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.3.0
|
||||||
|
*/
|
||||||
|
public List<DiscoverInfo> findServicesDiscoverInfo(DomainBareJid serviceName, String feature, boolean stopOnFirst,
|
||||||
|
boolean useCache, Map<? super Jid, Exception> encounteredExceptions)
|
||||||
|
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||||
|
List<DiscoverInfo> serviceDiscoInfo;
|
||||||
if (useCache) {
|
if (useCache) {
|
||||||
serviceDiscoInfo = services.lookup(feature);
|
serviceDiscoInfo = services.lookup(feature);
|
||||||
if (serviceDiscoInfo != null) {
|
if (serviceDiscoInfo != null) {
|
||||||
|
|
Loading…
Reference in a new issue