Search in sources :

Example 1 with EventHubNamespace

use of com.microsoft.azure.management.eventhub.EventHubNamespace in project azure-tools-for-java by Microsoft.

the class CreateFunctionForm method getEventHubNameSpaces.

private List<EventHubNamespace> getEventHubNameSpaces() {
    if (eventHubNamespaces == null) {
        eventHubNamespaces = new ArrayList<>();
        final List<Subscription> subs = az(AzureAccount.class).account().getSelectedSubscriptions();
        for (final Subscription subscriptionId : subs) {
            final Azure azure = AuthMethodManager.getInstance().getAzureClient(subscriptionId.getId());
            final PagedList<EventHubNamespace> pagedList = azure.eventHubNamespaces().list();
            pagedList.loadAll();
            eventHubNamespaces.addAll(pagedList);
            eventHubNamespaces.sort(Comparator.comparing(HasName::name));
        }
    }
    return eventHubNamespaces;
}
Also used : EventHubNamespace(com.microsoft.azure.management.eventhub.EventHubNamespace) Azure(com.microsoft.azure.management.Azure) Subscription(com.microsoft.azure.toolkit.lib.common.model.Subscription)

Example 2 with EventHubNamespace

use of com.microsoft.azure.management.eventhub.EventHubNamespace in project azure-tools-for-java by microsoft.

the class CreateFunctionForm method getEventHubNameSpaces.

private List<EventHubNamespace> getEventHubNameSpaces() {
    if (eventHubNamespaces == null) {
        eventHubNamespaces = new ArrayList<>();
        final List<Subscription> subs = az(AzureAccount.class).account().getSelectedSubscriptions();
        for (final Subscription subscriptionId : subs) {
            final Azure azure = AuthMethodManager.getInstance().getAzureClient(subscriptionId.getId());
            final PagedList<EventHubNamespace> pagedList = azure.eventHubNamespaces().list();
            pagedList.loadAll();
            eventHubNamespaces.addAll(pagedList);
            eventHubNamespaces.sort(Comparator.comparing(HasName::name));
        }
    }
    return eventHubNamespaces;
}
Also used : EventHubNamespace(com.microsoft.azure.management.eventhub.EventHubNamespace) Azure(com.microsoft.azure.management.Azure) Subscription(com.microsoft.azure.toolkit.lib.common.model.Subscription)

Aggregations

Azure (com.microsoft.azure.management.Azure)2 EventHubNamespace (com.microsoft.azure.management.eventhub.EventHubNamespace)2 Subscription (com.microsoft.azure.toolkit.lib.common.model.Subscription)2