All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.microsoft.azure.toolkit.lib.servicebus.ServiceBusNamespaceSubscription Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 */

package com.microsoft.azure.toolkit.lib.servicebus;

import com.azure.resourcemanager.servicebus.ServiceBusManager;
import com.microsoft.azure.toolkit.lib.common.model.AbstractAzResourceModule;
import com.microsoft.azure.toolkit.lib.common.model.AbstractAzServiceSubscription;
import com.microsoft.azure.toolkit.lib.common.model.Region;
import lombok.Getter;

import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;

@Getter
public class ServiceBusNamespaceSubscription extends AbstractAzServiceSubscription {
    @Nonnull
    private final String subscriptionId;
    @Nonnull
    private final ServiceBusNamespaceModule serviceBusNamespaceModule;

    protected ServiceBusNamespaceSubscription(@Nonnull String subscriptionId, @Nonnull AzureServiceBusNamespace service) {
        super(subscriptionId, service);
        this.subscriptionId = subscriptionId;
        this.serviceBusNamespaceModule = new ServiceBusNamespaceModule(this);
    }

    protected ServiceBusNamespaceSubscription(@Nonnull ServiceBusManager manager, @Nonnull AzureServiceBusNamespace service) {
        this(manager.serviceClient().getSubscriptionId(), service);
    }

    @Nonnull
    @Override
    public List> getSubModules() {
        return Collections.singletonList(serviceBusNamespaceModule);
    }

    @Override
    public List listSupportedRegions(@Nonnull String resourceType) {
        return super.listSupportedRegions(this.serviceBusNamespaceModule.getName());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy