com.microsoft.azure.management.network.implementation.ApplicationGatewayBackendHttpConfigurationHealthImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-mgmt-network Show documentation
Show all versions of azure-mgmt-network Show documentation
This package contains Microsoft Azure Network Management SDK. This package has been deprecated. A replacement package com.azure.resourcemanager:azure-resourcemanager-network is available as of 31-March-2022. We strongly encourage you to upgrade to continue receiving updates. See Migration Guide https://aka.ms/java-track2-migration-guide for guidance on upgrading. Refer to our deprecation policy https://azure.github.io/azure-sdk/policies_support.html for more details.
/**
* 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.network.implementation;
import java.util.Collections;
import java.util.Map;
import java.util.TreeMap;
import com.microsoft.azure.management.apigeneration.LangDefinition;
import com.microsoft.azure.management.network.ApplicationGatewayBackendHealth;
import com.microsoft.azure.management.network.ApplicationGatewayBackendHealthHttpSettings;
import com.microsoft.azure.management.network.ApplicationGatewayBackendHealthServer;
import com.microsoft.azure.management.network.ApplicationGatewayBackendHttpConfiguration;
import com.microsoft.azure.management.network.ApplicationGatewayBackendHttpConfigurationHealth;
import com.microsoft.azure.management.network.ApplicationGatewayBackendServerHealth;
import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils;
/**
* Implementation of application gateway backend HTTP configuration health information.
*/
@LangDefinition
public class ApplicationGatewayBackendHttpConfigurationHealthImpl implements ApplicationGatewayBackendHttpConfigurationHealth {
private final ApplicationGatewayBackendHealthHttpSettings inner;
private final ApplicationGatewayBackendHealthImpl backendHealth;
private final Map serverHealths = new TreeMap<>();
ApplicationGatewayBackendHttpConfigurationHealthImpl(ApplicationGatewayBackendHealthHttpSettings inner, ApplicationGatewayBackendHealthImpl backendHealth) {
this.inner = inner;
this.backendHealth = backendHealth;
if (inner.servers() != null) {
for (ApplicationGatewayBackendHealthServer serverHealthInner : this.inner().servers()) {
ApplicationGatewayBackendServerHealth serverHealth = new ApplicationGatewayBackendServerHealthImpl(serverHealthInner, this);
this.serverHealths.put(serverHealth.ipAddress(), serverHealth);
}
}
}
@Override
public ApplicationGatewayBackendHealthHttpSettings inner() {
return this.inner;
}
@Override
public String name() {
if (this.inner.backendHttpSettings() != null) {
return ResourceUtils.nameFromResourceId(this.inner.backendHttpSettings().id());
} else {
return null;
}
}
@Override
public ApplicationGatewayBackendHttpConfiguration backendHttpConfiguration() {
if (this.inner.backendHttpSettings() == null) {
return null;
}
String name = ResourceUtils.nameFromResourceId(this.inner.backendHttpSettings().id());
return this.parent().parent().backendHttpConfigurations().get(name);
}
@Override
public ApplicationGatewayBackendHealth parent() {
return this.backendHealth;
}
@Override
public Map serverHealths() {
return Collections.unmodifiableMap(this.serverHealths);
}
}