Skip to content

Commit

Permalink
Merge pull request #1178 from martinsawicki/martin-plumbing
Browse files Browse the repository at this point in the history
Some interface refactoring and renames for better consistency enforcement
  • Loading branch information
Martin Sawicki authored Oct 12, 2016
2 parents 54b1304 + 24f3851 commit b807b7a
Show file tree
Hide file tree
Showing 41 changed files with 255 additions and 253 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ public interface ApplicationPackage extends
ExternalChildResource<ApplicationPackage, Application>,
Wrapper<ApplicationPackageInner> {

/**
* @return the name of application package.
*/
String name();

/**
* @return the sate of the application package
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@

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;

/**
* An immutable client-side representation of an Azure virtual machine extension image type.
*/
@Fluent
public interface VirtualMachineExtensionImageType extends
Wrapper<VirtualMachineExtensionImageInner> {
Wrapper<VirtualMachineExtensionImageInner>,
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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@

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;

/**
* An immutable client-side representation of an Azure virtual machine extension image version.
*/
@Fluent
public interface VirtualMachineExtensionImageVersion extends
Wrapper<VirtualMachineExtensionImageInner> {
Wrapper<VirtualMachineExtensionImageInner>,
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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -153,7 +153,7 @@ public interface VirtualMachineScaleSet extends
*
* @throws IOException the IO exception
*/
Map<String, Backend> listPrimaryInternetFacingLoadBalancerBackends() throws IOException;
Map<String, LoadBalancerBackend> listPrimaryInternetFacingLoadBalancerBackends() throws IOException;

/**
* @return the internet-facing load balancer's inbound NAT pool associated with the primary network interface
Expand All @@ -177,7 +177,7 @@ public interface VirtualMachineScaleSet extends
*
* @throws IOException the IO exception
*/
Map<String, Backend> listPrimaryInternalLoadBalancerBackends() throws IOException;
Map<String, LoadBalancerBackend> listPrimaryInternalLoadBalancerBackends() throws IOException;

/**
* @return the inbound NAT pools of the internal load balancer associated with the primary network interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
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.Frontend;
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;
import com.microsoft.azure.management.network.Network;
Expand Down Expand Up @@ -224,7 +224,7 @@ public LoadBalancer getPrimaryInternetFacingLoadBalancer() throws IOException {
}

@Override
public Map<String, Backend> listPrimaryInternetFacingLoadBalancerBackends() throws IOException {
public Map<String, LoadBalancerBackend> listPrimaryInternetFacingLoadBalancerBackends() throws IOException {
if (this.getPrimaryInternetFacingLoadBalancer() != null) {
return getBackendsAssociatedWithIpConfiguration(this.primaryInternetFacingLoadBalancer,
primaryNicDefaultIPConfiguration());
Expand All @@ -250,7 +250,7 @@ public LoadBalancer getPrimaryInternalLoadBalancer() throws IOException {
}

@Override
public Map<String, Backend> listPrimaryInternalLoadBalancerBackends() throws IOException {
public Map<String, LoadBalancerBackend> listPrimaryInternalLoadBalancerBackends() throws IOException {
if (this.getPrimaryInternalLoadBalancer() != null) {
return getBackendsAssociatedWithIpConfiguration(this.primaryInternalLoadBalancer,
primaryNicDefaultIPConfiguration());
Expand Down Expand Up @@ -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());
}
Expand Down Expand Up @@ -1232,12 +1232,12 @@ private static void associateInboundNATPoolsToIpConfiguration(String loadBalance
}
}

private static Map<String, Backend> getBackendsAssociatedWithIpConfiguration(LoadBalancer loadBalancer,
private static Map<String, LoadBalancerBackend> getBackendsAssociatedWithIpConfiguration(LoadBalancer loadBalancer,
VirtualMachineScaleSetIPConfigurationInner ipConfig) {
String loadBalancerId = loadBalancer.id();
Map<String, Backend> attachedBackends = new HashMap<>();
Map<String, Backend> lbBackends = loadBalancer.backends();
for (Backend lbBackend : lbBackends.values()) {
Map<String, LoadBalancerBackend> attachedBackends = new HashMap<>();
Map<String, LoadBalancerBackend> 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)) {
Expand Down Expand Up @@ -1266,10 +1266,10 @@ private static Map<String, InboundNatPool> getInboundNatPoolsAssociatedWithIpCon

private static void associateLoadBalancerToIpConfiguration(LoadBalancer loadBalancer,
VirtualMachineScaleSetIPConfigurationInner ipConfig) {
Collection<Backend> backends = loadBalancer.backends().values();
Collection<LoadBalancerBackend> 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++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ public interface LoadBalancer extends
/**
* @return TCP probes of this load balancer, indexed by the name
*/
Map<String, TcpProbe> tcpProbes();
Map<String, LoadBalancerTcpProbe> tcpProbes();

/**
* @return HTTP probes of this load balancer, indexed by the name
*/
Map<String, HttpProbe> httpProbes();
Map<String, LoadBalancerHttpProbe> httpProbes();

/**
* @return backends for this load balancer to load balance the incoming traffic among, indexed by name
*/
Map<String, Backend> backends();
Map<String, LoadBalancerBackend> backends();

/**
* @return inbound NAT rules for this balancer
Expand All @@ -60,7 +60,7 @@ public interface LoadBalancer extends
/**
* @return frontends for this load balancer, for the incoming traffic to come from.
*/
Map<String, Frontend> frontends();
Map<String, LoadBalancerFrontend> frontends();

/**
* @return inbound NAT pools, indexed by name
Expand Down Expand Up @@ -159,7 +159,7 @@ interface WithBackend extends WithVirtualMachine<WithBackendOrProbe> {
* @param name the name to assign to the backend
* @return the next stage of the update
*/
Backend.DefinitionStages.Blank<WithBackendOrProbe> defineBackend(String name);
LoadBalancerBackend.DefinitionStages.Blank<WithBackendOrProbe> defineBackend(String name);
}

/**
Expand Down Expand Up @@ -193,20 +193,20 @@ interface WithProbe {
/**
* Begins the definition of a new TCP probe to add to the load balancer.
* <p>
* 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<WithProbeOrLoadBalancingRule> defineTcpProbe(String name);
LoadBalancerTcpProbe.DefinitionStages.Blank<WithProbeOrLoadBalancingRule> defineTcpProbe(String name);

/**
* Begins the definition of a new HTTP probe to add to the load balancer.
* <p>
* 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<WithProbeOrLoadBalancingRule> defineHttpProbe(String name);
LoadBalancerHttpProbe.DefinitionStages.Blank<WithProbeOrLoadBalancingRule> defineHttpProbe(String name);
}

/**
Expand Down Expand Up @@ -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<Update> defineBackend(String name);
LoadBalancerBackend.UpdateDefinitionStages.Blank<Update> 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);
}

/**
Expand Down Expand Up @@ -464,20 +464,20 @@ interface WithProbe {
/**
* Begins the definition of a new HTTP probe to add to the load balancer.
* <p>
* 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<Update> defineHttpProbe(String name);
LoadBalancerHttpProbe.UpdateDefinitionStages.Blank<Update> defineHttpProbe(String name);

/**
* Begins the definition of a new TCP probe to add to the load balancer.
* <p>
* 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
*/
TcpProbe.UpdateDefinitionStages.Blank<Update> defineTcpProbe(String name);
LoadBalancerTcpProbe.UpdateDefinitionStages.Blank<Update> defineTcpProbe(String name);

/**
* Removes the specified probe from the load balancer, if present.
Expand All @@ -491,14 +491,14 @@ 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.
* @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);
}

/**
Expand Down Expand Up @@ -529,7 +529,7 @@ interface WithLoadBalancingRule {
/**
* Begins the definition of a new load balancing rule to add to the load balancer.
* <p>
* 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
*/
Expand Down
Loading

0 comments on commit b807b7a

Please sign in to comment.