Search in sources :

Example 61 with SysSyncLogDto

use of eu.bcvsolutions.idm.acc.dto.SysSyncLogDto in project CzechIdMng by bcvsolutions.

the class DefaultSysSyncLogService method get.

@Override
public SysSyncLogDto get(Serializable id, BasePermission... permission) {
    SysSyncLogDto dto = super.get(id, permission);
    // fill action list
    dto.setSyncActionLogs(getActionsForLog(dto.getId()));
    return dto;
}
Also used : SysSyncLogDto(eu.bcvsolutions.idm.acc.dto.SysSyncLogDto)

Example 62 with SysSyncLogDto

use of eu.bcvsolutions.idm.acc.dto.SysSyncLogDto in project CzechIdMng by bcvsolutions.

the class IdentitySynchronizationExecutor method doUpdateEntity.

/**
 * Fill data from IC attributes to entity (EAV and confidential storage too)
 *
 * @param account
 * @param entityType
 * @param uid
 * @param icAttributes
 * @param mappedAttributes
 * @param log
 * @param logItem
 * @param actionLogs
 */
protected void doUpdateEntity(SynchronizationContext context) {
    String uid = context.getUid();
    SysSyncLogDto log = context.getLog();
    SysSyncItemLogDto logItem = context.getLogItem();
    List<SysSyncActionLogDto> actionLogs = context.getActionLogs();
    List<SysSystemAttributeMappingDto> mappedAttributes = context.getMappedAttributes();
    AccAccountDto account = context.getAccount();
    List<IcAttribute> icAttributes = context.getIcObject().getAttributes();
    SystemEntityType entityType = context.getEntityType();
    UUID entityId = getEntityByAccount(account.getId());
    IdmIdentityDto identity = null;
    if (entityId != null) {
        identity = identityService.get(entityId);
    }
    if (identity != null) {
        // Update identity
        identity = fillEntity(mappedAttributes, uid, icAttributes, identity, false, context);
        identity = this.save(identity, true);
        // Update extended attribute (entity must be persisted first)
        updateExtendedAttributes(mappedAttributes, uid, icAttributes, identity, false, context);
        // Update confidential attribute (entity must be persisted
        // first)
        updateConfidentialAttributes(mappedAttributes, uid, icAttributes, identity, false, context);
        // Identity Updated
        addToItemLog(logItem, MessageFormat.format("Identity with id {0} was updated", identity.getId()));
        if (logItem != null) {
            logItem.setDisplayName(identity.getUsername());
        }
        // Call provisioning for entity
        this.callProvisioningForEntity(identity, entityType, logItem);
        return;
    } else {
        addToItemLog(logItem, "Identity account relation (with ownership = true) was not found!");
        initSyncActionLog(SynchronizationActionType.UPDATE_ENTITY, OperationResultType.WARNING, logItem, log, actionLogs);
        return;
    }
}
Also used : SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) SystemEntityType(eu.bcvsolutions.idm.acc.domain.SystemEntityType) AccAccountDto(eu.bcvsolutions.idm.acc.dto.AccAccountDto) SysSyncActionLogDto(eu.bcvsolutions.idm.acc.dto.SysSyncActionLogDto) IcAttribute(eu.bcvsolutions.idm.ic.api.IcAttribute) SysSyncItemLogDto(eu.bcvsolutions.idm.acc.dto.SysSyncItemLogDto) UUID(java.util.UUID) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) SysSyncLogDto(eu.bcvsolutions.idm.acc.dto.SysSyncLogDto)

Aggregations

SysSyncLogDto (eu.bcvsolutions.idm.acc.dto.SysSyncLogDto)62 AbstractSysSyncConfigDto (eu.bcvsolutions.idm.acc.dto.AbstractSysSyncConfigDto)43 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)42 Test (org.junit.Test)42 SysSyncActionLogDto (eu.bcvsolutions.idm.acc.dto.SysSyncActionLogDto)41 SysSyncItemLogDto (eu.bcvsolutions.idm.acc.dto.SysSyncItemLogDto)38 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)31 SysSyncActionLogFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSyncActionLogFilter)27 SysSyncLogFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSyncLogFilter)27 SysSyncItemLogFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSyncItemLogFilter)25 SysSyncConfigFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSyncConfigFilter)22 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)21 SystemEntityType (eu.bcvsolutions.idm.acc.domain.SystemEntityType)14 AccAccountDto (eu.bcvsolutions.idm.acc.dto.AccAccountDto)12 SysSystemAttributeMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto)12 IdmIdentityContractDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto)12 SysSystemMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto)10 SysSyncIdentityConfigDto (eu.bcvsolutions.idm.acc.dto.SysSyncIdentityConfigDto)9 IdmRoleDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleDto)9 DefaultSynchronizationServiceTest (eu.bcvsolutions.idm.acc.service.impl.DefaultSynchronizationServiceTest)8