LoadBalancerImpl withNewPublicIPAddress(Creatable<PublicIPAddress> creatablePip, String frontendName) { String existingPipFrontendName = this.creatablePIPKeys.get(creatablePip.key()); if (frontendName == null) { if (existingPipFrontendName != null) { // Reuse frontend already associated with this PIP frontendName = existingPipFrontendName; } else { // Auto-named unique frontend frontendName = ensureUniqueFrontend().name(); } } if (existingPipFrontendName == null) { // No frontend associated with this PIP yet so create new association this.creatablePIPKeys.put(this.addDependency(creatablePip), frontendName); } else if (!existingPipFrontendName.equalsIgnoreCase(frontendName)) { // Existing PIP definition already in use but under a different frontend, so error throw new IllegalArgumentException("This public IP address definition is already associated with a frontend under a different name."); } return this; }
LoadBalancerImpl withNewPublicIPAddress(Creatable<PublicIPAddress> creatablePip, String frontendName) { String existingPipFrontendName = this.creatablePIPKeys.get(creatablePip.key()); if (frontendName == null) { if (existingPipFrontendName != null) { // Reuse frontend already associated with this PIP frontendName = existingPipFrontendName; } else { // Auto-named unique frontend frontendName = ensureUniqueFrontend().name(); } } if (existingPipFrontendName == null) { // No frontend associated with this PIP yet so create new association this.creatablePIPKeys.put(this.addDependency(creatablePip), frontendName); } else if (!existingPipFrontendName.equalsIgnoreCase(frontendName)) { // Existing PIP definition already in use but under a different frontend, so error throw new IllegalArgumentException("This public IP address definition is already associated with a frontend under a different name."); } return this; }