Search in sources :

Example 31 with SysProvisioningOperationFilter

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

the class DefaultSysProvisioningOperationService method findByBatchId.

@Override
@Transactional(readOnly = true)
public Page<SysProvisioningOperationDto> findByBatchId(UUID batchId, Pageable pageable) {
    SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
    filter.setBatchId(batchId);
    return this.find(filter, pageable);
}
Also used : SysProvisioningOperationFilter(eu.bcvsolutions.idm.acc.dto.filter.SysProvisioningOperationFilter) Transactional(org.springframework.transaction.annotation.Transactional)

Example 32 with SysProvisioningOperationFilter

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

the class DefaultSysSystemEntityService method delete.

@Override
@Transactional
public void delete(SysSystemEntityDto systemEntityDto, BasePermission... permission) {
    Assert.notNull(systemEntityDto);
    // 
    SysProvisioningOperationFilter filter = new SysProvisioningOperationFilter();
    filter.setSystemId(systemEntityDto.getSystem());
    filter.setEntityType(systemEntityDto.getEntityType());
    filter.setSystemEntity(systemEntityDto.getId());
    if (provisioningOperationRepository.find(filter, null).getTotalElements() > 0) {
        SysSystemDto system = DtoUtils.getEmbedded(systemEntityDto, SysSystemEntity_.system, SysSystemDto.class);
        throw new ResultCodeException(AccResultCode.SYSTEM_ENTITY_DELETE_FAILED_HAS_OPERATIONS, ImmutableMap.of("uid", systemEntityDto.getUid(), "system", system.getName()));
    }
    // 
    // clear accounts - only link, can be rebuild
    accountRepository.clearSystemEntity(systemEntityDto.getId());
    // 
    super.delete(systemEntityDto, permission);
}
Also used : SysProvisioningOperationFilter(eu.bcvsolutions.idm.acc.dto.filter.SysProvisioningOperationFilter) ResultCodeException(eu.bcvsolutions.idm.core.api.exception.ResultCodeException) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

SysProvisioningOperationFilter (eu.bcvsolutions.idm.acc.dto.filter.SysProvisioningOperationFilter)32 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)27 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)27 Test (org.junit.Test)27 SysProvisioningArchiveDto (eu.bcvsolutions.idm.acc.dto.SysProvisioningArchiveDto)15 SysProvisioningOperationDto (eu.bcvsolutions.idm.acc.dto.SysProvisioningOperationDto)15 IdmBasePermission (eu.bcvsolutions.idm.core.security.api.domain.IdmBasePermission)14 SystemEntityType (eu.bcvsolutions.idm.acc.domain.SystemEntityType)13 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)8 ProvisioningAttributeDto (eu.bcvsolutions.idm.acc.dto.ProvisioningAttributeDto)7 IdmIdentityContractDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityContractDto)6 GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)6 IcConnectorObject (eu.bcvsolutions.idm.ic.api.IcConnectorObject)6 SysProvisioningBatchDto (eu.bcvsolutions.idm.acc.dto.SysProvisioningBatchDto)4 SysSystemEntityDto (eu.bcvsolutions.idm.acc.dto.SysSystemEntityDto)4 IdmContractGuaranteeDto (eu.bcvsolutions.idm.core.api.dto.IdmContractGuaranteeDto)4 OperationResult (eu.bcvsolutions.idm.core.api.entity.OperationResult)3 ProvisioningContext (eu.bcvsolutions.idm.acc.domain.ProvisioningContext)2 SysRoleSystemDto (eu.bcvsolutions.idm.acc.dto.SysRoleSystemDto)2 SysSchemaAttributeDto (eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto)2