From bb9b68e81f924752f66e4179c6641002967c70e2 Mon Sep 17 00:00:00 2001 From: Jianghao Lu Date: Fri, 23 Sep 2016 11:14:28 -0700 Subject: [PATCH 1/2] [#1078] Add async delete support --- .../implementation/BatchAccountsImpl.java | 10 ++--- .../implementation/AvailabilitySetsImpl.java | 11 ++--- .../VirtualMachineScaleSetsImpl.java | 11 ++--- .../implementation/VirtualMachinesImpl.java | 10 ++--- .../graphrbac/ServicePrincipals.java | 3 +- .../azure/management/graphrbac/Users.java | 3 +- .../implementation/ServicePrincipalsImpl.java | 5 --- .../graphrbac/implementation/UsersImpl.java | 5 --- .../keyvault/implementation/VaultsImpl.java | 10 ++--- .../implementation/LoadBalancersImpl.java | 10 ++--- .../implementation/NetworkInterfacesImpl.java | 10 ++--- .../NetworkSecurityGroupsImpl.java | 10 ++--- .../network/implementation/NetworksImpl.java | 10 ++--- .../implementation/PublicIpAddressesImpl.java | 10 ++--- .../redis/implementation/RedisCachesImpl.java | 10 ++--- .../collection/SupportsDeletingByGroup.java | 20 +++++++++ .../CreatableResourcesImpl.java | 21 ++++++++- .../GroupableResourcesImpl.java | 30 ++++++++++++- .../collection/SupportsDeleting.java | 18 ++++++++ .../implementation/DeploymentsImpl.java | 43 +++++++++++++++++-- .../implementation/GenericResourcesImpl.java | 9 +++- .../implementation/ResourceGroupsImpl.java | 5 ++- .../implementation/StorageAccountsImpl.java | 10 ++--- 23 files changed, 176 insertions(+), 108 deletions(-) diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsImpl.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsImpl.java index ea8c2fefd4c0c..341163cee8df7 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsImpl.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsImpl.java @@ -7,6 +7,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; import com.microsoft.azure.management.storage.implementation.StorageManager; +import rx.Observable; /** * Implementation for BatchAccounts and its parent interfaces. @@ -27,13 +28,8 @@ protected BatchAccountsImpl(BatchAccountsInner innerCollection, BatchManager man } @Override - public void delete(String id) { - delete(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - - @Override - public void delete(String groupName, String name) { - this.innerCollection.delete(groupName, name); + public Observable deleteAsync(String groupName, String name) { + return this.innerCollection.deleteAsync(groupName, name); } @Override diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsImpl.java index 43b7ebc68a971..f592173d1ba07 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsImpl.java @@ -9,9 +9,9 @@ import com.microsoft.azure.management.apigeneration.LangDefinition; import com.microsoft.azure.management.compute.AvailabilitySet; import com.microsoft.azure.management.compute.AvailabilitySets; -import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; import com.microsoft.azure.management.resources.fluentcore.arm.models.implementation.GroupPagedList; +import rx.Observable; import java.util.List; @@ -61,13 +61,8 @@ public AvailabilitySetImpl define(String name) { } @Override - public void delete(String id) { - delete(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - - @Override - public void delete(String groupName, String name) { - this.innerCollection.delete(groupName, name); + public Observable deleteAsync(String groupName, String name) { + return this.innerCollection.deleteAsync(groupName, name); } /************************************************************** diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java index 5bed8a37ce2d9..3b234f9d4de27 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java @@ -13,6 +13,8 @@ import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; import com.microsoft.azure.management.storage.implementation.StorageManager; +import rx.Observable; + import java.util.ArrayList; /** @@ -55,13 +57,8 @@ public PagedList list() { } @Override - public void delete(String id) { - this.delete(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - - @Override - public void delete(String groupName, String name) { - this.innerCollection.delete(groupName, name); + public Observable deleteAsync(String groupName, String name) { + return this.innerCollection.deleteAsync(groupName, name); } @Override diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java index 810d9aa250011..abdaefa25547f 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java @@ -22,6 +22,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; import com.microsoft.azure.management.storage.implementation.StorageManager; +import rx.Observable; import rx.exceptions.Exceptions; import java.util.ArrayList; @@ -74,13 +75,8 @@ public VirtualMachine getByGroup(String groupName, String name) { } @Override - public void delete(String id) { - delete(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - - @Override - public void delete(String groupName, String name) { - this.innerCollection.delete(groupName, name); + public Observable deleteAsync(String groupName, String name) { + return this.innerCollection.deleteAsync(groupName, name); } @Override diff --git a/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/ServicePrincipals.java b/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/ServicePrincipals.java index 8dd433fa34a1d..0aaaad5bbd61e 100644 --- a/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/ServicePrincipals.java +++ b/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/ServicePrincipals.java @@ -18,8 +18,7 @@ */ public interface ServicePrincipals extends SupportsCreating, - SupportsListing, - SupportsDeleting { + SupportsListing { /** * Gets the information about a service principal. * diff --git a/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/Users.java b/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/Users.java index 6697418f0b0c9..e2dd820e1aee9 100644 --- a/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/Users.java +++ b/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/Users.java @@ -18,8 +18,7 @@ */ public interface Users extends SupportsCreating, - SupportsListing, - SupportsDeleting { + SupportsListing{ /** * Gets the information about a user. * diff --git a/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/implementation/ServicePrincipalsImpl.java b/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/implementation/ServicePrincipalsImpl.java index ede66beea7fb3..421449ff024f7 100644 --- a/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/implementation/ServicePrincipalsImpl.java +++ b/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/implementation/ServicePrincipalsImpl.java @@ -44,11 +44,6 @@ public PagedList list() { return wrapList(this.innerCollection.list()); } - @Override - public void delete(String id) { - innerCollection.delete(id); - } - @Override public ServicePrincipalImpl define(String appId) { return wrapModel(appId); diff --git a/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/implementation/UsersImpl.java b/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/implementation/UsersImpl.java index 6487b0f191e87..82b18c165be29 100644 --- a/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/implementation/UsersImpl.java +++ b/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/implementation/UsersImpl.java @@ -40,11 +40,6 @@ public PagedList list() { return wrapList(this.innerCollection.list()); } - @Override - public void delete(String id) { - innerCollection.delete(id); - } - @Override public UserImpl define(String name) { return wrapModel(name); diff --git a/azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/implementation/VaultsImpl.java b/azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/implementation/VaultsImpl.java index 2bc06369a87f6..e9e9fd0e649ca 100644 --- a/azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/implementation/VaultsImpl.java +++ b/azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/implementation/VaultsImpl.java @@ -14,6 +14,7 @@ import com.microsoft.azure.management.keyvault.Vaults; import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; +import rx.Observable; import java.util.UUID; @@ -57,13 +58,8 @@ public Vault getByGroup(String groupName, String name) { } @Override - public void delete(String id) { - delete(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - - @Override - public void delete(String groupName, String name) { - this.innerCollection.delete(groupName, name); + public Observable deleteAsync(String groupName, String name) { + return this.innerCollection.deleteAsync(groupName, name); } @Override diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersImpl.java index a6b53be72d760..f7fdcfd9f5048 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersImpl.java @@ -11,6 +11,7 @@ import com.microsoft.azure.management.network.LoadBalancers; import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; +import rx.Observable; /** * Implementation for {@link LoadBalancers}. @@ -47,13 +48,8 @@ public LoadBalancerImpl getByGroup(String groupName, String name) { } @Override - public void delete(String id) { - delete(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - - @Override - public void delete(String groupName, String name) { - this.innerCollection.delete(groupName, name); + public Observable deleteAsync(String groupName, String name) { + return this.innerCollection.deleteAsync(groupName, name); } @Override diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesImpl.java index b3e3ece746abd..7b8703b5e1ca0 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesImpl.java @@ -7,6 +7,7 @@ import com.microsoft.azure.management.network.NetworkInterfaces; import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; +import rx.Observable; import java.util.ArrayList; @@ -45,13 +46,8 @@ public NetworkInterface getByGroup(String groupName, String name) { } @Override - public void delete(String id) { - this.delete(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - - @Override - public void delete(String groupName, String name) { - this.innerCollection.delete(groupName, name); + public Observable deleteAsync(String groupName, String name) { + return this.innerCollection.deleteAsync(groupName, name); } @Override diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsImpl.java index 56cde273e9423..fcd221d7892e3 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsImpl.java @@ -11,6 +11,7 @@ import com.microsoft.azure.management.network.NetworkSecurityGroups; import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; +import rx.Observable; import java.util.ArrayList; @@ -49,13 +50,8 @@ public NetworkSecurityGroupImpl getByGroup(String groupName, String name) { } @Override - public void delete(String id) { - delete(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - - @Override - public void delete(String groupName, String name) { - this.innerCollection.delete(groupName, name); + public Observable deleteAsync(String groupName, String name) { + return this.innerCollection.deleteAsync(groupName, name); } @Override diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworksImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworksImpl.java index a72b9a2cd25b7..d38354a18c7b0 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworksImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworksImpl.java @@ -13,6 +13,7 @@ import com.microsoft.azure.management.network.Networks; import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; +import rx.Observable; import java.util.ArrayList; @@ -51,13 +52,8 @@ public NetworkImpl getByGroup(String groupName, String name) { } @Override - public void delete(String id) { - delete(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - - @Override - public void delete(String groupName, String name) { - this.innerCollection.delete(groupName, name); + public Observable deleteAsync(String groupName, String name) { + return this.innerCollection.deleteAsync(groupName, name); } @Override diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressesImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressesImpl.java index f2f738ca09da5..c5b9eb4309287 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressesImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressesImpl.java @@ -12,6 +12,7 @@ import com.microsoft.azure.management.apigeneration.LangDefinition; import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; +import rx.Observable; /** * Implementation for {@link PublicIpAddresses}. @@ -48,13 +49,8 @@ public PublicIpAddressImpl getByGroup(String groupName, String name) { } @Override - public void delete(String id) { - delete(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - - @Override - public void delete(String groupName, String name) { - this.innerCollection.delete(groupName, name); + public Observable deleteAsync(String groupName, String name) { + return this.innerCollection.deleteAsync(groupName, name); } @Override diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisCachesImpl.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisCachesImpl.java index 8bc144b6fbe20..1ac17aab4bf88 100644 --- a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisCachesImpl.java +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisCachesImpl.java @@ -12,6 +12,7 @@ import com.microsoft.azure.management.redis.RedisCaches; import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; +import rx.Observable; /** * The implementation of RedisCaches and its parent interfaces. @@ -52,13 +53,8 @@ public RedisCache getByGroup(String groupName, String name) { } @Override - public void delete(String id) { - delete(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - - @Override - public void delete(String groupName, String name) { - this.innerCollection.delete(groupName, name); + public Observable deleteAsync(String groupName, String name) { + return this.innerCollection.deleteAsync(groupName, name); } @Override diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/SupportsDeletingByGroup.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/SupportsDeletingByGroup.java index 6dacc8134db55..f11577bf867b6 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/SupportsDeletingByGroup.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/SupportsDeletingByGroup.java @@ -8,6 +8,9 @@ import com.microsoft.azure.management.apigeneration.LangDefinition; import com.microsoft.azure.management.apigeneration.LangDefinition.MethodConversion; +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +import rx.Observable; /** * Provides access to deleting a resource from Azure, identifying it by its name and its resource group. @@ -23,4 +26,21 @@ public interface SupportsDeletingByGroup { * @param name The name of the resource */ void delete(String groupName, String name); + + /** + * Asynchronously delete a resource from Azure, identifying it by its name and its resource group. + * + * @param groupName The group the resource is part of + * @param name The name of the resource + * @param callback the callback to call on success or failure + */ + ServiceCall deleteAsync(String groupName, String name, ServiceCallback callback); + + /** + * Asynchronously delete a resource from Azure, identifying it by its name and its resource group. + * + * @param groupName The group the resource is part of + * @param name The name of the resource + */ + Observable deleteAsync(String groupName, String name); } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/CreatableResourcesImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/CreatableResourcesImpl.java index 6ef863c198987..fe6dc747893bb 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/CreatableResourcesImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/CreatableResourcesImpl.java @@ -3,6 +3,7 @@ import com.microsoft.azure.management.resources.fluentcore.arm.Region; import com.microsoft.azure.management.resources.fluentcore.arm.models.Resource; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsBatchCreation; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; import com.microsoft.azure.management.resources.fluentcore.model.Creatable; import com.microsoft.azure.management.resources.fluentcore.model.CreatedResources; import com.microsoft.azure.management.resources.fluentcore.model.implementation.CreatableUpdatableImpl; @@ -32,7 +33,10 @@ */ public abstract class CreatableResourcesImpl extends CreatableWrappersImpl - implements SupportsBatchCreation { + implements + SupportsBatchCreation, + // Assume anything creatable is deletable + SupportsDeleting { protected CreatableResourcesImpl() { } @@ -100,6 +104,21 @@ public ServiceResponse> call(CreatedResources ts) { }), callback); } + @Override + public void delete(String id) { + deleteAsync(id).toBlocking().subscribe(); + } + + @Override + public ServiceCall deleteAsync(String id, ServiceCallback callback) { + return ServiceCall.create(deleteAsync(id).map(new Func1>() { + @Override + public ServiceResponse call(Void aVoid) { + return new ServiceResponse<>(aVoid, null); + } + }), callback); + } + /** * Implements {@link CreatedResources}. * @param the type of the resources in the batch. diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.java index a73a476717995..79eb3064d1fca 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.java @@ -7,10 +7,17 @@ import com.microsoft.azure.Resource; import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; +import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsDeletingByGroup; import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingByGroup; import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingById; import com.microsoft.azure.management.resources.fluentcore.arm.implementation.ManagerBase; import com.microsoft.azure.management.resources.fluentcore.arm.models.GroupableResource; +import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceResponse; +import rx.Observable; +import rx.functions.Func1; /** * Base class for resource collection classes. @@ -30,7 +37,8 @@ public abstract class GroupableResourcesImpl< extends CreatableResourcesImpl implements SupportsGettingById, - SupportsGettingByGroup { + SupportsGettingByGroup, + SupportsDeletingByGroup { protected final InnerCollectionT innerCollection; protected final ManagerT myManager; @@ -50,4 +58,24 @@ public T getById(String id) { ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); } + + @Override + public void delete(String groupName, String name) { + deleteAsync(groupName, name).toBlocking().subscribe(); + } + + @Override + public ServiceCall deleteAsync(String groupName, String name, ServiceCallback callback) { + return ServiceCall.create(deleteAsync(groupName, name).map(new Func1>() { + @Override + public ServiceResponse call(Void aVoid) { + return new ServiceResponse<>(aVoid, null); + } + }), callback); + } + + @Override + public Observable deleteAsync(String id) { + return deleteAsync(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); + } } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeleting.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeleting.java index 9a1cb1721a05a..12177fd91a38c 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeleting.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeleting.java @@ -7,6 +7,9 @@ package com.microsoft.azure.management.resources.fluentcore.collection; import com.microsoft.azure.management.apigeneration.LangDefinition; +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +import rx.Observable; /** * Provides access to deleting a resource from Azure, identifying it by its resource ID. @@ -21,4 +24,19 @@ public interface SupportsDeleting { * @param id the resource ID of the resource to delete */ void delete(String id); + + /** + * Asynchronously delete a resource from Azure, identifying it by its resource ID. + * + * @param id the resource ID of the resource to delete + * @param callback the callback on success or failure + */ + ServiceCall deleteAsync(String id, ServiceCallback callback); + + /** + * Asynchronously delete a resource from Azure, identifying it by its resource ID. + * + * @param id the resource ID of the resource to delete + */ + Observable deleteAsync(String id); } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentsImpl.java index 3d1a3d252c081..137d58be04dde 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentsImpl.java @@ -13,6 +13,11 @@ import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.models.implementation.GroupPagedList; import com.microsoft.azure.management.resources.fluentcore.utils.PagedListConverter; +import com.microsoft.rest.ServiceCall; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceResponse; +import rx.Observable; +import rx.functions.Func1; import java.util.List; @@ -73,13 +78,23 @@ public Deployment getByGroup(String groupName, String name) { } @Override - public void delete(String id) { - this.delete(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); + public void delete(String groupName, String name) { + deleteAsync(groupName, name).toBlocking().subscribe(); } @Override - public void delete(String groupName, String name) { - client.delete(groupName, name); + public ServiceCall deleteAsync(String groupName, String name, ServiceCallback callback) { + return ServiceCall.create(deleteAsync(groupName, name).map(new Func1>() { + @Override + public ServiceResponse call(Void aVoid) { + return new ServiceResponse<>(aVoid, null); + } + }), callback); + } + + @Override + public Observable deleteAsync(String groupName, String name) { + return client.deleteAsync(groupName, name); } @Override @@ -110,4 +125,24 @@ public Deployment getById(String id) { ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); } + + @Override + public void delete(String id) { + deleteAsync(id).toBlocking().subscribe(); + } + + @Override + public ServiceCall deleteAsync(String id, ServiceCallback callback) { + return ServiceCall.create(deleteAsync(id).map(new Func1>() { + @Override + public ServiceResponse call(Void aVoid) { + return new ServiceResponse<>(aVoid, null); + } + }), callback); + } + + @Override + public Observable deleteAsync(String id) { + return deleteAsync(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); + } } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/GenericResourcesImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/GenericResourcesImpl.java index d079af7d0e265..115c63fc4d00e 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/GenericResourcesImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/GenericResourcesImpl.java @@ -13,6 +13,7 @@ import com.microsoft.azure.management.resources.ResourceGroup; import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; +import rx.Observable; import java.util.List; @@ -167,6 +168,12 @@ protected GenericResourceImpl wrapModel(GenericResourceInner inner) { @Override public GenericResource getByGroup(String groupName, String name) { // Not needed, can't be supported, provided only to satisfy GroupableResourceImpl's requirements - return null; + throw new UnsupportedOperationException("Get just by resource group and name is not supported. Please use other overloads."); + } + + @Override + public Observable deleteAsync(String groupName, String name) { + // Not needed, can't be supported, provided only to satisfy GroupableResourceImpl's requirements + throw new UnsupportedOperationException("Delete just by resource group and name is not supported. Please use other overloads."); } } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsImpl.java index a49210905f2e5..5f0703eb1c285 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsImpl.java @@ -10,6 +10,7 @@ import com.microsoft.azure.management.resources.ResourceGroup; import com.microsoft.azure.management.resources.ResourceGroups; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.CreatableResourcesImpl; +import rx.Observable; /** * The implementation for {@link ResourceGroups} and its parent interfaces. @@ -41,8 +42,8 @@ public ResourceGroupImpl getByName(String name) { } @Override - public void delete(String name) { - client.delete(name); + public Observable deleteAsync(String name) { + return client.deleteAsync(name); } @Override diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsImpl.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsImpl.java index a49f8014aad24..fd352a44cc8ff 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsImpl.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsImpl.java @@ -13,6 +13,7 @@ import com.microsoft.azure.management.storage.SkuName; import com.microsoft.azure.management.storage.StorageAccount; import com.microsoft.azure.management.storage.StorageAccounts; +import rx.Observable; /** * The implementation of StorageAccounts and its parent interfaces. @@ -53,13 +54,8 @@ public StorageAccount getByGroup(String groupName, String name) { } @Override - public void delete(String id) { - delete(ResourceUtils.groupFromResourceId(id), ResourceUtils.nameFromResourceId(id)); - } - - @Override - public void delete(String groupName, String name) { - this.innerCollection.delete(groupName, name); + public Observable deleteAsync(String groupName, String name) { + return this.innerCollection.deleteAsync(groupName, name); } @Override From 6fea931cad22acb3878b3ca76eed3e5625aeb717 Mon Sep 17 00:00:00 2001 From: Jianghao Lu Date: Fri, 23 Sep 2016 13:47:23 -0700 Subject: [PATCH 2/2] Fix checkstyle --- .../management/batch/implementation/BatchAccountsImpl.java | 1 - .../compute/implementation/VirtualMachineScaleSetsImpl.java | 1 - .../management/compute/implementation/VirtualMachinesImpl.java | 1 - .../azure/management/graphrbac/ServicePrincipals.java | 1 - .../java/com/microsoft/azure/management/graphrbac/Users.java | 3 +-- .../azure/management/keyvault/implementation/VaultsImpl.java | 1 - .../management/network/implementation/LoadBalancersImpl.java | 1 - .../network/implementation/NetworkInterfacesImpl.java | 1 - .../network/implementation/NetworkSecurityGroupsImpl.java | 1 - .../azure/management/network/implementation/NetworksImpl.java | 1 - .../network/implementation/PublicIpAddressesImpl.java | 3 +-- .../azure/management/redis/implementation/RedisCachesImpl.java | 1 - .../fluentcore/arm/collection/SupportsDeletingByGroup.java | 2 ++ .../arm/collection/implementation/GroupableResourcesImpl.java | 1 - .../resources/fluentcore/collection/SupportsDeleting.java | 2 ++ .../management/storage/implementation/StorageAccountsImpl.java | 1 - 16 files changed, 6 insertions(+), 16 deletions(-) diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsImpl.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsImpl.java index 341163cee8df7..faa2be0e05dbf 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsImpl.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/BatchAccountsImpl.java @@ -4,7 +4,6 @@ import com.microsoft.azure.management.apigeneration.LangDefinition; import com.microsoft.azure.management.batch.BatchAccount; import com.microsoft.azure.management.batch.BatchAccounts; -import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; import com.microsoft.azure.management.storage.implementation.StorageManager; import rx.Observable; diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java index 3b234f9d4de27..231c6006c9044 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsImpl.java @@ -10,7 +10,6 @@ import com.microsoft.azure.management.compute.VirtualMachineScaleSetVMProfile; import com.microsoft.azure.management.compute.VirtualMachineScaleSets; import com.microsoft.azure.management.network.implementation.NetworkManager; -import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; import com.microsoft.azure.management.storage.implementation.StorageManager; import rx.Observable; diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java index abdaefa25547f..345348399ede4 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java @@ -19,7 +19,6 @@ import com.microsoft.azure.management.compute.VirtualMachineSizes; import com.microsoft.azure.management.compute.VirtualMachines; import com.microsoft.azure.management.network.implementation.NetworkManager; -import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; import com.microsoft.azure.management.storage.implementation.StorageManager; import rx.Observable; diff --git a/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/ServicePrincipals.java b/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/ServicePrincipals.java index 0aaaad5bbd61e..4dd2f518c90b7 100644 --- a/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/ServicePrincipals.java +++ b/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/ServicePrincipals.java @@ -7,7 +7,6 @@ package com.microsoft.azure.management.graphrbac; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback; diff --git a/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/Users.java b/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/Users.java index e2dd820e1aee9..ebca34e5cb840 100644 --- a/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/Users.java +++ b/azure-mgmt-graph-rbac/src/main/java/com/microsoft/azure/management/graphrbac/Users.java @@ -7,7 +7,6 @@ package com.microsoft.azure.management.graphrbac; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing; import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback; @@ -18,7 +17,7 @@ */ public interface Users extends SupportsCreating, - SupportsListing{ + SupportsListing { /** * Gets the information about a user. * diff --git a/azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/implementation/VaultsImpl.java b/azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/implementation/VaultsImpl.java index e9e9fd0e649ca..90a294e6465b2 100644 --- a/azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/implementation/VaultsImpl.java +++ b/azure-mgmt-keyvault/src/main/java/com/microsoft/azure/management/keyvault/implementation/VaultsImpl.java @@ -12,7 +12,6 @@ import com.microsoft.azure.management.keyvault.Vault; import com.microsoft.azure.management.keyvault.VaultProperties; import com.microsoft.azure.management.keyvault.Vaults; -import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; import rx.Observable; diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersImpl.java index f7fdcfd9f5048..adfbe97bca2ab 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersImpl.java @@ -9,7 +9,6 @@ import com.microsoft.azure.management.apigeneration.LangDefinition; import com.microsoft.azure.management.network.LoadBalancer; import com.microsoft.azure.management.network.LoadBalancers; -import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; import rx.Observable; diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesImpl.java index 7b8703b5e1ca0..0b0070de4c400 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesImpl.java @@ -5,7 +5,6 @@ import com.microsoft.azure.management.network.NetworkInterface; import com.microsoft.azure.management.network.NetworkInterfaceDnsSettings; import com.microsoft.azure.management.network.NetworkInterfaces; -import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; import rx.Observable; diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsImpl.java index fcd221d7892e3..a213401169890 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsImpl.java @@ -9,7 +9,6 @@ import com.microsoft.azure.management.apigeneration.LangDefinition; import com.microsoft.azure.management.network.NetworkSecurityGroup; import com.microsoft.azure.management.network.NetworkSecurityGroups; -import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; import rx.Observable; diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworksImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworksImpl.java index d38354a18c7b0..49cdead98b2be 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworksImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworksImpl.java @@ -11,7 +11,6 @@ import com.microsoft.azure.management.network.DhcpOptions; import com.microsoft.azure.management.network.Network; import com.microsoft.azure.management.network.Networks; -import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; import rx.Observable; diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressesImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressesImpl.java index c5b9eb4309287..87d3522caf72a 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressesImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressesImpl.java @@ -6,11 +6,10 @@ package com.microsoft.azure.management.network.implementation; import com.microsoft.azure.PagedList; +import com.microsoft.azure.management.apigeneration.LangDefinition; import com.microsoft.azure.management.network.PublicIPAddressDnsSettings; import com.microsoft.azure.management.network.PublicIpAddress; import com.microsoft.azure.management.network.PublicIpAddresses; -import com.microsoft.azure.management.apigeneration.LangDefinition; -import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; import rx.Observable; diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisCachesImpl.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisCachesImpl.java index 1ac17aab4bf88..f8721429826de 100644 --- a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisCachesImpl.java +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisCachesImpl.java @@ -10,7 +10,6 @@ import com.microsoft.azure.management.apigeneration.LangDefinition; import com.microsoft.azure.management.redis.RedisCache; import com.microsoft.azure.management.redis.RedisCaches; -import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; import rx.Observable; diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/SupportsDeletingByGroup.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/SupportsDeletingByGroup.java index f11577bf867b6..8527432921cea 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/SupportsDeletingByGroup.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/SupportsDeletingByGroup.java @@ -33,6 +33,7 @@ public interface SupportsDeletingByGroup { * @param groupName The group the resource is part of * @param name The name of the resource * @param callback the callback to call on success or failure + * @return a handle to cancel the request */ ServiceCall deleteAsync(String groupName, String name, ServiceCallback callback); @@ -41,6 +42,7 @@ public interface SupportsDeletingByGroup { * * @param groupName The group the resource is part of * @param name The name of the resource + * @return an observable to the request */ Observable deleteAsync(String groupName, String name); } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.java index 79eb3064d1fca..2e474d21eb70b 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/collection/implementation/GroupableResourcesImpl.java @@ -12,7 +12,6 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingById; import com.microsoft.azure.management.resources.fluentcore.arm.implementation.ManagerBase; import com.microsoft.azure.management.resources.fluentcore.arm.models.GroupableResource; -import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeleting; import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceResponse; diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeleting.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeleting.java index 12177fd91a38c..79880137bb1bd 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeleting.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/collection/SupportsDeleting.java @@ -30,6 +30,7 @@ public interface SupportsDeleting { * * @param id the resource ID of the resource to delete * @param callback the callback on success or failure + * @return a handle to cancel the request */ ServiceCall deleteAsync(String id, ServiceCallback callback); @@ -37,6 +38,7 @@ public interface SupportsDeleting { * Asynchronously delete a resource from Azure, identifying it by its resource ID. * * @param id the resource ID of the resource to delete + * @return an observable of the request */ Observable deleteAsync(String id); } diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsImpl.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsImpl.java index fd352a44cc8ff..5220bd477e4b8 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsImpl.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsImpl.java @@ -7,7 +7,6 @@ package com.microsoft.azure.management.storage.implementation; import com.microsoft.azure.PagedList; -import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; import com.microsoft.azure.management.storage.CheckNameAvailabilityResult; import com.microsoft.azure.management.storage.SkuName;