Created
May 8, 2017 13:28
-
-
Save mehdok/2e89bd9a43a4030df92a6cf245a705b1 to your computer and use it in GitHub Desktop.
Getting list of ServiceInfos with Microsoft ADAL v2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DiscoveryClient discoveryClient = | |
new DiscoveryClient(Constants.DISCOVERY_RESOURCE_URL, dependencyResolver); | |
try { | |
ListenableFuture<List<ServiceInfo>> services = discoveryClient.getServices().read(); | |
Futures.addCallback(services, new FutureCallback<List<ServiceInfo>>() { | |
@Override | |
public void onSuccess(List<ServiceInfo> serviceInfos) { | |
mServices = serviceInfos; | |
} | |
@Override | |
public void onFailure(@NonNull Throwable throwable) { | |
Log.e("discoverServices", throwable.getMessage()); | |
} | |
}); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment