Search in sources :

Example 1 with ContainerRegistryProperty

use of com.microsoft.azuretools.core.mvp.ui.containerregistry.ContainerRegistryProperty in project azure-tools-for-java by Microsoft.

the class ContainerRegistryPropertyViewPresenter method getProperty.

private ContainerRegistryProperty getProperty(Registry registry, String sid) {
    String userName = "";
    String password = "";
    String password2 = "";
    if (registry.adminUserEnabled()) {
        RegistryCredentials credentials = registry.getCredentials();
        userName = credentials.username();
        Map<AccessKeyType, String> passwords = credentials.accessKeys();
        password = passwords.get(AccessKeyType.PRIMARY) == null ? "" : passwords.get(AccessKeyType.PRIMARY);
        password2 = passwords.get(AccessKeyType.SECONDARY) == null ? "" : passwords.get(AccessKeyType.SECONDARY);
    }
    return new ContainerRegistryProperty(registry.id(), registry.name(), registry.type(), registry.resourceGroupName(), registry.regionName(), sid, registry.loginServerUrl(), registry.adminUserEnabled(), userName, password, password2);
}
Also used : AccessKeyType(com.microsoft.azure.management.containerregistry.AccessKeyType) ContainerRegistryProperty(com.microsoft.azuretools.core.mvp.ui.containerregistry.ContainerRegistryProperty) RegistryCredentials(com.microsoft.azure.management.containerregistry.RegistryCredentials)

Aggregations

AccessKeyType (com.microsoft.azure.management.containerregistry.AccessKeyType)1 RegistryCredentials (com.microsoft.azure.management.containerregistry.RegistryCredentials)1 ContainerRegistryProperty (com.microsoft.azuretools.core.mvp.ui.containerregistry.ContainerRegistryProperty)1