Search in sources :

Example 1 with Redundancy

use of com.microsoft.azure.toolkit.lib.storage.model.Redundancy in project azure-tools-for-java by Microsoft.

the class CreateArmStorageAccountForm method fillReplicationTypes.

private void fillReplicationTypes() {
    replicationComboBox.removeAll();
    Kind kind = (Kind) kindCombo.getData(kindCombo.getText());
    Performance performance = (Performance) performanceCombo.getData(performanceCombo.getText());
    List<Redundancy> redundancies = Objects.isNull(performance) ? Collections.emptyList() : Azure.az(AzureStorageAccount.class).listSupportedRedundancies(performance, kind);
    for (Redundancy redundancy : redundancies) {
        replicationComboBox.add(redundancy.getLabel());
        replicationComboBox.setData(redundancy.getLabel(), redundancy);
    }
    if (redundancies.contains(Redundancy.STANDARD_RAGRS)) {
        replicationComboBox.select(redundancies.indexOf(Redundancy.STANDARD_RAGRS));
    } else {
        replicationComboBox.select(0);
    }
}
Also used : Redundancy(com.microsoft.azure.toolkit.lib.storage.model.Redundancy) Kind(com.microsoft.azure.toolkit.lib.storage.model.Kind) Performance(com.microsoft.azure.toolkit.lib.storage.model.Performance)

Aggregations

Kind (com.microsoft.azure.toolkit.lib.storage.model.Kind)1 Performance (com.microsoft.azure.toolkit.lib.storage.model.Performance)1 Redundancy (com.microsoft.azure.toolkit.lib.storage.model.Redundancy)1