Skip to content

Instantly share code, notes, and snippets.

@mehdok
Created May 8, 2017 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mehdok/2e89bd9a43a4030df92a6cf245a705b1 to your computer and use it in GitHub Desktop.
Save mehdok/2e89bd9a43a4030df92a6cf245a705b1 to your computer and use it in GitHub Desktop.
Getting list of ServiceInfos with Microsoft ADAL v2
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