use of com.evolveum.midpoint.xml.ns._public.common.common_3.ResourcePasswordDefinitionType in project midpoint by Evolveum.
the class ResourceDetailsTabPanel method determineCredentialsMappings.
private SourceTarget determineCredentialsMappings(ResourceType resource) {
if (resource.getSchemaHandling() != null && CollectionUtils.isNotEmpty(resource.getSchemaHandling().getObjectType())) {
boolean hasOutbound = false;
boolean hasInbound = false;
for (ResourceObjectTypeDefinitionType resourceObjectTypeDefinition : resource.getSchemaHandling().getObjectType()) {
if (hasInbound && hasOutbound) {
return SourceTarget.SOURCE_TARGET;
}
if (resourceObjectTypeDefinition.getCredentials() == null) {
continue;
}
if (resourceObjectTypeDefinition.getCredentials().getPassword() == null) {
continue;
}
ResourcePasswordDefinitionType passwordDef = resourceObjectTypeDefinition.getCredentials().getPassword();
if (!hasOutbound) {
hasOutbound = passwordDef.getOutbound() != null;
}
if (!hasInbound) {
hasInbound = CollectionUtils.isNotEmpty(passwordDef.getInbound());
}
}
if (hasInbound) {
return SourceTarget.SOURCE;
}
if (hasOutbound) {
return SourceTarget.TARGET;
}
}
return SourceTarget.NOT_DEFINED;
}
Aggregations