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);
}
Aggregations