From 0c1e37f89be1f442bcd21591eeeeee577937e4bf Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Oct 2016 17:18:54 -0700 Subject: [PATCH 1/9] minor test cleanup --- .../test/java/com/microsoft/azure/management/AzureTests.java | 5 ++++- .../com/microsoft/azure/management/TestLoadBalancer.java | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/azure/src/test/java/com/microsoft/azure/management/AzureTests.java b/azure/src/test/java/com/microsoft/azure/management/AzureTests.java index 69e7cf875aab..66719e4d6a06 100644 --- a/azure/src/test/java/com/microsoft/azure/management/AzureTests.java +++ b/azure/src/test/java/com/microsoft/azure/management/AzureTests.java @@ -110,6 +110,8 @@ public void setup() throws Exception { .withMode(DeploymentMode.COMPLETE) .create(); System.out.println("Created deployment: " + deployment.correlationId()); + + azure.resourceGroups().delete("rg" + testId); } @@ -223,7 +225,8 @@ public void testLoadBalancersInternalMinimum() throws Exception { * @throws Exception */ @Test public void testNetworks() throws Exception { - new TestNetwork(azure.networkSecurityGroups()).runTest(azure.networks(), azure.resourceGroups()); + new TestNetwork(azure.networkSecurityGroups()) + .runTest(azure.networks(), azure.resourceGroups()); } /** diff --git a/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java b/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java index 0bbfc1b7e227..c0b06aa56cfe 100644 --- a/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java +++ b/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java @@ -509,14 +509,12 @@ public LoadBalancer createResource(LoadBalancers resources) throws Exception { .withLoadBalancingRule(80, TransportProtocol.TCP) .create(); - //TODO Assert.assertTrue(lb.backends().containsKey("default")); Assert.assertTrue(lb.frontends().containsKey("default")); Assert.assertTrue(lb.tcpProbes().containsKey("default")); Assert.assertTrue(lb.loadBalancingRules().containsKey("default")); LoadBalancingRule lbrule = lb.loadBalancingRules().get("default"); Assert.assertTrue(lbrule.frontend().name().equalsIgnoreCase("default")); - //TODO Assert.assertTrue(lbrule.backend().name().equalsIgnoreCase("default")); Assert.assertTrue(lbrule.probe().name().equalsIgnoreCase("default")); return lb; From f7d98ac1fe8a09da34906d6bcf83c18a776b96c8 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Oct 2016 18:11:24 -0700 Subject: [PATCH 2/9] extracting `name()` returning String into a `HasName` interface across all fluent interfaces for consistent reuse, less code repetition and single javadoc description --- .../management/batch/ApplicationPackage.java | 5 ----- .../VirtualMachineExtensionImageType.java | 9 +++------ .../VirtualMachineExtensionImageVersion.java | 9 +++------ .../compute/VirtualMachineOffer.java | 8 ++------ .../compute/VirtualMachinePublisher.java | 8 ++------ .../compute/VirtualMachineSize.java | 8 ++------ .../management/compute/VirtualMachineSku.java | 8 ++------ .../management/resources/Deployment.java | 9 +++------ .../azure/management/resources/Feature.java | 8 +++----- .../azure/management/resources/Location.java | 9 +++------ .../management/resources/ResourceGroup.java | 8 +++----- .../fluentcore/arm/models/ChildResource.java | 8 +++----- .../fluentcore/arm/models/HasName.java | 19 +++++++++++++++++++ .../fluentcore/arm/models/Resource.java | 10 ++++------ .../resources/fluentcore/model/Creatable.java | 9 ++++----- 15 files changed, 56 insertions(+), 79 deletions(-) create mode 100644 azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/models/HasName.java diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/ApplicationPackage.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/ApplicationPackage.java index 3ed301f07714..6e3e1b9182bb 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/ApplicationPackage.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/ApplicationPackage.java @@ -20,11 +20,6 @@ public interface ApplicationPackage extends ExternalChildResource, Wrapper { - /** - * @return the name of application package. - */ - String name(); - /** * @return the sate of the application package */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionImageType.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionImageType.java index bcf13416a17c..6dc5d7960246 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionImageType.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionImageType.java @@ -2,6 +2,7 @@ import com.microsoft.azure.management.apigeneration.Fluent; import com.microsoft.azure.management.compute.implementation.VirtualMachineExtensionImageInner; +import com.microsoft.azure.management.resources.fluentcore.arm.models.HasName; import com.microsoft.azure.management.resources.fluentcore.model.Wrapper; /** @@ -9,17 +10,13 @@ */ @Fluent public interface VirtualMachineExtensionImageType extends - Wrapper { + Wrapper, + HasName { /** * @return the resource ID of the virtual machine extension image type */ String id(); - /** - * @return the name of the virtual machine extension image type - */ - String name(); - /** * @return the region in which virtual machine extension image type is available */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionImageVersion.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionImageVersion.java index b99f98896b12..cffec853c99c 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionImageVersion.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineExtensionImageVersion.java @@ -2,6 +2,7 @@ import com.microsoft.azure.management.apigeneration.Fluent; import com.microsoft.azure.management.compute.implementation.VirtualMachineExtensionImageInner; +import com.microsoft.azure.management.resources.fluentcore.arm.models.HasName; import com.microsoft.azure.management.resources.fluentcore.model.Wrapper; /** @@ -9,17 +10,13 @@ */ @Fluent public interface VirtualMachineExtensionImageVersion extends - Wrapper { + Wrapper, + HasName { /** * @return the resource ID of the extension image version */ String id(); - /** - * @return the name of the virtual machine extension image version - */ - String name(); - /** * @return the region in which virtual machine extension image version is available */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineOffer.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineOffer.java index 6abaed345c74..b8a63782f56a 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineOffer.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineOffer.java @@ -7,12 +7,13 @@ import com.microsoft.azure.management.apigeneration.Fluent; import com.microsoft.azure.management.resources.fluentcore.arm.Region; +import com.microsoft.azure.management.resources.fluentcore.arm.models.HasName; /** * Represents a virtual machine image offer. */ @Fluent -public interface VirtualMachineOffer { +public interface VirtualMachineOffer extends HasName { /** * @return the region where this virtual machine image offer is available */ @@ -23,11 +24,6 @@ public interface VirtualMachineOffer { */ VirtualMachinePublisher publisher(); - /** - * @return the name of the virtual machine image offer - */ - String name(); - /** * @return virtual machine image SKUs available in this offer */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachinePublisher.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachinePublisher.java index 81a151983be1..e54a760a6d5b 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachinePublisher.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachinePublisher.java @@ -7,22 +7,18 @@ import com.microsoft.azure.management.apigeneration.Fluent; import com.microsoft.azure.management.resources.fluentcore.arm.Region; +import com.microsoft.azure.management.resources.fluentcore.arm.models.HasName; /** * Represents a virtual machine image publisher. */ @Fluent -public interface VirtualMachinePublisher { +public interface VirtualMachinePublisher extends HasName { /** * @return the region where virtual machine images from this publisher are available */ Region region(); - /** - * @return the name of the publisher - */ - String name(); - /** * @return the offers from this publisher */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineSize.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineSize.java index 0f709eba3f74..a9107d936906 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineSize.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineSize.java @@ -6,17 +6,13 @@ package com.microsoft.azure.management.compute; import com.microsoft.azure.management.apigeneration.Fluent; +import com.microsoft.azure.management.resources.fluentcore.arm.models.HasName; /** * A type representing virtual machine size available for a subscription in a region. */ @Fluent -public interface VirtualMachineSize { - /** - * @return the virtual machine size name - */ - String name(); - +public interface VirtualMachineSize extends HasName { /** * @return the number of cores supported by the VM size */ diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineSku.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineSku.java index d123e06c4467..f845d7e4ed85 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineSku.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineSku.java @@ -7,12 +7,13 @@ import com.microsoft.azure.management.apigeneration.Fluent; import com.microsoft.azure.management.resources.fluentcore.arm.Region; +import com.microsoft.azure.management.resources.fluentcore.arm.models.HasName; /** * Represents a virtual machine image SKU. */ @Fluent -public interface VirtualMachineSku { +public interface VirtualMachineSku extends HasName { /** * @return the region where this virtual machine image offer SKU is available */ @@ -28,11 +29,6 @@ public interface VirtualMachineSku { */ VirtualMachineOffer offer(); - /** - * @return the commercial name of the virtual machine image (SKU) - */ - String name(); - /** * @return virtual machine images in the SKU */ diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/Deployment.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/Deployment.java index 08a03b95adac..c758d0925777 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/Deployment.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/Deployment.java @@ -12,6 +12,7 @@ import com.microsoft.azure.management.apigeneration.Method; import com.microsoft.azure.management.resources.fluentcore.arm.Region; import com.microsoft.azure.management.resources.fluentcore.arm.models.GroupableResource; +import com.microsoft.azure.management.resources.fluentcore.arm.models.HasName; import com.microsoft.azure.management.resources.fluentcore.model.Appliable; import com.microsoft.azure.management.resources.fluentcore.model.Creatable; import com.microsoft.azure.management.resources.fluentcore.model.Refreshable; @@ -30,18 +31,14 @@ public interface Deployment extends Refreshable, Updatable, - Wrapper { + Wrapper, + HasName { /** * @return the name of this deployment's resource group */ String resourceGroupName(); - /** - * @return the name of the deployment - */ - String name(); - /** * @return the state of the provisioning process of the resources being deployed */ diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/Feature.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/Feature.java index f2622f3c0f93..b9d7d1b2ec7c 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/Feature.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/Feature.java @@ -7,6 +7,7 @@ package com.microsoft.azure.management.resources; import com.microsoft.azure.management.apigeneration.Fluent; +import com.microsoft.azure.management.resources.fluentcore.arm.models.HasName; import com.microsoft.azure.management.resources.fluentcore.model.Indexable; import com.microsoft.azure.management.resources.fluentcore.model.Wrapper; import com.microsoft.azure.management.resources.implementation.FeatureResultInner; @@ -17,11 +18,8 @@ @Fluent public interface Feature extends Indexable, - Wrapper { - /** - * @return the name of the feature - */ - String name(); + Wrapper, + HasName { /** * @return the type of the feature diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/Location.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/Location.java index ddfaeff936f8..b189bce2b5be 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/Location.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/Location.java @@ -7,6 +7,7 @@ package com.microsoft.azure.management.resources; import com.microsoft.azure.management.apigeneration.Fluent; +import com.microsoft.azure.management.resources.fluentcore.arm.models.HasName; import com.microsoft.azure.management.resources.fluentcore.model.Indexable; import com.microsoft.azure.management.resources.fluentcore.model.Wrapper; import com.microsoft.azure.management.resources.implementation.LocationInner; @@ -17,17 +18,13 @@ @Fluent public interface Location extends Indexable, - Wrapper { + Wrapper, + HasName { /** * @return the subscription UUID */ String subscriptionId(); - /** - * @return the name of the location - */ - String name(); - /** * @return the display name of the location readable by humans */ diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourceGroup.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourceGroup.java index 538047fecd9a..38a51a5a1fa6 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourceGroup.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/ResourceGroup.java @@ -8,6 +8,7 @@ import com.microsoft.azure.management.apigeneration.Fluent; import com.microsoft.azure.management.resources.fluentcore.arm.models.GroupableResource; +import com.microsoft.azure.management.resources.fluentcore.arm.models.HasName; import com.microsoft.azure.management.resources.fluentcore.arm.models.Resource; import com.microsoft.azure.management.resources.fluentcore.model.Appliable; import com.microsoft.azure.management.resources.fluentcore.model.Creatable; @@ -26,11 +27,8 @@ public interface ResourceGroup extends Resource, Refreshable, Wrapper, - Updatable { - /** - * @return the name of the resource group - */ - String name(); + Updatable, + HasName { /** * @return the provisioning state of the resource group diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/models/ChildResource.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/models/ChildResource.java index 09608642228f..4ffb30a26d9b 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/models/ChildResource.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/models/ChildResource.java @@ -13,11 +13,9 @@ * @param parent interface */ @Fluent -public interface ChildResource extends Indexable { - /** - * @return the name of this child object - */ - String name(); +public interface ChildResource extends + Indexable, + HasName { /** * @return the parent of this child object diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/models/HasName.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/models/HasName.java new file mode 100644 index 000000000000..e1be6a3abda6 --- /dev/null +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/models/HasName.java @@ -0,0 +1,19 @@ +/** + * 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.management.resources.fluentcore.arm.models; + +import com.microsoft.azure.management.apigeneration.Fluent; + +/** + * An interface representing a model that has a name. + */ +@Fluent +public interface HasName { + /** + * @return the name of the resource + */ + String name(); +} diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/models/Resource.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/models/Resource.java index 413b49c9ecf4..68d6f50693ec 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/models/Resource.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/models/Resource.java @@ -16,7 +16,10 @@ * Base interfaces for fluent resources. */ @LangDefinition() -public interface Resource extends Indexable { +public interface Resource extends + Indexable, + HasName { + /** * @return the resource ID string */ @@ -27,11 +30,6 @@ public interface Resource extends Indexable { */ String type(); - /** - * @return the name of the resource - */ - String name(); - /** * @return the name of the region the resource is in */ diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/model/Creatable.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/model/Creatable.java index 3539330c4a20..069e3ee4383a 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/model/Creatable.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/model/Creatable.java @@ -8,6 +8,7 @@ import com.microsoft.azure.management.apigeneration.LangDefinition; import com.microsoft.azure.management.apigeneration.Method; +import com.microsoft.azure.management.resources.fluentcore.arm.models.HasName; import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback; import rx.Observable; @@ -18,11 +19,9 @@ * @param the fluent type of the resource to be created */ @LangDefinition(ContainerName = "ResourceActions", CreateAsyncMultiThreadMethodParam = true) -public interface Creatable extends Indexable { - /** - * @return the name of the creatable resource. - */ - String name(); +public interface Creatable extends + Indexable, + HasName { /** * Execute the create request. From cbd20e2d554f4b6712746e71b49e62ca836bd6f1 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Oct 2016 15:55:10 -0700 Subject: [PATCH 3/9] new base interface for child resources that can be returned without a parent --- .../arm/models/ParentlessChildResource.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/models/ParentlessChildResource.java diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/models/ParentlessChildResource.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/models/ParentlessChildResource.java new file mode 100644 index 000000000000..7cfe0bf2f3aa --- /dev/null +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/arm/models/ParentlessChildResource.java @@ -0,0 +1,24 @@ +/** + * 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.management.resources.fluentcore.arm.models; + +import com.microsoft.azure.management.apigeneration.Fluent; +import com.microsoft.azure.management.resources.fluentcore.model.Indexable; + +/** + * Base interface used by child resources that do not immediately have their parent attached to them but are instead available directly off other entry points. + * @param parent interface + */ +@Fluent +public interface ParentlessChildResource extends + Indexable, + HasName { + + /** + * @return the parent of this child object + */ + ParentT getParent(); +} From c51996652d6db51a5b90e3e856797e1d6f3f2634 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Oct 2016 18:06:08 -0700 Subject: [PATCH 4/9] renaming Frontend as LoadBalancerFrontend to better distinguish from ApplicationGatewayFrontend --- .../implementation/VirtualMachineScaleSetImpl.java | 4 ++-- .../azure/management/network/LoadBalancer.java | 2 +- .../{Frontend.java => LoadBalancerFrontend.java} | 2 +- .../azure/management/network/PrivateFrontend.java | 2 +- .../azure/management/network/PublicFrontend.java | 2 +- .../network/implementation/FrontendImpl.java | 4 ++-- .../network/implementation/InboundNatPoolImpl.java | 4 ++-- .../network/implementation/InboundNatRuleImpl.java | 4 ++-- .../network/implementation/LoadBalancerImpl.java | 10 +++++----- .../network/implementation/LoadBalancingRuleImpl.java | 4 ++-- .../azure/management/network/model/HasFrontend.java | 4 ++-- .../com/microsoft/azure/management/samples/Utils.java | 6 +++--- .../microsoft/azure/management/TestLoadBalancer.java | 10 +++++----- 13 files changed, 29 insertions(+), 29 deletions(-) rename azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/{Frontend.java => LoadBalancerFrontend.java} (96%) diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetImpl.java index 2a0985be2c8b..0f335b665f94 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetImpl.java @@ -29,7 +29,7 @@ import com.microsoft.azure.management.compute.WinRMListener; import com.microsoft.azure.management.compute.WindowsConfiguration; import com.microsoft.azure.management.network.Backend; -import com.microsoft.azure.management.network.Frontend; +import com.microsoft.azure.management.network.LoadBalancerFrontend; import com.microsoft.azure.management.network.InboundNatPool; import com.microsoft.azure.management.network.LoadBalancer; import com.microsoft.azure.management.network.Network; @@ -372,7 +372,7 @@ public VirtualMachineScaleSetImpl withPrimaryInternalLoadBalancer(LoadBalancer l throw new IllegalArgumentException("Parameter loadBalancer must be an internal load balancer"); } String lbNetworkId = null; - for (Frontend frontEnd : loadBalancer.frontends().values()) { + for (LoadBalancerFrontend frontEnd : loadBalancer.frontends().values()) { if (frontEnd.inner().subnet().id() != null) { lbNetworkId = ResourceUtils.parentResourcePathFromResourceId(frontEnd.inner().subnet().id()); } diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancer.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancer.java index 3d8b8766e860..6bce08a0aab2 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancer.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancer.java @@ -60,7 +60,7 @@ public interface LoadBalancer extends /** * @return frontends for this load balancer, for the incoming traffic to come from. */ - Map frontends(); + Map frontends(); /** * @return inbound NAT pools, indexed by name diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/Frontend.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancerFrontend.java similarity index 96% rename from azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/Frontend.java rename to azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancerFrontend.java index 36b1202c5b00..6179b04cba32 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/Frontend.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancerFrontend.java @@ -17,7 +17,7 @@ * An immutable client-side representation of a load balancer frontend. */ @Fluent() -public interface Frontend extends +public interface LoadBalancerFrontend extends Wrapper, ChildResource, HasLoadBalancingRules { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/PrivateFrontend.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/PrivateFrontend.java index f0ef7c2831a7..e6a7725f03f8 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/PrivateFrontend.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/PrivateFrontend.java @@ -16,7 +16,7 @@ */ @Fluent() public interface PrivateFrontend extends - Frontend, + LoadBalancerFrontend, HasPrivateIpAddress, HasSubnet { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/PublicFrontend.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/PublicFrontend.java index f7afc1561f19..dee159d4cb55 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/PublicFrontend.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/PublicFrontend.java @@ -15,7 +15,7 @@ */ @Fluent() public interface PublicFrontend extends - Frontend, + LoadBalancerFrontend, HasPublicIpAddress { /** diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/FrontendImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/FrontendImpl.java index 415c79ccb7bd..ca935e8c0e71 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/FrontendImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/FrontendImpl.java @@ -11,7 +11,7 @@ import com.microsoft.azure.SubResource; import com.microsoft.azure.management.apigeneration.LangDefinition; -import com.microsoft.azure.management.network.Frontend; +import com.microsoft.azure.management.network.LoadBalancerFrontend; import com.microsoft.azure.management.network.IPAllocationMethod; import com.microsoft.azure.management.network.InboundNatPool; import com.microsoft.azure.management.network.InboundNatRule; @@ -31,7 +31,7 @@ class FrontendImpl extends ChildResourceImpl implements - Frontend, + LoadBalancerFrontend, PrivateFrontend, PrivateFrontend.Definition, PrivateFrontend.UpdateDefinition, diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/InboundNatPoolImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/InboundNatPoolImpl.java index c5a2a50e3f2e..35c78745711d 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/InboundNatPoolImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/InboundNatPoolImpl.java @@ -7,7 +7,7 @@ import com.microsoft.azure.SubResource; import com.microsoft.azure.management.apigeneration.LangDefinition; -import com.microsoft.azure.management.network.Frontend; +import com.microsoft.azure.management.network.LoadBalancerFrontend; import com.microsoft.azure.management.network.InboundNatPool; import com.microsoft.azure.management.network.LoadBalancer; import com.microsoft.azure.management.network.TransportProtocol; @@ -48,7 +48,7 @@ public int backendPort() { } @Override - public Frontend frontend() { + public LoadBalancerFrontend frontend() { return this.parent().frontends().get( ResourceUtils.nameFromResourceId( this.inner().frontendIPConfiguration().id())); diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/InboundNatRuleImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/InboundNatRuleImpl.java index 114dc3f773a6..0c0c54cfb0a6 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/InboundNatRuleImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/InboundNatRuleImpl.java @@ -7,7 +7,7 @@ import com.microsoft.azure.SubResource; import com.microsoft.azure.management.apigeneration.LangDefinition; -import com.microsoft.azure.management.network.Frontend; +import com.microsoft.azure.management.network.LoadBalancerFrontend; import com.microsoft.azure.management.network.InboundNatRule; import com.microsoft.azure.management.network.LoadBalancer; import com.microsoft.azure.management.network.TransportProtocol; @@ -84,7 +84,7 @@ public boolean floatingIpEnabled() { } @Override - public Frontend frontend() { + public LoadBalancerFrontend frontend() { return this.parent().frontends().get( ResourceUtils.nameFromResourceId( this.inner().frontendIPConfiguration().id())); diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java index 685f73345522..261f4de9b3ef 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java @@ -7,7 +7,7 @@ import com.microsoft.azure.SubResource; import com.microsoft.azure.management.network.Backend; -import com.microsoft.azure.management.network.Frontend; +import com.microsoft.azure.management.network.LoadBalancerFrontend; import com.microsoft.azure.management.network.HttpProbe; import com.microsoft.azure.management.network.InboundNatPool; import com.microsoft.azure.management.network.InboundNatRule; @@ -62,7 +62,7 @@ class LoadBalancerImpl private Map tcpProbes; private Map httpProbes; private Map loadBalancingRules; - private Map frontends; + private Map frontends; private Map inboundNatRules; private Map inboundNatPools; @@ -512,7 +512,7 @@ public FrontendImpl definePublicFrontend(String name) { } private FrontendImpl defineFrontend(String name) { - Frontend frontend = this.frontends.get(name); + LoadBalancerFrontend frontend = this.frontends.get(name); if (frontend == null) { FrontendIPConfigurationInner inner = new FrontendIPConfigurationInner() .withName(name); @@ -632,7 +632,7 @@ public Map tcpProbes() { } @Override - public Map frontends() { + public Map frontends() { return Collections.unmodifiableMap(this.frontends); } @@ -654,7 +654,7 @@ public Map loadBalancingRules() { @Override public List publicIpAddressIds() { List publicIpAddressIds = new ArrayList<>(); - for (Frontend frontend : this.frontends().values()) { + for (LoadBalancerFrontend frontend : this.frontends().values()) { if (frontend.isPublic()) { String pipId = ((PublicFrontend) frontend).publicIpAddressId(); publicIpAddressIds.add(pipId); diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancingRuleImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancingRuleImpl.java index 15f6562deb9d..7fda71da7e5f 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancingRuleImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancingRuleImpl.java @@ -8,7 +8,7 @@ import com.microsoft.azure.SubResource; import com.microsoft.azure.management.apigeneration.LangDefinition; import com.microsoft.azure.management.network.Backend; -import com.microsoft.azure.management.network.Frontend; +import com.microsoft.azure.management.network.LoadBalancerFrontend; import com.microsoft.azure.management.network.LoadBalancer; import com.microsoft.azure.management.network.LoadBalancingRule; import com.microsoft.azure.management.network.LoadDistribution; @@ -75,7 +75,7 @@ public LoadDistribution loadDistribution() { } @Override - public Frontend frontend() { + public LoadBalancerFrontend frontend() { SubResource frontendRef = this.inner().frontendIPConfiguration(); if (frontendRef == null) { return null; diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/model/HasFrontend.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/model/HasFrontend.java index 4c613da87557..f4f5485e885e 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/model/HasFrontend.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/model/HasFrontend.java @@ -6,7 +6,7 @@ package com.microsoft.azure.management.network.model; import com.microsoft.azure.management.apigeneration.Fluent; -import com.microsoft.azure.management.network.Frontend; +import com.microsoft.azure.management.network.LoadBalancerFrontend; /** * An interface representing a model's ability to references a load balancer frontend. @@ -16,7 +16,7 @@ public interface HasFrontend { /** * @return the associated frontend */ - Frontend frontend(); + LoadBalancerFrontend frontend(); /** * Grouping of definition stages involving specifying the frontend. diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java b/azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java index 224fb3fdcd1d..0348db76e466 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java @@ -30,7 +30,7 @@ import com.microsoft.azure.management.network.LoadBalancingRule; import com.microsoft.azure.management.network.InboundNatPool; import com.microsoft.azure.management.network.InboundNatRule; -import com.microsoft.azure.management.network.Frontend; +import com.microsoft.azure.management.network.LoadBalancerFrontend; import com.microsoft.azure.management.network.Backend; import com.microsoft.azure.management.network.Probe; import com.microsoft.azure.management.network.HttpProbe; @@ -400,7 +400,7 @@ public static void print(LoadBalancer resource) { .append("\n\t\t\tIdle timeout in minutes: ").append(rule.idleTimeoutInMinutes()) .append("\n\t\t\tLoad distribution method: ").append(rule.loadDistribution().toString()); - Frontend frontend = rule.frontend(); + LoadBalancerFrontend frontend = rule.frontend(); info.append("\n\t\t\tFrontend: "); if (frontend != null) { info.append(frontend.name()); @@ -432,7 +432,7 @@ public static void print(LoadBalancer resource) { // Show frontends info.append("\n\tFrontends: ") .append(resource.frontends().size()); - for (Frontend frontend : resource.frontends().values()) { + for (LoadBalancerFrontend frontend : resource.frontends().values()) { info.append("\n\t\tFrontend name: ").append(frontend.name()) .append("\n\t\t\tInternet facing: ").append(frontend.isPublic()); if (frontend.isPublic()) { diff --git a/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java b/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java index c0b06aa56cfe..5b81ba03a7a1 100644 --- a/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java +++ b/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java @@ -17,7 +17,7 @@ import com.microsoft.azure.management.compute.VirtualMachineSizeTypes; import com.microsoft.azure.management.compute.VirtualMachines; import com.microsoft.azure.management.network.Backend; -import com.microsoft.azure.management.network.Frontend; +import com.microsoft.azure.management.network.LoadBalancerFrontend; import com.microsoft.azure.management.network.HttpProbe; import com.microsoft.azure.management.network.InboundNatPool; import com.microsoft.azure.management.network.InboundNatRule; @@ -449,7 +449,7 @@ public LoadBalancer updateResource(LoadBalancer resource) throws Exception { Assert.assertTrue(lbRule.backendPort() == 8080); Assert.assertTrue(lbRule.frontend().name().equalsIgnoreCase("default")); - Frontend frontend = resource.frontends().get("default"); + LoadBalancerFrontend frontend = resource.frontends().get("default"); Assert.assertTrue(frontend.isPublic()); Assert.assertTrue(((PublicFrontend) frontend).publicIpAddressId().equalsIgnoreCase(pip.id())); Assert.assertTrue(lbRule.probe().name().equalsIgnoreCase("default")); @@ -564,7 +564,7 @@ public LoadBalancer updateResource(LoadBalancer resource) throws Exception { Assert.assertTrue(lbRule.backendPort() == 8080); Assert.assertTrue(lbRule.frontend().name().equalsIgnoreCase("default")); - Frontend frontend = resource.frontends().get("default"); + LoadBalancerFrontend frontend = resource.frontends().get("default"); Assert.assertTrue(!frontend.isPublic()); Assert.assertTrue(lbRule.probe().name().equalsIgnoreCase("default")); @@ -709,7 +709,7 @@ static void printLB(LoadBalancer resource) { .append("\n\t\t\tIdle timeout in minutes: ").append(rule.idleTimeoutInMinutes()) .append("\n\t\t\tLoad distribution method: ").append(rule.loadDistribution().toString()); - Frontend frontend = rule.frontend(); + LoadBalancerFrontend frontend = rule.frontend(); info.append("\n\t\t\tFrontend: "); if (frontend != null) { info.append(frontend.name()); @@ -741,7 +741,7 @@ static void printLB(LoadBalancer resource) { // Show frontends info.append("\n\tFrontends: ") .append(resource.frontends().size()); - for (Frontend frontend : resource.frontends().values()) { + for (LoadBalancerFrontend frontend : resource.frontends().values()) { info.append("\n\t\tFrontend name: ").append(frontend.name()) .append("\n\t\t\tInternet facing: ").append(frontend.isPublic()); if (frontend.isPublic()) { From b7e3f3b610a9a04f84f4e149735997adcee56495 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Oct 2016 18:10:38 -0700 Subject: [PATCH 5/9] renaming Probe as LoadBalancerProbe to help distinguish from ApplicationGatewayProbe --- .../com/microsoft/azure/management/network/HttpProbe.java | 2 +- .../network/{Probe.java => LoadBalancerProbe.java} | 2 +- .../azure/management/network/LoadBalancingRule.java | 2 +- .../com/microsoft/azure/management/network/TcpProbe.java | 2 +- .../management/network/implementation/LoadBalancerImpl.java | 6 +++--- .../network/implementation/LoadBalancingRuleImpl.java | 4 ++-- .../java/com/microsoft/azure/management/samples/Utils.java | 4 ++-- .../com/microsoft/azure/management/TestLoadBalancer.java | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) rename azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/{Probe.java => LoadBalancerProbe.java} (96%) diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/HttpProbe.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/HttpProbe.java index 5a1b3a6e7913..23565061d554 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/HttpProbe.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/HttpProbe.java @@ -13,7 +13,7 @@ * An immutable client-side representation of an HTTP load balancing probe. */ @Fluent() -public interface HttpProbe extends Probe { +public interface HttpProbe extends LoadBalancerProbe { /** * @return the HTTP request path for the HTTP probe to call to check the health status diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/Probe.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancerProbe.java similarity index 96% rename from azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/Probe.java rename to azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancerProbe.java index 1238eae6c02e..623604729d07 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/Probe.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancerProbe.java @@ -16,7 +16,7 @@ * An immutable client-side representation of a load balancing probe. */ @Fluent() -public interface Probe extends +public interface LoadBalancerProbe extends Wrapper, ChildResource, HasLoadBalancingRules, diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancingRule.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancingRule.java index 219fa015a9f2..840d9cb6f7d5 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancingRule.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancingRule.java @@ -51,7 +51,7 @@ public interface LoadBalancingRule extends /** * @return the probe associated with the load balancing rule */ - Probe probe(); + LoadBalancerProbe probe(); /** * Grouping of load balancing rule definition stages. diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/TcpProbe.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/TcpProbe.java index 6da713235813..37af857d61a2 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/TcpProbe.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/TcpProbe.java @@ -13,7 +13,7 @@ * An immutable client-side representation of a TCP load balancing probe. */ @Fluent() -public interface TcpProbe extends Probe { +public interface TcpProbe extends LoadBalancerProbe { /** * Grouping of probe definition stages. diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java index 261f4de9b3ef..c31bfb0b700b 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java @@ -17,7 +17,7 @@ import com.microsoft.azure.management.network.Network; import com.microsoft.azure.management.network.NetworkInterface; import com.microsoft.azure.management.network.NicIpConfiguration; -import com.microsoft.azure.management.network.Probe; +import com.microsoft.azure.management.network.LoadBalancerProbe; import com.microsoft.azure.management.network.ProbeProtocol; import com.microsoft.azure.management.network.PublicFrontend; import com.microsoft.azure.management.network.PublicIpAddress; @@ -440,7 +440,7 @@ public LoadBalancerImpl withHttpProbe(String path) { @Override public ProbeImpl defineTcpProbe(String name) { - Probe probe = this.tcpProbes.get(name); + LoadBalancerProbe probe = this.tcpProbes.get(name); if (probe == null) { ProbeInner inner = new ProbeInner() .withName(name) @@ -453,7 +453,7 @@ public ProbeImpl defineTcpProbe(String name) { @Override public ProbeImpl defineHttpProbe(String name) { - Probe probe = this.httpProbes.get(name); + LoadBalancerProbe probe = this.httpProbes.get(name); if (probe == null) { ProbeInner inner = new ProbeInner() .withName(name) diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancingRuleImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancingRuleImpl.java index 7fda71da7e5f..a080882286a2 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancingRuleImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancingRuleImpl.java @@ -12,7 +12,7 @@ import com.microsoft.azure.management.network.LoadBalancer; import com.microsoft.azure.management.network.LoadBalancingRule; import com.microsoft.azure.management.network.LoadDistribution; -import com.microsoft.azure.management.network.Probe; +import com.microsoft.azure.management.network.LoadBalancerProbe; import com.microsoft.azure.management.network.TransportProtocol; import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.models.implementation.ChildResourceImpl; @@ -97,7 +97,7 @@ public Backend backend() { } @Override - public Probe probe() { + public LoadBalancerProbe probe() { SubResource probeRef = this.inner().probe(); if (probeRef == null) { return null; diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java b/azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java index 0348db76e466..eea5beaf0269 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java @@ -32,7 +32,7 @@ import com.microsoft.azure.management.network.InboundNatRule; import com.microsoft.azure.management.network.LoadBalancerFrontend; import com.microsoft.azure.management.network.Backend; -import com.microsoft.azure.management.network.Probe; +import com.microsoft.azure.management.network.LoadBalancerProbe; import com.microsoft.azure.management.network.HttpProbe; import com.microsoft.azure.management.network.PublicFrontend; import com.microsoft.azure.management.network.PrivateFrontend; @@ -420,7 +420,7 @@ public static void print(LoadBalancer resource) { info.append("\n\t\t\tBackend port: ").append(rule.backendPort()); - Probe probe = rule.probe(); + LoadBalancerProbe probe = rule.probe(); info.append("\n\t\t\tProbe: "); if (probe == null) { info.append("(None)"); diff --git a/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java b/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java index 5b81ba03a7a1..36089ac1a6f4 100644 --- a/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java +++ b/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java @@ -30,7 +30,7 @@ import com.microsoft.azure.management.network.NetworkInterface; import com.microsoft.azure.management.network.Networks; import com.microsoft.azure.management.network.PrivateFrontend; -import com.microsoft.azure.management.network.Probe; +import com.microsoft.azure.management.network.LoadBalancerProbe; import com.microsoft.azure.management.network.PublicIpAddress; import com.microsoft.azure.management.network.PublicIpAddresses; import com.microsoft.azure.management.network.TcpProbe; @@ -729,7 +729,7 @@ static void printLB(LoadBalancer resource) { info.append("\n\t\t\tBackend port: ").append(rule.backendPort()); - Probe probe = rule.probe(); + LoadBalancerProbe probe = rule.probe(); info.append("\n\t\t\tProbe: "); if (probe == null) { info.append("(None)"); From be5ff54519b997fbef9ebaf85e4e346bab8493fe Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Oct 2016 18:13:52 -0700 Subject: [PATCH 6/9] renaming TcpProbe as LoadBalancerTcpProbe to help distinguish from ApplicationGatewayTcpProbe --- .../azure/management/network/LoadBalancer.java | 12 ++++++------ .../{TcpProbe.java => LoadBalancerTcpProbe.java} | 2 +- .../network/implementation/LoadBalancerImpl.java | 6 +++--- .../management/network/implementation/ProbeImpl.java | 12 ++++++------ .../microsoft/azure/management/samples/Utils.java | 4 ++-- .../microsoft/azure/management/TestLoadBalancer.java | 4 ++-- 6 files changed, 20 insertions(+), 20 deletions(-) rename azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/{TcpProbe.java => LoadBalancerTcpProbe.java} (99%) diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancer.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancer.java index 6bce08a0aab2..09f8102fca4c 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancer.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancer.java @@ -40,7 +40,7 @@ public interface LoadBalancer extends /** * @return TCP probes of this load balancer, indexed by the name */ - Map tcpProbes(); + Map tcpProbes(); /** * @return HTTP probes of this load balancer, indexed by the name @@ -193,11 +193,11 @@ interface WithProbe { /** * Begins the definition of a new TCP probe to add to the load balancer. *

- * The definition must be completed with a call to {@link TcpProbe.DefinitionStages.WithAttach#attach()} + * The definition must be completed with a call to {@link LoadBalancerTcpProbe.DefinitionStages.WithAttach#attach()} * @param name the name of the probe * @return the first stage of the new probe definition */ - TcpProbe.DefinitionStages.Blank defineTcpProbe(String name); + LoadBalancerTcpProbe.DefinitionStages.Blank defineTcpProbe(String name); /** * Begins the definition of a new HTTP probe to add to the load balancer. @@ -477,7 +477,7 @@ interface WithProbe { * @param name the name of the new probe * @return the next stage of the definition */ - TcpProbe.UpdateDefinitionStages.Blank defineTcpProbe(String name); + LoadBalancerTcpProbe.UpdateDefinitionStages.Blank defineTcpProbe(String name); /** * Removes the specified probe from the load balancer, if present. @@ -491,7 +491,7 @@ interface WithProbe { * @param name the name of the probe to update * @return the first stage of the probe update */ - TcpProbe.Update updateTcpProbe(String name); + LoadBalancerTcpProbe.Update updateTcpProbe(String name); /** * Begins the description of an update to an existing HTTP probe on this load balancer. @@ -529,7 +529,7 @@ interface WithLoadBalancingRule { /** * Begins the definition of a new load balancing rule to add to the load balancer. *

- * The definition must be completed with a call to {@link TcpProbe.DefinitionStages.WithAttach#attach()} + * The definition must be completed with a call to {@link LoadBalancerTcpProbe.DefinitionStages.WithAttach#attach()} * @param name the name of the load balancing rule * @return the first stage of the new load balancing rule definition */ diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/TcpProbe.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancerTcpProbe.java similarity index 99% rename from azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/TcpProbe.java rename to azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancerTcpProbe.java index 37af857d61a2..6317e3de284b 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/TcpProbe.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancerTcpProbe.java @@ -13,7 +13,7 @@ * An immutable client-side representation of a TCP load balancing probe. */ @Fluent() -public interface TcpProbe extends LoadBalancerProbe { +public interface LoadBalancerTcpProbe extends LoadBalancerProbe { /** * Grouping of probe definition stages. diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java index c31bfb0b700b..d852a0a8a5be 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java @@ -22,7 +22,7 @@ import com.microsoft.azure.management.network.PublicFrontend; import com.microsoft.azure.management.network.PublicIpAddress; import com.microsoft.azure.management.network.PublicIpAddress.DefinitionStages.WithGroup; -import com.microsoft.azure.management.network.TcpProbe; +import com.microsoft.azure.management.network.LoadBalancerTcpProbe; import com.microsoft.azure.management.network.TransportProtocol; import com.microsoft.azure.management.network.model.HasNetworkInterfaces; import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; @@ -59,7 +59,7 @@ class LoadBalancerImpl private final HashMap creatablePIPKeys = new HashMap<>(); private Map backends; - private Map tcpProbes; + private Map tcpProbes; private Map httpProbes; private Map loadBalancingRules; private Map frontends; @@ -627,7 +627,7 @@ public Map inboundNatPools() { } @Override - public Map tcpProbes() { + public Map tcpProbes() { return Collections.unmodifiableMap(this.tcpProbes); } diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ProbeImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ProbeImpl.java index 06e528d6a5f7..d811e6c6db91 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ProbeImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ProbeImpl.java @@ -15,21 +15,21 @@ import com.microsoft.azure.management.network.LoadBalancer; import com.microsoft.azure.management.network.LoadBalancingRule; import com.microsoft.azure.management.network.ProbeProtocol; -import com.microsoft.azure.management.network.TcpProbe; +import com.microsoft.azure.management.network.LoadBalancerTcpProbe; import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.models.implementation.ChildResourceImpl; /** - * Implementation for {@link TcpProbe} and its create and update interfaces. + * Implementation for {@link LoadBalancerTcpProbe} and its create and update interfaces. */ @LangDefinition class ProbeImpl extends ChildResourceImpl implements - TcpProbe, - TcpProbe.Definition, - TcpProbe.UpdateDefinition, - TcpProbe.Update, + LoadBalancerTcpProbe, + LoadBalancerTcpProbe.Definition, + LoadBalancerTcpProbe.UpdateDefinition, + LoadBalancerTcpProbe.Update, HttpProbe, HttpProbe.Definition, HttpProbe.UpdateDefinition, diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java b/azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java index eea5beaf0269..eb1871a5f774 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java @@ -26,7 +26,7 @@ import com.microsoft.azure.management.network.PublicIpAddress; import com.microsoft.azure.management.network.Subnet; import com.microsoft.azure.management.network.LoadBalancer; -import com.microsoft.azure.management.network.TcpProbe; +import com.microsoft.azure.management.network.LoadBalancerTcpProbe; import com.microsoft.azure.management.network.LoadBalancingRule; import com.microsoft.azure.management.network.InboundNatPool; import com.microsoft.azure.management.network.InboundNatRule; @@ -358,7 +358,7 @@ public static void print(LoadBalancer resource) { // Show TCP probes info.append("\n\tTCP probes: ") .append(resource.tcpProbes().size()); - for (TcpProbe probe : resource.tcpProbes().values()) { + for (LoadBalancerTcpProbe probe : resource.tcpProbes().values()) { info.append("\n\t\tProbe name: ").append(probe.name()) .append("\n\t\t\tPort: ").append(probe.port()) .append("\n\t\t\tInterval in seconds: ").append(probe.intervalInSeconds()) diff --git a/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java b/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java index 36089ac1a6f4..900d9ef7ad01 100644 --- a/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java +++ b/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java @@ -33,7 +33,7 @@ import com.microsoft.azure.management.network.LoadBalancerProbe; import com.microsoft.azure.management.network.PublicIpAddress; import com.microsoft.azure.management.network.PublicIpAddresses; -import com.microsoft.azure.management.network.TcpProbe; +import com.microsoft.azure.management.network.LoadBalancerTcpProbe; import com.microsoft.azure.management.network.TransportProtocol; import com.microsoft.azure.management.resources.fluentcore.arm.Region; import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; @@ -667,7 +667,7 @@ static void printLB(LoadBalancer resource) { // Show TCP probes info.append("\n\tTCP probes: ") .append(resource.tcpProbes().size()); - for (TcpProbe probe : resource.tcpProbes().values()) { + for (LoadBalancerTcpProbe probe : resource.tcpProbes().values()) { info.append("\n\t\tProbe name: ").append(probe.name()) .append("\n\t\t\tPort: ").append(probe.port()) .append("\n\t\t\tInterval in seconds: ").append(probe.intervalInSeconds()) From 67b3199a8db20b7e473458e92b5c7a587b8b978e Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Oct 2016 18:16:17 -0700 Subject: [PATCH 7/9] renaming HttpProbe as LoadBalancerHttpProbe to help distinguish from ApplicationGatewayHttpProbe --- .../azure/management/network/LoadBalancer.java | 14 +++++++------- .../{HttpProbe.java => LoadBalancerHttpProbe.java} | 2 +- .../network/implementation/LoadBalancerImpl.java | 6 +++--- .../network/implementation/ProbeImpl.java | 10 +++++----- .../microsoft/azure/management/samples/Utils.java | 4 ++-- .../azure/management/TestLoadBalancer.java | 4 ++-- 6 files changed, 20 insertions(+), 20 deletions(-) rename azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/{HttpProbe.java => LoadBalancerHttpProbe.java} (99%) diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancer.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancer.java index 09f8102fca4c..2cf7b2b13ca4 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancer.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancer.java @@ -45,7 +45,7 @@ public interface LoadBalancer extends /** * @return HTTP probes of this load balancer, indexed by the name */ - Map httpProbes(); + Map httpProbes(); /** * @return backends for this load balancer to load balance the incoming traffic among, indexed by name @@ -202,11 +202,11 @@ interface WithProbe { /** * Begins the definition of a new HTTP probe to add to the load balancer. *

- * The definition must be completed with a call to {@link HttpProbe.DefinitionStages.WithAttach#attach()} + * The definition must be completed with a call to {@link LoadBalancerHttpProbe.DefinitionStages.WithAttach#attach()} * @param name the name of the probe * @return the first stage of the new probe definition */ - HttpProbe.DefinitionStages.Blank defineHttpProbe(String name); + LoadBalancerHttpProbe.DefinitionStages.Blank defineHttpProbe(String name); } /** @@ -464,16 +464,16 @@ interface WithProbe { /** * Begins the definition of a new HTTP probe to add to the load balancer. *

- * The definition must be completed with a call to {@link HttpProbe.DefinitionStages.WithAttach#attach()} + * The definition must be completed with a call to {@link LoadBalancerHttpProbe.DefinitionStages.WithAttach#attach()} * @param name the name of the new probe * @return the next stage of the definition */ - HttpProbe.UpdateDefinitionStages.Blank defineHttpProbe(String name); + LoadBalancerHttpProbe.UpdateDefinitionStages.Blank defineHttpProbe(String name); /** * Begins the definition of a new TCP probe to add to the load balancer. *

- * The definition must be completed with a call to {@link HttpProbe.DefinitionStages.WithAttach#attach()} + * The definition must be completed with a call to {@link LoadBalancerHttpProbe.DefinitionStages.WithAttach#attach()} * @param name the name of the new probe * @return the next stage of the definition */ @@ -498,7 +498,7 @@ interface WithProbe { * @param name the name of the probe to update * @return the first stage of the probe update */ - HttpProbe.Update updateHttpProbe(String name); + LoadBalancerHttpProbe.Update updateHttpProbe(String name); } /** diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/HttpProbe.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancerHttpProbe.java similarity index 99% rename from azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/HttpProbe.java rename to azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancerHttpProbe.java index 23565061d554..d13ce052704f 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/HttpProbe.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancerHttpProbe.java @@ -13,7 +13,7 @@ * An immutable client-side representation of an HTTP load balancing probe. */ @Fluent() -public interface HttpProbe extends LoadBalancerProbe { +public interface LoadBalancerHttpProbe extends LoadBalancerProbe { /** * @return the HTTP request path for the HTTP probe to call to check the health status diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java index d852a0a8a5be..ccc412a92cf5 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java @@ -8,7 +8,7 @@ import com.microsoft.azure.SubResource; import com.microsoft.azure.management.network.Backend; import com.microsoft.azure.management.network.LoadBalancerFrontend; -import com.microsoft.azure.management.network.HttpProbe; +import com.microsoft.azure.management.network.LoadBalancerHttpProbe; import com.microsoft.azure.management.network.InboundNatPool; import com.microsoft.azure.management.network.InboundNatRule; import com.microsoft.azure.management.apigeneration.LangDefinition; @@ -60,7 +60,7 @@ class LoadBalancerImpl private Map backends; private Map tcpProbes; - private Map httpProbes; + private Map httpProbes; private Map loadBalancingRules; private Map frontends; private Map inboundNatRules; @@ -642,7 +642,7 @@ public Map inboundNatRules() { } @Override - public Map httpProbes() { + public Map httpProbes() { return Collections.unmodifiableMap(this.httpProbes); } diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ProbeImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ProbeImpl.java index d811e6c6db91..c5687df0dbc5 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ProbeImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ProbeImpl.java @@ -11,7 +11,7 @@ import com.microsoft.azure.SubResource; import com.microsoft.azure.management.apigeneration.LangDefinition; -import com.microsoft.azure.management.network.HttpProbe; +import com.microsoft.azure.management.network.LoadBalancerHttpProbe; import com.microsoft.azure.management.network.LoadBalancer; import com.microsoft.azure.management.network.LoadBalancingRule; import com.microsoft.azure.management.network.ProbeProtocol; @@ -30,10 +30,10 @@ class ProbeImpl LoadBalancerTcpProbe.Definition, LoadBalancerTcpProbe.UpdateDefinition, LoadBalancerTcpProbe.Update, - HttpProbe, - HttpProbe.Definition, - HttpProbe.UpdateDefinition, - HttpProbe.Update { + LoadBalancerHttpProbe, + LoadBalancerHttpProbe.Definition, + LoadBalancerHttpProbe.UpdateDefinition, + LoadBalancerHttpProbe.Update { ProbeImpl(ProbeInner inner, LoadBalancerImpl parent) { super(inner, parent); diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java b/azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java index eb1871a5f774..f9e02d6dc5e3 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java @@ -33,7 +33,7 @@ import com.microsoft.azure.management.network.LoadBalancerFrontend; import com.microsoft.azure.management.network.Backend; import com.microsoft.azure.management.network.LoadBalancerProbe; -import com.microsoft.azure.management.network.HttpProbe; +import com.microsoft.azure.management.network.LoadBalancerHttpProbe; import com.microsoft.azure.management.network.PublicFrontend; import com.microsoft.azure.management.network.PrivateFrontend; import com.microsoft.azure.management.storage.StorageAccount; @@ -375,7 +375,7 @@ public static void print(LoadBalancer resource) { // Show HTTP probes info.append("\n\tHTTP probes: ") .append(resource.httpProbes().size()); - for (HttpProbe probe : resource.httpProbes().values()) { + for (LoadBalancerHttpProbe probe : resource.httpProbes().values()) { info.append("\n\t\tProbe name: ").append(probe.name()) .append("\n\t\t\tPort: ").append(probe.port()) .append("\n\t\t\tInterval in seconds: ").append(probe.intervalInSeconds()) diff --git a/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java b/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java index 900d9ef7ad01..8b14f1c4a557 100644 --- a/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java +++ b/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java @@ -18,7 +18,7 @@ import com.microsoft.azure.management.compute.VirtualMachines; import com.microsoft.azure.management.network.Backend; import com.microsoft.azure.management.network.LoadBalancerFrontend; -import com.microsoft.azure.management.network.HttpProbe; +import com.microsoft.azure.management.network.LoadBalancerHttpProbe; import com.microsoft.azure.management.network.InboundNatPool; import com.microsoft.azure.management.network.InboundNatRule; import com.microsoft.azure.management.network.PublicFrontend; @@ -684,7 +684,7 @@ static void printLB(LoadBalancer resource) { // Show HTTP probes info.append("\n\tHTTP probes: ") .append(resource.httpProbes().size()); - for (HttpProbe probe : resource.httpProbes().values()) { + for (LoadBalancerHttpProbe probe : resource.httpProbes().values()) { info.append("\n\t\tProbe name: ").append(probe.name()) .append("\n\t\t\tPort: ").append(probe.port()) .append("\n\t\t\tInterval in seconds: ").append(probe.intervalInSeconds()) From be39deb163b3806d44bb733f4bd540df114701c9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Oct 2016 18:20:02 -0700 Subject: [PATCH 8/9] renaming Backend as LoadBalancerBackend to help distinguish from ApplicationGatewayBackend --- .../compute/VirtualMachineScaleSet.java | 6 +++--- .../VirtualMachineScaleSetImpl.java | 18 +++++++++--------- .../azure/management/network/LoadBalancer.java | 8 ++++---- .../{Backend.java => LoadBalancerBackend.java} | 2 +- .../management/network/LoadBalancingRule.java | 2 +- .../management/network/NicIpConfiguration.java | 2 +- .../network/implementation/BackendImpl.java | 12 ++++++------ .../implementation/LoadBalancerImpl.java | 8 ++++---- .../implementation/LoadBalancingRuleImpl.java | 4 ++-- .../implementation/NicIpConfigurationImpl.java | 6 +++--- .../azure/management/samples/Utils.java | 6 +++--- .../azure/management/TestLoadBalancer.java | 6 +++--- .../azure/management/TestNetworkInterface.java | 6 +++--- 13 files changed, 43 insertions(+), 43 deletions(-) rename azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/{Backend.java => LoadBalancerBackend.java} (98%) diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSet.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSet.java index 50d2c2fa0550..e07d03015bbd 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSet.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/VirtualMachineScaleSet.java @@ -4,7 +4,7 @@ import com.microsoft.azure.PagedList; import com.microsoft.azure.management.apigeneration.Fluent; import com.microsoft.azure.management.compute.implementation.VirtualMachineScaleSetInner; -import com.microsoft.azure.management.network.Backend; +import com.microsoft.azure.management.network.LoadBalancerBackend; import com.microsoft.azure.management.network.InboundNatPool; import com.microsoft.azure.management.network.LoadBalancer; import com.microsoft.azure.management.network.Network; @@ -153,7 +153,7 @@ public interface VirtualMachineScaleSet extends * * @throws IOException the IO exception */ - Map listPrimaryInternetFacingLoadBalancerBackends() throws IOException; + Map listPrimaryInternetFacingLoadBalancerBackends() throws IOException; /** * @return the internet-facing load balancer's inbound NAT pool associated with the primary network interface @@ -177,7 +177,7 @@ public interface VirtualMachineScaleSet extends * * @throws IOException the IO exception */ - Map listPrimaryInternalLoadBalancerBackends() throws IOException; + Map listPrimaryInternalLoadBalancerBackends() throws IOException; /** * @return the inbound NAT pools of the internal load balancer associated with the primary network interface diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetImpl.java index 0f335b665f94..97fc8692b88f 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetImpl.java @@ -28,7 +28,7 @@ import com.microsoft.azure.management.compute.WinRMConfiguration; import com.microsoft.azure.management.compute.WinRMListener; import com.microsoft.azure.management.compute.WindowsConfiguration; -import com.microsoft.azure.management.network.Backend; +import com.microsoft.azure.management.network.LoadBalancerBackend; import com.microsoft.azure.management.network.LoadBalancerFrontend; import com.microsoft.azure.management.network.InboundNatPool; import com.microsoft.azure.management.network.LoadBalancer; @@ -224,7 +224,7 @@ public LoadBalancer getPrimaryInternetFacingLoadBalancer() throws IOException { } @Override - public Map listPrimaryInternetFacingLoadBalancerBackends() throws IOException { + public Map listPrimaryInternetFacingLoadBalancerBackends() throws IOException { if (this.getPrimaryInternetFacingLoadBalancer() != null) { return getBackendsAssociatedWithIpConfiguration(this.primaryInternetFacingLoadBalancer, primaryNicDefaultIPConfiguration()); @@ -250,7 +250,7 @@ public LoadBalancer getPrimaryInternalLoadBalancer() throws IOException { } @Override - public Map listPrimaryInternalLoadBalancerBackends() throws IOException { + public Map listPrimaryInternalLoadBalancerBackends() throws IOException { if (this.getPrimaryInternalLoadBalancer() != null) { return getBackendsAssociatedWithIpConfiguration(this.primaryInternalLoadBalancer, primaryNicDefaultIPConfiguration()); @@ -1232,12 +1232,12 @@ private static void associateInboundNATPoolsToIpConfiguration(String loadBalance } } - private static Map getBackendsAssociatedWithIpConfiguration(LoadBalancer loadBalancer, + private static Map getBackendsAssociatedWithIpConfiguration(LoadBalancer loadBalancer, VirtualMachineScaleSetIPConfigurationInner ipConfig) { String loadBalancerId = loadBalancer.id(); - Map attachedBackends = new HashMap<>(); - Map lbBackends = loadBalancer.backends(); - for (Backend lbBackend : lbBackends.values()) { + Map attachedBackends = new HashMap<>(); + Map lbBackends = loadBalancer.backends(); + for (LoadBalancerBackend lbBackend : lbBackends.values()) { String backendId = mergePath(loadBalancerId, "backendAddressPools", lbBackend.name()); for (SubResource subResource : ipConfig.loadBalancerBackendAddressPools()) { if (subResource.id().equalsIgnoreCase(backendId)) { @@ -1266,10 +1266,10 @@ private static Map getInboundNatPoolsAssociatedWithIpCon private static void associateLoadBalancerToIpConfiguration(LoadBalancer loadBalancer, VirtualMachineScaleSetIPConfigurationInner ipConfig) { - Collection backends = loadBalancer.backends().values(); + Collection backends = loadBalancer.backends().values(); String[] backendNames = new String[backends.size()]; int i = 0; - for (Backend backend : backends) { + for (LoadBalancerBackend backend : backends) { backendNames[i] = backend.name(); i++; } diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancer.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancer.java index 2cf7b2b13ca4..9d94629632ab 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancer.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancer.java @@ -50,7 +50,7 @@ public interface LoadBalancer extends /** * @return backends for this load balancer to load balance the incoming traffic among, indexed by name */ - Map backends(); + Map backends(); /** * @return inbound NAT rules for this balancer @@ -159,7 +159,7 @@ interface WithBackend extends WithVirtualMachine { * @param name the name to assign to the backend * @return the next stage of the update */ - Backend.DefinitionStages.Blank defineBackend(String name); + LoadBalancerBackend.DefinitionStages.Blank defineBackend(String name); } /** @@ -429,14 +429,14 @@ interface WithBackend { * @param name the name for the new backend * @return the first stage of the backend definition */ - Backend.UpdateDefinitionStages.Blank defineBackend(String name); + LoadBalancerBackend.UpdateDefinitionStages.Blank defineBackend(String name); /** * Begins the description of an update to an existing backend of this load balancer. * @param name the name of the backend to update * @return the first stage of the update */ - Backend.Update updateBackend(String name); + LoadBalancerBackend.Update updateBackend(String name); } /** diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/Backend.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancerBackend.java similarity index 98% rename from azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/Backend.java rename to azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancerBackend.java index 4e8f2bfd9533..6586a6267220 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/Backend.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancerBackend.java @@ -20,7 +20,7 @@ * An immutable client-side representation of an load balancer's backend address pool. */ @Fluent() -public interface Backend extends +public interface LoadBalancerBackend extends Wrapper, ChildResource, HasLoadBalancingRules { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancingRule.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancingRule.java index 840d9cb6f7d5..6878bd713826 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancingRule.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/LoadBalancingRule.java @@ -46,7 +46,7 @@ public interface LoadBalancingRule extends /** * @return the backend associated with the load balancing rule */ - Backend backend(); + LoadBalancerBackend backend(); /** * @return the probe associated with the load balancing rule diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NicIpConfiguration.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NicIpConfiguration.java index 40a773e9b397..6ea90ee8640f 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NicIpConfiguration.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/NicIpConfiguration.java @@ -38,7 +38,7 @@ public interface NicIpConfiguration extends /** * @return the load balancer backends associated with this network interface IP configuration */ - List listAssociatedLoadBalancerBackends(); + List listAssociatedLoadBalancerBackends(); /** * @return the load balancer inbound NAT rules associated with this network interface IP configuration diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/BackendImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/BackendImpl.java index 9a8257f47d72..c81df124c88e 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/BackendImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/BackendImpl.java @@ -14,7 +14,7 @@ import com.microsoft.azure.CloudException; import com.microsoft.azure.SubResource; import com.microsoft.azure.management.apigeneration.LangDefinition; -import com.microsoft.azure.management.network.Backend; +import com.microsoft.azure.management.network.LoadBalancerBackend; import com.microsoft.azure.management.network.LoadBalancer; import com.microsoft.azure.management.network.LoadBalancingRule; import com.microsoft.azure.management.network.NetworkInterface; @@ -22,16 +22,16 @@ import com.microsoft.azure.management.resources.fluentcore.arm.models.implementation.ChildResourceImpl; /** - * Implementation for {@link Backend}. + * Implementation for {@link LoadBalancerBackend}. */ @LangDefinition class BackendImpl extends ChildResourceImpl implements - Backend, - Backend.Definition, - Backend.UpdateDefinition, - Backend.Update { + LoadBalancerBackend, + LoadBalancerBackend.Definition, + LoadBalancerBackend.UpdateDefinition, + LoadBalancerBackend.Update { BackendImpl(BackendAddressPoolInner inner, LoadBalancerImpl parent) { super(inner, parent); diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java index ccc412a92cf5..3d1c48412634 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java @@ -6,7 +6,7 @@ package com.microsoft.azure.management.network.implementation; import com.microsoft.azure.SubResource; -import com.microsoft.azure.management.network.Backend; +import com.microsoft.azure.management.network.LoadBalancerBackend; import com.microsoft.azure.management.network.LoadBalancerFrontend; import com.microsoft.azure.management.network.LoadBalancerHttpProbe; import com.microsoft.azure.management.network.InboundNatPool; @@ -58,7 +58,7 @@ class LoadBalancerImpl private final HashMap nicsInBackends = new HashMap<>(); private final HashMap creatablePIPKeys = new HashMap<>(); - private Map backends; + private Map backends; private Map tcpProbes; private Map httpProbes; private Map loadBalancingRules; @@ -524,7 +524,7 @@ private FrontendImpl defineFrontend(String name) { @Override public BackendImpl defineBackend(String name) { - Backend backend = this.backends.get(name); + LoadBalancerBackend backend = this.backends.get(name); if (backend == null) { BackendAddressPoolInner inner = new BackendAddressPoolInner() .withName(name); @@ -617,7 +617,7 @@ public LoadBalancerImpl withoutFrontend(String name) { // Getters @Override - public Map backends() { + public Map backends() { return Collections.unmodifiableMap(this.backends); } diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancingRuleImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancingRuleImpl.java index a080882286a2..c229a35ce915 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancingRuleImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancingRuleImpl.java @@ -7,7 +7,7 @@ import com.microsoft.azure.SubResource; import com.microsoft.azure.management.apigeneration.LangDefinition; -import com.microsoft.azure.management.network.Backend; +import com.microsoft.azure.management.network.LoadBalancerBackend; import com.microsoft.azure.management.network.LoadBalancerFrontend; import com.microsoft.azure.management.network.LoadBalancer; import com.microsoft.azure.management.network.LoadBalancingRule; @@ -86,7 +86,7 @@ public LoadBalancerFrontend frontend() { } @Override - public Backend backend() { + public LoadBalancerBackend backend() { SubResource backendRef = this.inner().backendAddressPool(); if (backendRef == null) { return null; diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NicIpConfigurationImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NicIpConfigurationImpl.java index 0eeeea2b4bce..435afd0341f2 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NicIpConfigurationImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NicIpConfigurationImpl.java @@ -2,7 +2,7 @@ import com.microsoft.azure.SubResource; import com.microsoft.azure.management.apigeneration.LangDefinition; -import com.microsoft.azure.management.network.Backend; +import com.microsoft.azure.management.network.LoadBalancerBackend; import com.microsoft.azure.management.network.IPAllocationMethod; import com.microsoft.azure.management.network.IPVersion; import com.microsoft.azure.management.network.InboundNatRule; @@ -409,10 +409,10 @@ public List listAssociatedLoadBalancerInboundNatRules() { } @Override - public List listAssociatedLoadBalancerBackends() { + public List listAssociatedLoadBalancerBackends() { final List backendRefs = this.inner().loadBalancerBackendAddressPools(); final Map loadBalancers = new HashMap<>(); - final List backends = new ArrayList<>(); + final List backends = new ArrayList<>(); if (backendRefs != null) { for (BackendAddressPoolInner backendRef : backendRefs) { diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java b/azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java index f9e02d6dc5e3..7ade897dd48c 100644 --- a/azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java +++ b/azure-samples/src/main/java/com/microsoft/azure/management/samples/Utils.java @@ -31,7 +31,7 @@ import com.microsoft.azure.management.network.InboundNatPool; import com.microsoft.azure.management.network.InboundNatRule; import com.microsoft.azure.management.network.LoadBalancerFrontend; -import com.microsoft.azure.management.network.Backend; +import com.microsoft.azure.management.network.LoadBalancerBackend; import com.microsoft.azure.management.network.LoadBalancerProbe; import com.microsoft.azure.management.network.LoadBalancerHttpProbe; import com.microsoft.azure.management.network.PublicFrontend; @@ -410,7 +410,7 @@ public static void print(LoadBalancer resource) { info.append("\n\t\t\tFrontend port: ").append(rule.frontendPort()); - Backend backend = rule.backend(); + LoadBalancerBackend backend = rule.backend(); info.append("\n\t\t\tBackend: "); if (backend != null) { info.append(backend.name()); @@ -498,7 +498,7 @@ public static void print(LoadBalancer resource) { // Show backends info.append("\n\tBackends: ") .append(resource.backends().size()); - for (Backend backend : resource.backends().values()) { + for (LoadBalancerBackend backend : resource.backends().values()) { info.append("\n\t\tBackend name: ").append(backend.name()); // Show assigned backend NICs diff --git a/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java b/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java index 8b14f1c4a557..c15a6c75c629 100644 --- a/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java +++ b/azure/src/test/java/com/microsoft/azure/management/TestLoadBalancer.java @@ -16,7 +16,7 @@ import com.microsoft.azure.management.compute.VirtualMachine; import com.microsoft.azure.management.compute.VirtualMachineSizeTypes; import com.microsoft.azure.management.compute.VirtualMachines; -import com.microsoft.azure.management.network.Backend; +import com.microsoft.azure.management.network.LoadBalancerBackend; import com.microsoft.azure.management.network.LoadBalancerFrontend; import com.microsoft.azure.management.network.LoadBalancerHttpProbe; import com.microsoft.azure.management.network.InboundNatPool; @@ -719,7 +719,7 @@ static void printLB(LoadBalancer resource) { info.append("\n\t\t\tFrontend port: ").append(rule.frontendPort()); - Backend backend = rule.backend(); + LoadBalancerBackend backend = rule.backend(); info.append("\n\t\t\tBackend: "); if (backend != null) { info.append(backend.name()); @@ -807,7 +807,7 @@ static void printLB(LoadBalancer resource) { // Show backends info.append("\n\tBackends: ") .append(resource.backends().size()); - for (Backend backend : resource.backends().values()) { + for (LoadBalancerBackend backend : resource.backends().values()) { info.append("\n\t\tBackend name: ").append(backend.name()); // Show assigned backend NICs diff --git a/azure/src/test/java/com/microsoft/azure/management/TestNetworkInterface.java b/azure/src/test/java/com/microsoft/azure/management/TestNetworkInterface.java index 7a21ec702019..c96b0f3d5d09 100644 --- a/azure/src/test/java/com/microsoft/azure/management/TestNetworkInterface.java +++ b/azure/src/test/java/com/microsoft/azure/management/TestNetworkInterface.java @@ -9,7 +9,7 @@ import org.junit.Assert; -import com.microsoft.azure.management.network.Backend; +import com.microsoft.azure.management.network.LoadBalancerBackend; import com.microsoft.azure.management.network.InboundNatRule; import com.microsoft.azure.management.network.NetworkInterface; import com.microsoft.azure.management.network.NetworkInterfaces; @@ -84,9 +84,9 @@ public static void printNic(NetworkInterface resource) { .append("\n\t\tAssociated subnet name: ").append(ipConfig.subnetName()); // Show associated load balancer backends - final List backends = ipConfig.listAssociatedLoadBalancerBackends(); + final List backends = ipConfig.listAssociatedLoadBalancerBackends(); info.append("\n\t\tAssociated load balancer backends: ").append(backends.size()); - for (Backend backend : backends) { + for (LoadBalancerBackend backend : backends) { info.append("\n\t\t\tLoad balancer ID: ").append(backend.parent().id()) .append("\n\t\t\t\tBackend name: ").append(backend.name()); } From 24f385174bd4140a589a9fa320905077a97b38bf Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Oct 2016 18:27:08 -0700 Subject: [PATCH 9/9] Load balancer-related impl renames corresponding to interface renames --- ...Impl.java => LoadBalancerBackendImpl.java} | 4 +- ...mpl.java => LoadBalancerFrontendImpl.java} | 18 +++--- .../implementation/LoadBalancerImpl.java | 60 +++++++++---------- ...beImpl.java => LoadBalancerProbeImpl.java} | 12 ++-- 4 files changed, 47 insertions(+), 47 deletions(-) rename azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/{BackendImpl.java => LoadBalancerBackendImpl.java} (97%) rename azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/{FrontendImpl.java => LoadBalancerFrontendImpl.java} (90%) rename azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/{ProbeImpl.java => LoadBalancerProbeImpl.java} (90%) diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/BackendImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerBackendImpl.java similarity index 97% rename from azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/BackendImpl.java rename to azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerBackendImpl.java index c81df124c88e..370542032d9f 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/BackendImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerBackendImpl.java @@ -25,7 +25,7 @@ * Implementation for {@link LoadBalancerBackend}. */ @LangDefinition -class BackendImpl +class LoadBalancerBackendImpl extends ChildResourceImpl implements LoadBalancerBackend, @@ -33,7 +33,7 @@ class BackendImpl LoadBalancerBackend.UpdateDefinition, LoadBalancerBackend.Update { - BackendImpl(BackendAddressPoolInner inner, LoadBalancerImpl parent) { + LoadBalancerBackendImpl(BackendAddressPoolInner inner, LoadBalancerImpl parent) { super(inner, parent); } diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/FrontendImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerFrontendImpl.java similarity index 90% rename from azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/FrontendImpl.java rename to azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerFrontendImpl.java index ca935e8c0e71..dd409e586468 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/FrontendImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerFrontendImpl.java @@ -28,7 +28,7 @@ * Implementation for {@link PublicFrontend}. */ @LangDefinition -class FrontendImpl +class LoadBalancerFrontendImpl extends ChildResourceImpl implements LoadBalancerFrontend, @@ -41,7 +41,7 @@ class FrontendImpl PublicFrontend.UpdateDefinition, PublicFrontend.Update { - FrontendImpl(FrontendIPConfigurationInner inner, LoadBalancerImpl parent) { + LoadBalancerFrontendImpl(FrontendIPConfigurationInner inner, LoadBalancerImpl parent) { super(inner, parent); } @@ -143,12 +143,12 @@ public Map inboundNatRules() { // Fluent setters @Override - public FrontendImpl withExistingSubnet(Network network, String subnetName) { + public LoadBalancerFrontendImpl withExistingSubnet(Network network, String subnetName) { return this.withExistingSubnet(network.id(), subnetName); } @Override - public FrontendImpl withExistingSubnet(String parentNetworkResourceId, String subnetName) { + public LoadBalancerFrontendImpl withExistingSubnet(String parentNetworkResourceId, String subnetName) { SubResource subnetRef = new SubResource() .withId(parentNetworkResourceId + "/subnets/" + subnetName); this.inner() @@ -158,12 +158,12 @@ public FrontendImpl withExistingSubnet(String parentNetworkResourceId, String su } @Override - public FrontendImpl withExistingPublicIpAddress(PublicIpAddress pip) { + public LoadBalancerFrontendImpl withExistingPublicIpAddress(PublicIpAddress pip) { return this.withExistingPublicIpAddress(pip.id()); } @Override - public FrontendImpl withExistingPublicIpAddress(String resourceId) { + public LoadBalancerFrontendImpl withExistingPublicIpAddress(String resourceId) { SubResource pipRef = new SubResource().withId(resourceId); this.inner() .withPublicIPAddress(pipRef) @@ -176,13 +176,13 @@ public FrontendImpl withExistingPublicIpAddress(String resourceId) { } @Override - public FrontendImpl withoutPublicIpAddress() { + public LoadBalancerFrontendImpl withoutPublicIpAddress() { this.inner().withPublicIPAddress(null); return this; } @Override - public FrontendImpl withPrivateIpAddressDynamic() { + public LoadBalancerFrontendImpl withPrivateIpAddressDynamic() { this.inner() .withPrivateIPAddress(null) .withPrivateIPAllocationMethod(IPAllocationMethod.DYNAMIC) @@ -193,7 +193,7 @@ public FrontendImpl withPrivateIpAddressDynamic() { } @Override - public FrontendImpl withPrivateIpAddressStatic(String ipAddress) { + public LoadBalancerFrontendImpl withPrivateIpAddressStatic(String ipAddress) { this.inner() .withPrivateIPAddress(ipAddress) .withPrivateIPAllocationMethod(IPAllocationMethod.STATIC) diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java index 3d1c48412634..e595b713aeed 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java @@ -198,7 +198,7 @@ private void initializeFrontendsFromInner() { List frontendsInner = this.inner().frontendIPConfigurations(); if (frontendsInner != null) { for (FrontendIPConfigurationInner frontendInner : frontendsInner) { - FrontendImpl frontend = new FrontendImpl(frontendInner, this); + LoadBalancerFrontendImpl frontend = new LoadBalancerFrontendImpl(frontendInner, this); this.frontends.put(frontendInner.name(), frontend); } } @@ -209,7 +209,7 @@ private void initializeBackendsFromInner() { List backendsInner = this.inner().backendAddressPools(); if (backendsInner != null) { for (BackendAddressPoolInner backendInner : backendsInner) { - BackendImpl backend = new BackendImpl(backendInner, this); + LoadBalancerBackendImpl backend = new LoadBalancerBackendImpl(backendInner, this); this.backends.put(backendInner.name(), backend); } } @@ -220,7 +220,7 @@ private void initializeProbesFromInner() { this.tcpProbes = new TreeMap<>(); if (this.inner().probes() != null) { for (ProbeInner probeInner : this.inner().probes()) { - ProbeImpl probe = new ProbeImpl(probeInner, this); + LoadBalancerProbeImpl probe = new LoadBalancerProbeImpl(probeInner, this); if (probeInner.protocol().equals(ProbeProtocol.TCP)) { this.tcpProbes.put(probeInner.name(), probe); } else if (probeInner.protocol().equals(ProbeProtocol.HTTP)) { @@ -274,7 +274,7 @@ String futureResourceId() { .append(this.name()).toString(); } - LoadBalancerImpl withFrontend(FrontendImpl frontend) { + LoadBalancerImpl withFrontend(LoadBalancerFrontendImpl frontend) { if (frontend == null) { return null; } else { @@ -283,7 +283,7 @@ LoadBalancerImpl withFrontend(FrontendImpl frontend) { } } - LoadBalancerImpl withProbe(ProbeImpl probe) { + LoadBalancerImpl withProbe(LoadBalancerProbeImpl probe) { if (probe == null) { return null; } else if (probe.protocol() == ProbeProtocol.HTTP) { @@ -321,7 +321,7 @@ LoadBalancerImpl withInboundNatPool(InboundNatPoolImpl inboundNatPool) { } } - LoadBalancerImpl withBackend(BackendImpl backend) { + LoadBalancerImpl withBackend(LoadBalancerBackendImpl backend) { if (backend == null) { return null; } else { @@ -439,29 +439,29 @@ public LoadBalancerImpl withHttpProbe(String path) { } @Override - public ProbeImpl defineTcpProbe(String name) { + public LoadBalancerProbeImpl defineTcpProbe(String name) { LoadBalancerProbe probe = this.tcpProbes.get(name); if (probe == null) { ProbeInner inner = new ProbeInner() .withName(name) .withProtocol(ProbeProtocol.TCP); - return new ProbeImpl(inner, this); + return new LoadBalancerProbeImpl(inner, this); } else { - return (ProbeImpl) probe; + return (LoadBalancerProbeImpl) probe; } } @Override - public ProbeImpl defineHttpProbe(String name) { + public LoadBalancerProbeImpl defineHttpProbe(String name) { LoadBalancerProbe probe = this.httpProbes.get(name); if (probe == null) { ProbeInner inner = new ProbeInner() .withName(name) .withProtocol(ProbeProtocol.HTTP) .withPort(80); - return new ProbeImpl(inner, this); + return new LoadBalancerProbeImpl(inner, this); } else { - return (ProbeImpl) probe; + return (LoadBalancerProbeImpl) probe; } } @@ -502,35 +502,35 @@ public InboundNatPoolImpl defineInboundNatPool(String name) { } @Override - public FrontendImpl definePrivateFrontend(String name) { + public LoadBalancerFrontendImpl definePrivateFrontend(String name) { return defineFrontend(name); } @Override - public FrontendImpl definePublicFrontend(String name) { + public LoadBalancerFrontendImpl definePublicFrontend(String name) { return defineFrontend(name); } - private FrontendImpl defineFrontend(String name) { + private LoadBalancerFrontendImpl defineFrontend(String name) { LoadBalancerFrontend frontend = this.frontends.get(name); if (frontend == null) { FrontendIPConfigurationInner inner = new FrontendIPConfigurationInner() .withName(name); - return new FrontendImpl(inner, this); + return new LoadBalancerFrontendImpl(inner, this); } else { - return (FrontendImpl) frontend; + return (LoadBalancerFrontendImpl) frontend; } } @Override - public BackendImpl defineBackend(String name) { + public LoadBalancerBackendImpl defineBackend(String name) { LoadBalancerBackend backend = this.backends.get(name); if (backend == null) { BackendAddressPoolInner inner = new BackendAddressPoolInner() .withName(name); - return new BackendImpl(inner, this); + return new LoadBalancerBackendImpl(inner, this); } else { - return (BackendImpl) backend; + return (LoadBalancerBackendImpl) backend; } } @@ -545,23 +545,23 @@ public LoadBalancerImpl withoutProbe(String name) { } @Override - public ProbeImpl updateTcpProbe(String name) { - return (ProbeImpl) this.tcpProbes.get(name); + public LoadBalancerProbeImpl updateTcpProbe(String name) { + return (LoadBalancerProbeImpl) this.tcpProbes.get(name); } @Override - public BackendImpl updateBackend(String name) { - return (BackendImpl) this.backends.get(name); + public LoadBalancerBackendImpl updateBackend(String name) { + return (LoadBalancerBackendImpl) this.backends.get(name); } @Override - public FrontendImpl updateInternetFrontend(String name) { - return (FrontendImpl) this.frontends.get(name); + public LoadBalancerFrontendImpl updateInternetFrontend(String name) { + return (LoadBalancerFrontendImpl) this.frontends.get(name); } @Override - public FrontendImpl updateInternalFrontend(String name) { - return (FrontendImpl) this.frontends.get(name); + public LoadBalancerFrontendImpl updateInternalFrontend(String name) { + return (LoadBalancerFrontendImpl) this.frontends.get(name); } @Override @@ -575,8 +575,8 @@ public InboundNatPoolImpl updateInboundNatPool(String name) { } @Override - public ProbeImpl updateHttpProbe(String name) { - return (ProbeImpl) this.httpProbes.get(name); + public LoadBalancerProbeImpl updateHttpProbe(String name) { + return (LoadBalancerProbeImpl) this.httpProbes.get(name); } @Override diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ProbeImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerProbeImpl.java similarity index 90% rename from azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ProbeImpl.java rename to azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerProbeImpl.java index c5687df0dbc5..fb0b949a1714 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ProbeImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerProbeImpl.java @@ -23,7 +23,7 @@ * Implementation for {@link LoadBalancerTcpProbe} and its create and update interfaces. */ @LangDefinition -class ProbeImpl +class LoadBalancerProbeImpl extends ChildResourceImpl implements LoadBalancerTcpProbe, @@ -35,7 +35,7 @@ class ProbeImpl LoadBalancerHttpProbe.UpdateDefinition, LoadBalancerHttpProbe.Update { - ProbeImpl(ProbeInner inner, LoadBalancerImpl parent) { + LoadBalancerProbeImpl(ProbeInner inner, LoadBalancerImpl parent) { super(inner, parent); } @@ -90,25 +90,25 @@ public Map loadBalancingRules() { // Fluent setters @Override - public ProbeImpl withPort(int port) { + public LoadBalancerProbeImpl withPort(int port) { this.inner().withPort(port); return this; } @Override - public ProbeImpl withRequestPath(String requestPath) { + public LoadBalancerProbeImpl withRequestPath(String requestPath) { this.inner().withRequestPath(requestPath); return this; } @Override - public ProbeImpl withIntervalInSeconds(int seconds) { + public LoadBalancerProbeImpl withIntervalInSeconds(int seconds) { this.inner().withIntervalInSeconds(seconds); return this; } @Override - public ProbeImpl withNumberOfProbes(int probes) { + public LoadBalancerProbeImpl withNumberOfProbes(int probes) { this.inner().withNumberOfProbes(probes); return this; }