Search in sources :

Example 1 with ResourcePasswordDefinitionType

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;
}
Also used : ResourcePasswordDefinitionType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourcePasswordDefinitionType) ResourceObjectTypeDefinitionType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceObjectTypeDefinitionType)

Aggregations

ResourceObjectTypeDefinitionType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceObjectTypeDefinitionType)1 ResourcePasswordDefinitionType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourcePasswordDefinitionType)1