Search in sources :

Example 51 with IcConnectorObject

use of eu.bcvsolutions.idm.ic.api.IcConnectorObject in project CzechIdMng by bcvsolutions.

the class TreeSynchronizationExecutor method processTreeSync.

/**
 * Execute sync for tree and given accounts.
 *
 * @param context
 * @param accountsMap
 */
private void processTreeSync(SynchronizationContext context, Map<String, IcConnectorObject> accountsMap) {
    AbstractSysSyncConfigDto config = context.getConfig();
    SystemEntityType entityType = context.getEntityType();
    SysSystemDto system = context.getSystem();
    List<SysSystemAttributeMappingDto> mappedAttributes = context.getMappedAttributes();
    SysSyncLogDto log = context.getLog();
    List<SysSyncActionLogDto> actionsLog = context.getActionLogs();
    AttributeMapping tokenAttribute = context.getTokenAttribute();
    // Find UID/PARENT/CODE attribute
    SysSystemAttributeMappingDto uidAttribute = attributeHandlingService.getUidAttribute(mappedAttributes, system);
    SysSystemAttributeMappingDto parentAttribute = getAttributeByIdmProperty(PARENT_FIELD, mappedAttributes);
    SysSystemAttributeMappingDto codeAttribute = getAttributeByIdmProperty(CODE_FIELD, mappedAttributes);
    if (parentAttribute == null) {
        LOG.warn("Parent attribute is not specified! Organization tree will not be recomputed.");
    }
    if (codeAttribute == null) {
        LOG.warn("Code attribute is not specified!");
    }
    // Find all roots
    Collection<String> roots = findRoots(parentAttribute, accountsMap, config, context);
    if (roots.isEmpty()) {
        log.addToLog("No roots to synchronization found!");
    } else {
        log.addToLog(MessageFormat.format("We found [{0}] roots: [{1}]", roots.size(), roots));
    }
    if (parentAttribute == null) {
        // just alias all accounts as roots and process
        roots.addAll(accountsMap.keySet());
    }
    Set<String> accountsUseInTreeList = new HashSet<>(roots.size());
    for (String root : roots) {
        accountsUseInTreeList.add(root);
        IcConnectorObject account = accountsMap.get(root);
        SynchronizationContext itemContext = cloneItemContext(context);
        // 
        itemContext.addUid(// 
        root).addIcObject(// 
        account).addAccount(// 
        null).addTokenAttribute(// 
        tokenAttribute).addGeneratedUid(// 
        null);
        boolean result = handleIcObject(itemContext);
        if (!result) {
            return;
        }
        if (parentAttribute != null) {
            Object uidValueParent = this.getValueByMappedAttribute(uidAttribute, account.getAttributes(), context);
            processChildren(parentAttribute, uidValueParent, uidAttribute, accountsMap, accountsUseInTreeList, itemContext, roots);
        }
    }
    if (config.isReconciliation()) {
        // We do reconciliation (find missing account)
        startReconciliation(entityType, accountsUseInTreeList, config, system, log, actionsLog);
    }
}
Also used : SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) SystemEntityType(eu.bcvsolutions.idm.acc.domain.SystemEntityType) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) SysSyncActionLogDto(eu.bcvsolutions.idm.acc.dto.SysSyncActionLogDto) AbstractSysSyncConfigDto(eu.bcvsolutions.idm.acc.dto.AbstractSysSyncConfigDto) SynchronizationContext(eu.bcvsolutions.idm.acc.domain.SynchronizationContext) IcConnectorObject(eu.bcvsolutions.idm.ic.api.IcConnectorObject) AttributeMapping(eu.bcvsolutions.idm.acc.domain.AttributeMapping) IcConnectorObject(eu.bcvsolutions.idm.ic.api.IcConnectorObject) SysSyncLogDto(eu.bcvsolutions.idm.acc.dto.SysSyncLogDto) HashSet(java.util.HashSet)

Example 52 with IcConnectorObject

use of eu.bcvsolutions.idm.ic.api.IcConnectorObject in project CzechIdMng by bcvsolutions.

the class AbstractPasswordFilterIntegrationTest method checkProcessedPasswordOperation.

protected void checkProcessedPasswordOperation(IdmIdentityDto identity, SysSystemDto system, int expectedOperation, String password) {
    SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
    filter.setEntityIdentifier(identity.getId());
    filter.setSystemId(system.getId());
    List<SysProvisioningArchiveDto> archives = provisioningArchive.find(filter, null).getContent();
    assertEquals(expectedOperation, archives.size());
    for (SysProvisioningArchiveDto archive : archives) {
        ProvisioningContext provisioningContext = archive.getProvisioningContext();
        assertNotNull(provisioningContext);
        IcConnectorObject connectorObject = provisioningContext.getConnectorObject();
        List<IcAttribute> attributes = connectorObject.getAttributes();
        boolean passwordExists = false;
        for (IcAttribute attribute : attributes) {
            if (attribute instanceof IcPasswordAttribute) {
                IcPasswordAttribute passAttr = (IcPasswordAttribute) attribute;
                GuardedString passwordValue = passAttr.getPasswordValue();
                assertNotNull(passwordValue);
                String asString = passwordValue.asString();
                assertEquals(GuardedString.SECRED_PROXY_STRING, asString);
                String passwordOnTargetSystem = getPasswordOnTargetSystem(prepareUid(identity, system));
                if (StringUtils.isNotBlank(password)) {
                    assertEquals(password, passwordOnTargetSystem);
                }
                // Only one password for whole operation
                assertFalse(passwordExists);
                passwordExists = true;
            }
        }
        assertTrue(passwordExists);
    }
}
Also used : ProvisioningContext(eu.bcvsolutions.idm.acc.domain.ProvisioningContext) SysProvisioningOperationFilter(eu.bcvsolutions.idm.acc.dto.filter.SysProvisioningOperationFilter) IcAttribute(eu.bcvsolutions.idm.ic.api.IcAttribute) IcConnectorObject(eu.bcvsolutions.idm.ic.api.IcConnectorObject) SysProvisioningArchiveDto(eu.bcvsolutions.idm.acc.dto.SysProvisioningArchiveDto) IcPasswordAttribute(eu.bcvsolutions.idm.ic.api.IcPasswordAttribute) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString)

Example 53 with IcConnectorObject

use of eu.bcvsolutions.idm.ic.api.IcConnectorObject in project CzechIdMng by bcvsolutions.

the class PrepareConnectorObjectProcessor method processUpdateByAttribute.

/**
 * Resolve update for given attribute
 *
 * @param provisioningAttribute
 * @param provisioningOperation
 * @param existsConnectorObject
 * @param system
 * @param systemEntityUid
 * @param updateConnectorObject
 * @param fullAccountObject
 * @param schemaAttributes
 */
private void processUpdateByAttribute(ProvisioningAttributeDto provisioningAttribute, SysProvisioningOperationDto provisioningOperation, IcConnectorObject existsConnectorObject, SysSystemDto system, String systemEntityUid, IcConnectorObject updateConnectorObject, Map<ProvisioningAttributeDto, Object> fullAccountObject, List<SysSchemaAttributeDto> schemaAttributes, ConnectorType connectorType) {
    Optional<SysSchemaAttributeDto> schemaAttributeOptional = // 
    schemaAttributes.stream().filter(schemaAttribute -> {
        // 
        return provisioningAttribute.getSchemaAttributeName().equals(schemaAttribute.getName());
    }).findFirst();
    if (!schemaAttributeOptional.isPresent()) {
        throw new ProvisioningException(AccResultCode.PROVISIONING_SCHEMA_ATTRIBUTE_IS_FOUND, ImmutableMap.of("attribute", provisioningAttribute.getSchemaAttributeName()));
    }
    SysSchemaAttributeDto schemaAttribute = schemaAttributeOptional.get();
    if (schemaAttribute.isUpdateable()) {
        Object idmValue = fullAccountObject.get(provisioningAttribute);
        if (AttributeMappingStrategyType.CREATE == provisioningAttribute.getStrategyType()) {
            return;
        }
        if (provisioningAttribute.isSendOnlyIfNotNull()) {
            if (this.isValueEmpty(idmValue)) {
                return;
            }
        }
        if (schemaAttribute.isReturnedByDefault()) {
            if (AttributeMappingStrategyType.WRITE_IF_NULL == provisioningAttribute.getStrategyType()) {
                boolean existSetAttribute = // 
                fullAccountObject.keySet().stream().anyMatch(provisioningAttributeKey -> {
                    // 
                    return provisioningAttributeKey.getSchemaAttributeName().equals(schemaAttribute.getName()) && AttributeMappingStrategyType.SET == provisioningAttributeKey.getStrategyType();
                });
                boolean existMergeAttribute = // 
                fullAccountObject.keySet().stream().anyMatch(provisioningAttributeKey -> {
                    // 
                    return provisioningAttributeKey.getSchemaAttributeName().equals(schemaAttribute.getName()) && AttributeMappingStrategyType.MERGE == provisioningAttributeKey.getStrategyType();
                });
                boolean existAuthMergeAttribute = // 
                fullAccountObject.keySet().stream().anyMatch(provisioningAttributeKey -> {
                    // 
                    return provisioningAttributeKey.getSchemaAttributeName().equals(schemaAttribute.getName()) && AttributeMappingStrategyType.AUTHORITATIVE_MERGE == provisioningAttributeKey.getStrategyType();
                });
                if (AttributeMappingStrategyType.WRITE_IF_NULL == provisioningAttribute.getStrategyType()) {
                    List<IcAttribute> icAttributes = existsConnectorObject.getAttributes();
                    // 
                    Optional<IcAttribute> icAttributeOptional = icAttributes.stream().filter(ica -> {
                        return schemaAttribute.getName().equals(ica.getName());
                    }).findFirst();
                    IcAttribute icAttribute = null;
                    if (icAttributeOptional.isPresent()) {
                        icAttribute = icAttributeOptional.get();
                    }
                    // We need do transform from resource first
                    Object transformedConnectorValue = this.transformValueFromResource(provisioningAttribute.getTransformValueFromResourceScript(), schemaAttribute, icAttribute, icAttributes, system);
                    if (transformedConnectorValue != null || existSetAttribute || existAuthMergeAttribute || existMergeAttribute) {
                        return;
                    }
                }
            }
            Object resultValue = idmValue;
            if (AttributeMappingStrategyType.MERGE == provisioningAttribute.getStrategyType()) {
                List<Object> allConnectorValues = this.getAllConnectorValues(provisioningAttribute, existsConnectorObject);
                resultValue = resolveMergeValues(provisioningAttribute, idmValue, allConnectorValues, provisioningOperation);
            }
            // Update attribute on resource by given mapping
            // attribute and mapped value in entity
            IcAttribute updatedAttribute = updateAttribute(systemEntityUid, resultValue, schemaAttribute, existsConnectorObject, system, provisioningAttribute);
            // Add updated attribute to updateConnectorObject.
            connectorType.addUpdatedAttribute(schemaAttribute, updatedAttribute, updateConnectorObject, existsConnectorObject);
        } else {
            // filled values only
            if (fullAccountObject.get(provisioningAttribute) != null) {
                IcAttribute createdAttribute = createAttribute(schemaAttribute, fullAccountObject.get(provisioningAttribute));
                if (createdAttribute != null) {
                    updateConnectorObject.getAttributes().add(createdAttribute);
                }
            }
        }
    }
}
Also used : IdmPasswordPolicyDto(eu.bcvsolutions.idm.core.api.dto.IdmPasswordPolicyDto) DtoUtils(eu.bcvsolutions.idm.core.api.utils.DtoUtils) SysSchemaAttributeDto(eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto) Enabled(eu.bcvsolutions.idm.core.security.api.domain.Enabled) Autowired(org.springframework.beans.factory.annotation.Autowired) SysSystemEntityDto(eu.bcvsolutions.idm.acc.dto.SysSystemEntityDto) ProvisioningException(eu.bcvsolutions.idm.acc.exception.ProvisioningException) SysSystemAttributeMapping_(eu.bcvsolutions.idm.acc.entity.SysSystemAttributeMapping_) ConfidentialString(eu.bcvsolutions.idm.core.security.api.domain.ConfidentialString) SysSchemaAttribute(eu.bcvsolutions.idm.acc.entity.SysSchemaAttribute) ResultCodeException(eu.bcvsolutions.idm.core.api.exception.ResultCodeException) Map(java.util.Map) ProvisioningConfiguration(eu.bcvsolutions.idm.acc.config.domain.ProvisioningConfiguration) SysProvisioningAttributeService(eu.bcvsolutions.idm.acc.service.api.SysProvisioningAttributeService) AbstractEntityEventProcessor(eu.bcvsolutions.idm.core.api.event.AbstractEntityEventProcessor) ImmutableMap(com.google.common.collect.ImmutableMap) SysSchemaAttributeFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSchemaAttributeFilter) UniformPasswordManager(eu.bcvsolutions.idm.acc.service.api.UniformPasswordManager) SysProvisioningOperationService(eu.bcvsolutions.idm.acc.service.api.SysProvisioningOperationService) Collection(java.util.Collection) SystemOperationType(eu.bcvsolutions.idm.acc.domain.SystemOperationType) ProvisioningAttributeDto(eu.bcvsolutions.idm.acc.dto.ProvisioningAttributeDto) Set(java.util.Set) SysSchemaObjectClassDto(eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) Serializable(java.io.Serializable) List(java.util.List) ConnectorManager(eu.bcvsolutions.idm.acc.service.api.ConnectorManager) IcConnectorObject(eu.bcvsolutions.idm.ic.api.IcConnectorObject) CollectionUtils(org.springframework.util.CollectionUtils) Entry(java.util.Map.Entry) Optional(java.util.Optional) SysSchemaObjectClassService(eu.bcvsolutions.idm.acc.service.api.SysSchemaObjectClassService) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) AccResultCode(eu.bcvsolutions.idm.acc.domain.AccResultCode) IcConnectorFacade(eu.bcvsolutions.idm.ic.service.api.IcConnectorFacade) AttributeMappingStrategyType(eu.bcvsolutions.idm.acc.domain.AttributeMappingStrategyType) ProvisioningEventType(eu.bcvsolutions.idm.acc.domain.ProvisioningEventType) SysSystemEntityService(eu.bcvsolutions.idm.acc.service.api.SysSystemEntityService) ConnectorType(eu.bcvsolutions.idm.acc.service.api.ConnectorType) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) MessageFormat(java.text.MessageFormat) Strings(com.google.common.base.Strings) SysSystemMappingService(eu.bcvsolutions.idm.acc.service.api.SysSystemMappingService) AbstractDto(eu.bcvsolutions.idm.core.api.dto.AbstractDto) ConfidentialStorage(eu.bcvsolutions.idm.core.api.service.ConfidentialStorage) Lists(com.google.common.collect.Lists) LookupService(eu.bcvsolutions.idm.core.api.service.LookupService) SystemEntityType(eu.bcvsolutions.idm.acc.domain.SystemEntityType) IcConnectorObjectImpl(eu.bcvsolutions.idm.ic.impl.IcConnectorObjectImpl) IcObjectClass(eu.bcvsolutions.idm.ic.api.IcObjectClass) DefaultEventResult(eu.bcvsolutions.idm.core.api.event.DefaultEventResult) EventResult(eu.bcvsolutions.idm.core.api.event.EventResult) EntityEvent(eu.bcvsolutions.idm.core.api.event.EntityEvent) SysProvisioningOperationDto(eu.bcvsolutions.idm.acc.dto.SysProvisioningOperationDto) ProvisioningContext(eu.bcvsolutions.idm.acc.domain.ProvisioningContext) AccModuleDescriptor(eu.bcvsolutions.idm.acc.AccModuleDescriptor) Description(org.springframework.context.annotation.Description) SysProvisioningArchiveService(eu.bcvsolutions.idm.acc.service.api.SysProvisioningArchiveService) IdmPasswordPolicyType(eu.bcvsolutions.idm.core.api.domain.IdmPasswordPolicyType) SysSystemService(eu.bcvsolutions.idm.acc.service.api.SysSystemService) IcAttribute(eu.bcvsolutions.idm.ic.api.IcAttribute) SysSchemaAttributeService(eu.bcvsolutions.idm.acc.service.api.SysSchemaAttributeService) Component(org.springframework.stereotype.Component) SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) ProvisioningService(eu.bcvsolutions.idm.acc.service.api.ProvisioningService) BaseDto(eu.bcvsolutions.idm.core.api.dto.BaseDto) SysSystemAttributeMappingService(eu.bcvsolutions.idm.acc.service.api.SysSystemAttributeMappingService) IdmPasswordPolicyService(eu.bcvsolutions.idm.core.api.service.IdmPasswordPolicyService) Assert(org.springframework.util.Assert) IcAttribute(eu.bcvsolutions.idm.ic.api.IcAttribute) SysSchemaAttributeDto(eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto) ProvisioningException(eu.bcvsolutions.idm.acc.exception.ProvisioningException) IcConnectorObject(eu.bcvsolutions.idm.ic.api.IcConnectorObject)

Example 54 with IcConnectorObject

use of eu.bcvsolutions.idm.ic.api.IcConnectorObject in project CzechIdMng by bcvsolutions.

the class PrepareConnectorObjectProcessor method updateAttribute.

/**
 * Update attribute on resource by given handling attribute and mapped value in
 * entity.
 */
private IcAttribute updateAttribute(String uid, Object idmValue, SysSchemaAttributeDto schemaAttribute, IcConnectorObject existsConnectorObject, SysSystemDto system, ProvisioningAttributeDto provisioningAttributeDto) {
    List<IcAttribute> icAttributes = existsConnectorObject.getAttributes();
    // 
    Optional<IcAttribute> icAttributeOptional = icAttributes.stream().filter(ica -> {
        return schemaAttribute.getName().equals(ica.getName());
    }).findFirst();
    IcAttribute icAttribute = null;
    if (icAttributeOptional.isPresent()) {
        icAttribute = icAttributeOptional.get();
    }
    return updateAttributeValue(uid, idmValue, schemaAttribute, icAttribute, icAttributes, system, provisioningAttributeDto.getTransformValueFromResourceScript(), provisioningAttributeDto.isSendAlways());
}
Also used : IdmPasswordPolicyDto(eu.bcvsolutions.idm.core.api.dto.IdmPasswordPolicyDto) DtoUtils(eu.bcvsolutions.idm.core.api.utils.DtoUtils) SysSchemaAttributeDto(eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto) Enabled(eu.bcvsolutions.idm.core.security.api.domain.Enabled) Autowired(org.springframework.beans.factory.annotation.Autowired) SysSystemEntityDto(eu.bcvsolutions.idm.acc.dto.SysSystemEntityDto) ProvisioningException(eu.bcvsolutions.idm.acc.exception.ProvisioningException) SysSystemAttributeMapping_(eu.bcvsolutions.idm.acc.entity.SysSystemAttributeMapping_) ConfidentialString(eu.bcvsolutions.idm.core.security.api.domain.ConfidentialString) SysSchemaAttribute(eu.bcvsolutions.idm.acc.entity.SysSchemaAttribute) ResultCodeException(eu.bcvsolutions.idm.core.api.exception.ResultCodeException) Map(java.util.Map) ProvisioningConfiguration(eu.bcvsolutions.idm.acc.config.domain.ProvisioningConfiguration) SysProvisioningAttributeService(eu.bcvsolutions.idm.acc.service.api.SysProvisioningAttributeService) AbstractEntityEventProcessor(eu.bcvsolutions.idm.core.api.event.AbstractEntityEventProcessor) ImmutableMap(com.google.common.collect.ImmutableMap) SysSchemaAttributeFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSchemaAttributeFilter) UniformPasswordManager(eu.bcvsolutions.idm.acc.service.api.UniformPasswordManager) SysProvisioningOperationService(eu.bcvsolutions.idm.acc.service.api.SysProvisioningOperationService) Collection(java.util.Collection) SystemOperationType(eu.bcvsolutions.idm.acc.domain.SystemOperationType) ProvisioningAttributeDto(eu.bcvsolutions.idm.acc.dto.ProvisioningAttributeDto) Set(java.util.Set) SysSchemaObjectClassDto(eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) Serializable(java.io.Serializable) List(java.util.List) ConnectorManager(eu.bcvsolutions.idm.acc.service.api.ConnectorManager) IcConnectorObject(eu.bcvsolutions.idm.ic.api.IcConnectorObject) CollectionUtils(org.springframework.util.CollectionUtils) Entry(java.util.Map.Entry) Optional(java.util.Optional) SysSchemaObjectClassService(eu.bcvsolutions.idm.acc.service.api.SysSchemaObjectClassService) GuardedString(eu.bcvsolutions.idm.core.security.api.domain.GuardedString) AccResultCode(eu.bcvsolutions.idm.acc.domain.AccResultCode) IcConnectorFacade(eu.bcvsolutions.idm.ic.service.api.IcConnectorFacade) AttributeMappingStrategyType(eu.bcvsolutions.idm.acc.domain.AttributeMappingStrategyType) ProvisioningEventType(eu.bcvsolutions.idm.acc.domain.ProvisioningEventType) SysSystemEntityService(eu.bcvsolutions.idm.acc.service.api.SysSystemEntityService) ConnectorType(eu.bcvsolutions.idm.acc.service.api.ConnectorType) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) MessageFormat(java.text.MessageFormat) Strings(com.google.common.base.Strings) SysSystemMappingService(eu.bcvsolutions.idm.acc.service.api.SysSystemMappingService) AbstractDto(eu.bcvsolutions.idm.core.api.dto.AbstractDto) ConfidentialStorage(eu.bcvsolutions.idm.core.api.service.ConfidentialStorage) Lists(com.google.common.collect.Lists) LookupService(eu.bcvsolutions.idm.core.api.service.LookupService) SystemEntityType(eu.bcvsolutions.idm.acc.domain.SystemEntityType) IcConnectorObjectImpl(eu.bcvsolutions.idm.ic.impl.IcConnectorObjectImpl) IcObjectClass(eu.bcvsolutions.idm.ic.api.IcObjectClass) DefaultEventResult(eu.bcvsolutions.idm.core.api.event.DefaultEventResult) EventResult(eu.bcvsolutions.idm.core.api.event.EventResult) EntityEvent(eu.bcvsolutions.idm.core.api.event.EntityEvent) SysProvisioningOperationDto(eu.bcvsolutions.idm.acc.dto.SysProvisioningOperationDto) ProvisioningContext(eu.bcvsolutions.idm.acc.domain.ProvisioningContext) AccModuleDescriptor(eu.bcvsolutions.idm.acc.AccModuleDescriptor) Description(org.springframework.context.annotation.Description) SysProvisioningArchiveService(eu.bcvsolutions.idm.acc.service.api.SysProvisioningArchiveService) IdmPasswordPolicyType(eu.bcvsolutions.idm.core.api.domain.IdmPasswordPolicyType) SysSystemService(eu.bcvsolutions.idm.acc.service.api.SysSystemService) IcAttribute(eu.bcvsolutions.idm.ic.api.IcAttribute) SysSchemaAttributeService(eu.bcvsolutions.idm.acc.service.api.SysSchemaAttributeService) Component(org.springframework.stereotype.Component) SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) ProvisioningService(eu.bcvsolutions.idm.acc.service.api.ProvisioningService) BaseDto(eu.bcvsolutions.idm.core.api.dto.BaseDto) SysSystemAttributeMappingService(eu.bcvsolutions.idm.acc.service.api.SysSystemAttributeMappingService) IdmPasswordPolicyService(eu.bcvsolutions.idm.core.api.service.IdmPasswordPolicyService) Assert(org.springframework.util.Assert) IcAttribute(eu.bcvsolutions.idm.ic.api.IcAttribute)

Example 55 with IcConnectorObject

use of eu.bcvsolutions.idm.ic.api.IcConnectorObject in project CzechIdMng by bcvsolutions.

the class PrepareConnectorObjectProcessor method getAllConnectorValues.

private List<Object> getAllConnectorValues(ProvisioningAttributeDto provisioningAttribute, IcConnectorObject existsConnectorObject) {
    if (existsConnectorObject == null) {
        return Lists.newArrayList();
    }
    IcAttribute attribute = existsConnectorObject.getAttributeByName(provisioningAttribute.getSchemaAttributeName());
    Object connectorValue = attribute != null ? (attribute.isMultiValue() ? attribute.getValues() : attribute.getValue()) : null;
    if (connectorValue != null && !(connectorValue instanceof List)) {
        connectorValue = Lists.newArrayList(connectorValue);
    }
    List<Object> connectorValues = Lists.newArrayList();
    if (connectorValue != null) {
        connectorValues.addAll((List<?>) connectorValue);
    }
    return connectorValues;
}
Also used : IcAttribute(eu.bcvsolutions.idm.ic.api.IcAttribute) IcConnectorObject(eu.bcvsolutions.idm.ic.api.IcConnectorObject) List(java.util.List)

Aggregations

IcConnectorObject (eu.bcvsolutions.idm.ic.api.IcConnectorObject)79 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)45 IcAttribute (eu.bcvsolutions.idm.ic.api.IcAttribute)36 IcObjectClass (eu.bcvsolutions.idm.ic.api.IcObjectClass)30 SysProvisioningOperationDto (eu.bcvsolutions.idm.acc.dto.SysProvisioningOperationDto)28 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)28 Test (org.junit.Test)28 IcConnectorObjectImpl (eu.bcvsolutions.idm.ic.impl.IcConnectorObjectImpl)27 IcObjectClassImpl (eu.bcvsolutions.idm.ic.impl.IcObjectClassImpl)26 GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)23 ProvisioningAttributeDto (eu.bcvsolutions.idm.acc.dto.ProvisioningAttributeDto)20 SysSystemAttributeMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto)19 SysSystemMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto)19 ProvisioningContext (eu.bcvsolutions.idm.acc.domain.ProvisioningContext)18 SysSchemaAttributeDto (eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto)17 SysSystemEntityDto (eu.bcvsolutions.idm.acc.dto.SysSystemEntityDto)17 IcAttributeImpl (eu.bcvsolutions.idm.ic.impl.IcAttributeImpl)17 SysSchemaObjectClassDto (eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto)15 ResultCodeException (eu.bcvsolutions.idm.core.api.exception.ResultCodeException)14 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)13