use of com.microsoft.azure.toolkit.lib.common.cache.Preloader in project azure-maven-plugins by microsoft.
the class Account method selectSubscription.
public void selectSubscription(List<String> selectedSubscriptionIds) {
requireAuthenticated();
if (CollectionUtils.isEmpty(selectedSubscriptionIds)) {
throw new IllegalArgumentException("You must select at least one subscription.");
}
if (CollectionUtils.isEmpty(getSubscriptions())) {
throw new IllegalArgumentException("There are no subscriptions to select.");
}
if (entity.getSubscriptions().stream().anyMatch(s -> Utils.containsIgnoreCase(selectedSubscriptionIds, s.getId()))) {
selectSubscriptionInner(this.getSubscriptions(), selectedSubscriptionIds);
final AzureTaskManager manager = AzureTaskManager.getInstance();
if (Objects.nonNull(manager)) {
manager.runOnPooledThread(Preloader::load);
}
} else {
throw new AzureToolkitAuthenticationException("no subscriptions are selected, " + "make sure you have provided valid subscription list");
}
}
Aggregations