Search in sources :

Example 6 with ServiceBusNamespace

use of com.microsoft.azure.management.servicebus.ServiceBusNamespace in project azure-sdk-for-java by Azure.

the class ServiceBusNamespaceImpl method createResourceAsync.

@Override
public Observable<ServiceBusNamespace> createResourceAsync() {
    Completable createNamespaceCompletable = this.manager().inner().namespaces().createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()).map(new Func1<NamespaceInner, NamespaceInner>() {

        @Override
        public NamespaceInner call(NamespaceInner inner) {
            setInner(inner);
            return inner;
        }
    }).toCompletable();
    Completable childrenOperationsCompletable = submitChildrenOperationsAsync();
    final ServiceBusNamespace self = this;
    return Completable.concat(createNamespaceCompletable, childrenOperationsCompletable).doOnTerminate(new Action0() {

        @Override
        public void call() {
            initChildrenOperationsCache();
        }
    }).andThen(Observable.just(self));
}
Also used : Completable(rx.Completable) Action0(rx.functions.Action0) ServiceBusNamespace(com.microsoft.azure.management.servicebus.ServiceBusNamespace) Func1(rx.functions.Func1)

Aggregations

ServiceBusNamespace (com.microsoft.azure.management.servicebus.ServiceBusNamespace)6 AuthorizationKeys (com.microsoft.azure.management.servicebus.AuthorizationKeys)5 NamespaceAuthorizationRule (com.microsoft.azure.management.servicebus.NamespaceAuthorizationRule)5 Configuration (com.microsoft.windowsazure.Configuration)5 ServiceBusConfiguration (com.microsoft.windowsazure.services.servicebus.ServiceBusConfiguration)5 ServiceBusContract (com.microsoft.windowsazure.services.servicebus.ServiceBusContract)5 BrokeredMessage (com.microsoft.windowsazure.services.servicebus.models.BrokeredMessage)5 Queue (com.microsoft.azure.management.servicebus.Queue)3 ServiceBusSubscription (com.microsoft.azure.management.servicebus.ServiceBusSubscription)3 Topic (com.microsoft.azure.management.servicebus.Topic)3 Period (org.joda.time.Period)2 TopicAuthorizationRule (com.microsoft.azure.management.servicebus.TopicAuthorizationRule)1 Completable (rx.Completable)1 Action0 (rx.functions.Action0)1 Func1 (rx.functions.Func1)1