use of eu.bcvsolutions.idm.acc.dto.AccRoleCatalogueAccountDto in project CzechIdMng by bcvsolutions.
the class RoleCatalogueSynchronizationExecutor method doUnlink.
/**
* Operation remove EntityAccount relations and linked roles
*
* @param account
* @param removeIdentityRole
* @param log
* @param logItem
* @param actionLogs
*/
@Override
protected void doUnlink(AccAccountDto account, boolean removeIdentityRole, SysSyncLogDto log, SysSyncItemLogDto logItem, List<SysSyncActionLogDto> actionLogs) {
AccRoleCatalogueAccountFilter catalogueAccountFilter = new AccRoleCatalogueAccountFilter();
catalogueAccountFilter.setAccountId(account.getId());
List<AccRoleCatalogueAccountDto> catalogueAccounts = catalogueAccountService.find(catalogueAccountFilter, null).getContent();
if (catalogueAccounts.isEmpty()) {
addToItemLog(logItem, "Warning! - catalogue account relation was not found!");
initSyncActionLog(SynchronizationActionType.UPDATE_ENTITY, OperationResultType.WARNING, logItem, log, actionLogs);
return;
}
addToItemLog(logItem, MessageFormat.format("Catalogue-account relations to delete {0}", catalogueAccounts));
catalogueAccounts.stream().forEach(catalogueAccount -> {
// We will remove catalogue account, but without delete connected
// account
catalogueAccountService.delete(catalogueAccount, false);
addToItemLog(logItem, MessageFormat.format("Catalogue-account relation deleted (without call delete provisioning) (roleCatalogue: {0}, id: {1})", catalogueAccount.getRoleCatalogue(), catalogueAccount.getId()));
});
return;
}
Aggregations