@Override public Map<String, ApplicationGatewayAuthenticationCertificate> authenticationCertificates() { Map<String, ApplicationGatewayAuthenticationCertificate> certs = new TreeMap<>(); if (this.inner().authenticationCertificates() == null) { return Collections.unmodifiableMap(certs); } else { for (SubResource ref : this.inner().authenticationCertificates()) { ApplicationGatewayAuthenticationCertificate cert = this.parent().authenticationCertificates().get(ResourceUtils.nameFromResourceId(ref.id())); if (cert != null) { certs.put(cert.name(), cert); } } } return Collections.unmodifiableMap(certs); }
@Override public Map<String, ApplicationGatewayAuthenticationCertificate> authenticationCertificates() { Map<String, ApplicationGatewayAuthenticationCertificate> certs = new TreeMap<>(); if (this.inner().authenticationCertificates() == null) { return Collections.unmodifiableMap(certs); } else { for (SubResource ref : this.inner().authenticationCertificates()) { ApplicationGatewayAuthenticationCertificate cert = this.parent().authenticationCertificates().get(ResourceUtils.nameFromResourceId(ref.id())); if (cert != null) { certs.put(cert.name(), cert); } } } return Collections.unmodifiableMap(certs); }
@Override public ApplicationGatewayBackendHttpConfigurationImpl withAuthenticationCertificateFromBase64(String base64Data) { if (base64Data == null) { return this; } String certName = null; for (ApplicationGatewayAuthenticationCertificate cert : this.parent().authenticationCertificates().values()) { if (cert.data().contentEquals(base64Data)) { certName = cert.name(); break; } } // If matching cert reference not found, create a new one if (certName == null) { certName = SdkContext.randomResourceName("cert", 20); this.parent().defineAuthenticationCertificate(certName) .fromBase64(base64Data) .attach(); } return this.withAuthenticationCertificate(certName).withHttps(); }
@Override public ApplicationGatewayBackendHttpConfigurationImpl withAuthenticationCertificateFromBase64(String base64Data) { if (base64Data == null) { return this; } String certName = null; for (ApplicationGatewayAuthenticationCertificate cert : this.parent().authenticationCertificates().values()) { if (cert.data().contentEquals(base64Data)) { certName = cert.name(); break; } } // If matching cert reference not found, create a new one if (certName == null) { certName = SdkContext.randomResourceName("cert", 20); this.parent().defineAuthenticationCertificate(certName) .fromBase64(base64Data) .attach(); } return this.withAuthenticationCertificate(certName).withHttps(); }