Search in sources :

Example 1 with HostNameSslState

use of com.microsoft.azure.management.appservice.HostNameSslState in project azure-sdk-for-java by Azure.

the class WebAppBaseImpl method normalizeProperties.

@SuppressWarnings("unchecked")
private FluentT normalizeProperties() {
    this.hostNameBindingsToCreate = new HashMap<>();
    this.hostNameBindingsToDelete = new ArrayList<>();
    this.appSettingsToAdd = new HashMap<>();
    this.appSettingsToRemove = new ArrayList<>();
    this.appSettingStickiness = new HashMap<>();
    this.connectionStringsToAdd = new HashMap<>();
    this.connectionStringsToRemove = new ArrayList<>();
    this.connectionStringStickiness = new HashMap<>();
    this.sourceControl = null;
    this.sourceControlToDelete = false;
    this.authenticationToUpdate = false;
    this.sslBindingsToCreate = new HashMap<>();
    if (inner().hostNames() != null) {
        this.hostNamesSet = Sets.newHashSet(inner().hostNames());
    }
    if (inner().enabledHostNames() != null) {
        this.enabledHostNamesSet = Sets.newHashSet(inner().enabledHostNames());
    }
    if (inner().trafficManagerHostNames() != null) {
        this.trafficManagerHostNamesSet = Sets.newHashSet(inner().trafficManagerHostNames());
    }
    if (inner().outboundIpAddresses() != null) {
        this.outboundIPAddressesSet = Sets.newHashSet(inner().outboundIpAddresses().split(",[ ]*"));
    }
    this.hostNameSslStateMap = new HashMap<>();
    if (inner().hostNameSslStates() != null) {
        for (HostNameSslState hostNameSslState : inner().hostNameSslStates()) {
            // Server returns null sometimes, invalid on update, so we set default
            if (hostNameSslState.sslState() == null) {
                hostNameSslState.withSslState(SslState.DISABLED);
            }
            hostNameSslStateMap.put(hostNameSslState.name(), hostNameSslState);
        }
    }
    return (FluentT) this;
}
Also used : HostNameSslState(com.microsoft.azure.management.appservice.HostNameSslState)

Example 2 with HostNameSslState

use of com.microsoft.azure.management.appservice.HostNameSslState in project azure-sdk-for-java by Azure.

the class Utils method print.

/**
     * Print a web app.
     * @param resource a web app
     */
public static void print(WebAppBase resource) {
    StringBuilder builder = new StringBuilder().append("Web app: ").append(resource.id()).append("Name: ").append(resource.name()).append("\n\tState: ").append(resource.state()).append("\n\tResource group: ").append(resource.resourceGroupName()).append("\n\tRegion: ").append(resource.region()).append("\n\tDefault hostname: ").append(resource.defaultHostName()).append("\n\tApp service plan: ").append(resource.appServicePlanId()).append("\n\tHost name bindings: ");
    for (HostNameBinding binding : resource.getHostNameBindings().values()) {
        builder = builder.append("\n\t\t" + binding.toString());
    }
    builder = builder.append("\n\tSSL bindings: ");
    for (HostNameSslState binding : resource.hostNameSslStates().values()) {
        builder = builder.append("\n\t\t" + binding.name() + ": " + binding.sslState());
        if (binding.sslState() != null && binding.sslState() != SslState.DISABLED) {
            builder = builder.append(" - " + binding.thumbprint());
        }
    }
    builder = builder.append("\n\tApp settings: ");
    for (AppSetting setting : resource.appSettings().values()) {
        builder = builder.append("\n\t\t" + setting.key() + ": " + setting.value() + (setting.sticky() ? " - slot setting" : ""));
    }
    builder = builder.append("\n\tConnection strings: ");
    for (ConnectionString conn : resource.connectionStrings().values()) {
        builder = builder.append("\n\t\t" + conn.name() + ": " + conn.value() + " - " + conn.type() + (conn.sticky() ? " - slot setting" : ""));
    }
    System.out.println(builder.toString());
}
Also used : HostNameSslState(com.microsoft.azure.management.appservice.HostNameSslState) ConnectionString(com.microsoft.azure.management.appservice.ConnectionString) HostNameBinding(com.microsoft.azure.management.appservice.HostNameBinding) AppSetting(com.microsoft.azure.management.appservice.AppSetting)

Aggregations

HostNameSslState (com.microsoft.azure.management.appservice.HostNameSslState)2 AppSetting (com.microsoft.azure.management.appservice.AppSetting)1 ConnectionString (com.microsoft.azure.management.appservice.ConnectionString)1 HostNameBinding (com.microsoft.azure.management.appservice.HostNameBinding)1