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;
}
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;
}
}
Aggregations