Search in sources :

Example 41 with ProvisioningException

use of eu.bcvsolutions.idm.acc.exception.ProvisioningException in project CzechIdMng by bcvsolutions.

the class RoleSynchronizationExecutor method findByAttribute.

@Override
protected IdmRoleDto findByAttribute(String idmAttributeName, String value) {
    CorrelationFilter filter = getEntityFilter();
    filter.setProperty(idmAttributeName);
    filter.setValue(value);
    List<IdmRoleDto> entities = roleService.find((IdmRoleFilter) filter, null).getContent();
    if (CollectionUtils.isEmpty(entities)) {
        return null;
    }
    if (entities.size() > 1) {
        throw new ProvisioningException(AccResultCode.SYNCHRONIZATION_CORRELATION_TO_MANY_RESULTS, ImmutableMap.of("correlationAttribute", idmAttributeName, "value", value));
    }
    if (entities.size() == 1) {
        return entities.get(0);
    }
    return null;
}
Also used : IdmRoleDto(eu.bcvsolutions.idm.core.api.dto.IdmRoleDto) CorrelationFilter(eu.bcvsolutions.idm.core.api.dto.filter.CorrelationFilter) IdmRoleFilter(eu.bcvsolutions.idm.core.api.dto.filter.IdmRoleFilter) ProvisioningException(eu.bcvsolutions.idm.acc.exception.ProvisioningException)

Aggregations

ProvisioningException (eu.bcvsolutions.idm.acc.exception.ProvisioningException)41 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)20 SysSystemMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto)19 IcConnectorObject (eu.bcvsolutions.idm.ic.api.IcConnectorObject)17 SystemEntityType (eu.bcvsolutions.idm.acc.domain.SystemEntityType)16 SysSchemaObjectClassDto (eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto)15 SysSystemAttributeMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto)14 IcConnectorConfiguration (eu.bcvsolutions.idm.ic.api.IcConnectorConfiguration)14 List (java.util.List)13 UUID (java.util.UUID)13 ImmutableMap (com.google.common.collect.ImmutableMap)12 AccResultCode (eu.bcvsolutions.idm.acc.domain.AccResultCode)12 SysSystemEntityDto (eu.bcvsolutions.idm.acc.dto.SysSystemEntityDto)12 SysSchemaObjectClassService (eu.bcvsolutions.idm.acc.service.api.SysSchemaObjectClassService)12 SysSystemAttributeMappingService (eu.bcvsolutions.idm.acc.service.api.SysSystemAttributeMappingService)12 SysSystemMappingService (eu.bcvsolutions.idm.acc.service.api.SysSystemMappingService)12 ArrayList (java.util.ArrayList)12 AccAccountDto (eu.bcvsolutions.idm.acc.dto.AccAccountDto)11 SysSystemAttributeMappingFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSystemAttributeMappingFilter)11 SysSchemaAttributeService (eu.bcvsolutions.idm.acc.service.api.SysSchemaAttributeService)11