private static String toConnectionString(EventHubNamespace eventHubNamespace) { return eventHubNamespace.listAuthorizationRules().stream().findFirst().map(AuthorizationRule::getKeys) .map(EventHubAuthorizationKey::primaryConnectionString).orElseThrow( () -> new EventHubRuntimeException( String.format("Failed to fetch connection string of namespace '%s'", eventHubNamespace.name()), null)); }
@Override public Page<ChildT> nextPage(String nextPageLink) throws RestException, IOException { if (nextPageLink.equalsIgnoreCase(switchToCousin)) { // Reached end of current child paged list, make next child list(cousin) as current // paged list and return it's first page. currentChildList = nextChildList(); return childListPage(currentChildList.currentPage()); } else { currentChildList.loadNextPage(); return childListPage(currentChildList.currentPage()); } } };
/** * Creates ChildListFlattener. * * @param parentList a paged list of parents * @param childListLoader {@link ChildListLoader} for fetching child paged list associated any parent */ ChildListFlattener(PagedList<ParentT> parentList, ChildListLoader<ParentT, ChildT> childListLoader) { this.parentItr = parentList.iterator(); this.childListLoader = childListLoader; }
if (uList == null || uList.isEmpty()) { return new PagedList<V>() { @Override Page<U> uPage = uList.currentPage(); final PageImpl<V> vPage = new PageImpl<>(); vPage.setNextPageLink(uPage.nextPageLink());
@Override public Azure withDefaultSubscription() throws CloudException, IOException { if (this.defaultSubscription != null) { return withSubscription(this.defaultSubscription); } else { PagedList<Subscription> subs = this.subscriptions().list(); if (!subs.isEmpty()) { return withSubscription(subs.get(0).subscriptionId()); } else { return withSubscription(null); } } } }
if (keyVaultClient.listSecrets(vaultUri).size() > 0 && certVault.hostName != null && !certVault.hostName.isEmpty()) { keyVaultClient.setSecret(new SetSecretRequest.Builder(vaultUri, SECRETENTRY_DOCKERHOSTNAMES, certVault.hostName).build()); } else {
if (!locations.contains(location)) { try { if (!azureClient.virtualMachines().sizes().listByRegion(location).isEmpty()) { locations.add(location);
/** * flatten the child paged lists. * * @return the lazy flattened paged list from the child paged lists * @throws CloudException exceptions thrown from the cloud * @throws IOException exceptions thrown from serialization/deserialization */ public PagedList<ChildT> flatten() { this.currentChildList = nextChildList(); if (this.currentChildList == null) { return emptyPagedList(); } return new PagedList<ChildT>(childListPage(currentChildList.currentPage())) { @Override public Page<ChildT> nextPage(String nextPageLink) throws RestException, IOException { if (nextPageLink.equalsIgnoreCase(switchToCousin)) { // Reached end of current child paged list, make next child list(cousin) as current // paged list and return it's first page. currentChildList = nextChildList(); return childListPage(currentChildList.currentPage()); } else { currentChildList.loadNextPage(); return childListPage(currentChildList.currentPage()); } } }; }
@Override public Page<V> nextPage(String nextPageLink) throws RestException, IOException { Page<U> uPage = uList.nextPage(nextPageLink); final PageImpl<V> vPage = new PageImpl<>(); vPage.setNextPageLink(uPage.nextPageLink()); vPage.setItems(new ArrayList<V>()); loadConvertedList(uPage, vPage); return vPage; } };
if (uList == null || uList.isEmpty()) { return new PagedList<V>() { @Override Page<U> uPage = uList.currentPage(); final PageImpl<V> vPage = new PageImpl<>(); vPage.setNextPageLink(uPage.nextPageLink());
@Override public Azure withDefaultSubscription() throws CloudException, IOException { if (this.defaultSubscription != null) { return withSubscription(this.defaultSubscription); } else { PagedList<Subscription> subs = this.subscriptions().list(); if (!subs.isEmpty()) { return withSubscription(subs.get(0).subscriptionId()); } else { return withSubscription(null); } } } }
|| StringUtils.isEmpty(imageVersion)) && images.size() > 0) {
/** * flatten the child paged lists. * * @return the lazy flattened paged list from the child paged lists * @throws CloudException exceptions thrown from the cloud * @throws IOException exceptions thrown from serialization/deserialization */ public PagedList<ChildT> flatten() { this.currentChildList = nextChildList(); if (this.currentChildList == null) { return emptyPagedList(); } return new PagedList<ChildT>(childListPage(currentChildList.currentPage())) { @Override public Page<ChildT> nextPage(String nextPageLink) throws RestException, IOException { if (nextPageLink.equalsIgnoreCase(switchToCousin)) { // Reached end of current child paged list, make next child list(cousin) as current // paged list and return it's first page. currentChildList = nextChildList(); return childListPage(currentChildList.currentPage()); } else { currentChildList.loadNextPage(); return childListPage(currentChildList.currentPage()); } } }; }
@Override public Page<V> nextPage(String nextPageLink) throws RestException, IOException { Page<U> uPage = uList.nextPage(nextPageLink); final PageImpl<V> vPage = new PageImpl<>(); vPage.setNextPageLink(uPage.nextPageLink()); vPage.setItems(new ArrayList<V>()); loadConvertedList(uPage, vPage); return vPage; } };
private static String toConnectionString(EventHubNamespace eventHubNamespace) { return eventHubNamespace.listAuthorizationRules().stream().findFirst().map(AuthorizationRule::getKeys) .map(EventHubAuthorizationKey::primaryConnectionString).orElseThrow( () -> new EventHubRuntimeException( String.format("Failed to fetch connection string of namespace '%s'", eventHubNamespace.name()), null)); }
if (uList == null || uList.isEmpty()) { return new PagedList<V>() { @Override Page<U> uPage = uList.currentPage(); final PageImpl<V> vPage = new PageImpl<>(); vPage.setNextPageLink(uPage.nextPageLink());
@Test public void canListSubscriptions() throws Exception { PagedList<Subscription> subscriptions = resourceManager.subscriptions().list(); Assert.assertTrue(subscriptions.size() > 0); }
@Override public Page<ChildT> nextPage(String nextPageLink) throws RestException, IOException { if (nextPageLink.equalsIgnoreCase(switchToCousin)) { // Reached end of current child paged list, make next child list(cousin) as current // paged list and return it's first page. currentChildList = nextChildList(); return childListPage(currentChildList.currentPage()); } else { currentChildList.loadNextPage(); return childListPage(currentChildList.currentPage()); } } };