Search in sources :

Example 6 with AccRoleCatalogueAccountDto

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;
}
Also used : AccRoleCatalogueAccountDto(eu.bcvsolutions.idm.acc.dto.AccRoleCatalogueAccountDto) AccRoleCatalogueAccountFilter(eu.bcvsolutions.idm.acc.dto.filter.AccRoleCatalogueAccountFilter)

Aggregations

AccRoleCatalogueAccountDto (eu.bcvsolutions.idm.acc.dto.AccRoleCatalogueAccountDto)6 AccRoleCatalogueAccountFilter (eu.bcvsolutions.idm.acc.dto.filter.AccRoleCatalogueAccountFilter)6 UUID (java.util.UUID)5 ProvisioningException (eu.bcvsolutions.idm.acc.exception.ProvisioningException)3 AccAccountDto (eu.bcvsolutions.idm.acc.dto.AccAccountDto)2 SystemEntityType (eu.bcvsolutions.idm.acc.domain.SystemEntityType)1 AccContractAccountDto (eu.bcvsolutions.idm.acc.dto.AccContractAccountDto)1 AccIdentityAccountDto (eu.bcvsolutions.idm.acc.dto.AccIdentityAccountDto)1 AccRoleAccountDto (eu.bcvsolutions.idm.acc.dto.AccRoleAccountDto)1 AccTreeAccountDto (eu.bcvsolutions.idm.acc.dto.AccTreeAccountDto)1 SysSchemaObjectClassDto (eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto)1 SysSystemMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto)1 AccAccountFilter (eu.bcvsolutions.idm.acc.dto.filter.AccAccountFilter)1 AccContractAccountFilter (eu.bcvsolutions.idm.acc.dto.filter.AccContractAccountFilter)1 AccContractSliceAccountFilter (eu.bcvsolutions.idm.acc.dto.filter.AccContractSliceAccountFilter)1 AccIdentityAccountFilter (eu.bcvsolutions.idm.acc.dto.filter.AccIdentityAccountFilter)1 AccRoleAccountFilter (eu.bcvsolutions.idm.acc.dto.filter.AccRoleAccountFilter)1 AccTreeAccountFilter (eu.bcvsolutions.idm.acc.dto.filter.AccTreeAccountFilter)1 AccountEvent (eu.bcvsolutions.idm.acc.event.AccountEvent)1 IdmRoleCatalogueDto (eu.bcvsolutions.idm.core.api.dto.IdmRoleCatalogueDto)1