use of com.microsoft.azuretools.core.mvp.model.container.pojo.Catalog in project azure-tools-for-java by Microsoft.
the class ContainerRegistryPropertyViewPresenter method onListRepositories.
/**
* Called when listing repositories of ACR.
*/
public void onListRepositories(String sid, String id, boolean isNextPage) {
if (isSubscriptionIdAndResourceIdInValid(sid, id)) {
return;
}
resetTagStack();
Observable.fromCallable(() -> {
Registry registry = ContainerRegistryMvpModel.getInstance().getContainerRegistry(sid, id);
PrivateRegistryImageSetting setting = ContainerRegistryMvpModel.getInstance().createImageSettingWithRegistry(registry);
Map<String, String> query = buildQueryMap(isNextPage, repoStack, nextRepo);
Map<String, String> responseMap = ContainerExplorerMvpModel.getInstance().listRepositories(registry.loginServerUrl(), setting.getUsername(), setting.getPassword(), query);
updatePaginationInfo(isNextPage, Type.REPO, responseMap.get(HEADER_LINK));
Gson gson = new Gson();
Catalog catalog = gson.fromJson(responseMap.get(BODY), Catalog.class);
return catalog.getRepositories();
}).subscribeOn(getSchedulerProvider().io()).subscribe(repos -> DefaultLoader.getIdeHelper().invokeLater(() -> {
if (isViewDetached()) {
return;
}
getMvpView().listRepo(repos);
}), e -> errorHandler(CANNOT_GET_REPOS, (Exception) e));
}
Aggregations