use of eu.bcvsolutions.idm.acc.dto.AccContractSliceAccountDto in project CzechIdMng by bcvsolutions.
the class ContractSliceSynchronizationExecutor method doUnlink.
/**
* Operation remove IdentityContractAccount relations and linked roles
*
* @param account
* @param removeIdentityContractIdentityContract
* @param log
* @param logItem
* @param actionLogs
*/
protected void doUnlink(AccAccountDto account, boolean removeIdentityContractIdentityContract, SysSyncLogDto log, SysSyncItemLogDto logItem, List<SysSyncActionLogDto> actionLogs) {
EntityAccountFilter entityAccountFilter = new AccContractSliceAccountFilter();
entityAccountFilter.setAccountId(account.getId());
List<AccContractSliceAccountDto> entityAccounts = contractAccoutnService.find((AccContractSliceAccountFilter) entityAccountFilter, null).getContent();
if (entityAccounts.isEmpty()) {
addToItemLog(logItem, "Warning! - Contract-account relation was not found!");
initSyncActionLog(SynchronizationActionType.UPDATE_ENTITY, OperationResultType.WARNING, logItem, log, actionLogs);
return;
}
addToItemLog(logItem, MessageFormat.format("Contract-account relations to delete {0}", entityAccounts));
entityAccounts.stream().forEach(entityAccount -> {
// We will remove contract account, but without delete connected
// account
contractAccoutnService.delete(entityAccount, false);
addToItemLog(logItem, MessageFormat.format("Contract-account relation deleted (without call delete provisioning) (contract id: {0}, contract-account id: {1})", entityAccount.getSlice(), entityAccount.getId()));
});
return;
}
use of eu.bcvsolutions.idm.acc.dto.AccContractSliceAccountDto in project CzechIdMng by bcvsolutions.
the class ContractSliceAccountSaveProcessor method process.
@Override
public EventResult<AccContractSliceAccountDto> process(EntityEvent<AccContractSliceAccountDto> event) {
AccContractSliceAccountDto entity = event.getContent();
UUID account = entity.getAccount();
Assert.notNull(account, "Account cannot be null!");
event.setContent(service.saveInternal(entity));
return new DefaultEventResult<>(event, this);
}
Aggregations