Search in sources :

Example 26 with SysSyncActionLogFilter

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

the class DefaultSynchronizationServiceTest method doStartSyncE_StrategyCreate.

@Test
public void doStartSyncE_StrategyCreate() {
    SysSyncConfigFilter configFilter = new SysSyncConfigFilter();
    configFilter.setName(SYNC_CONFIG_NAME);
    List<AbstractSysSyncConfigDto> syncConfigs = syncConfigService.find(configFilter, null).getContent();
    Assert.assertEquals(1, syncConfigs.size());
    AbstractSysSyncConfigDto syncConfigCustom = syncConfigs.get(0);
    Assert.assertFalse(syncConfigService.isRunning(syncConfigCustom));
    // Delete all accounts in resource
    this.getBean().deleteAllResourceData();
    // Create new accounts
    this.getBean().initResourceData();
    // Find email attribute and change startegy on CREATE
    SysSystemMappingFilter mappingFilter = new SysSystemMappingFilter();
    mappingFilter.setEntityType(SystemEntityType.IDENTITY);
    SysSystemMappingDto systemMapping = systemMappingService.get(syncConfigCustom.getSystemMapping());
    SysSystemDto system = systemService.get(schemaObjectClassService.get(systemMapping.getObjectClass()).getSystem());
    mappingFilter.setSystemId(system.getId());
    mappingFilter.setOperationType(SystemOperationType.SYNCHRONIZATION);
    List<SysSystemMappingDto> mappings = systemMappingService.find(mappingFilter, null).getContent();
    Assert.assertEquals(1, mappings.size());
    SysSystemMappingDto mapping = mappings.get(0);
    SysSystemAttributeMappingFilter attributeMappingFilter = new SysSystemAttributeMappingFilter();
    attributeMappingFilter.setSystemMappingId(mapping.getId());
    List<SysSystemAttributeMappingDto> attributes = schemaAttributeMappingService.find(attributeMappingFilter, null).getContent();
    SysSystemAttributeMappingDto emailAttribute = attributes.stream().filter(attribute -> {
        return attribute.getName().equalsIgnoreCase(ATTRIBUTE_EMAIL);
    }).findFirst().get();
    emailAttribute.setStrategyType(AttributeMappingStrategyType.CREATE);
    schemaAttributeMappingService.save(emailAttribute);
    // 
    // Set sync config
    syncConfigCustom.setLinkedAction(SynchronizationLinkedActionType.UPDATE_ENTITY);
    syncConfigCustom.setUnlinkedAction(SynchronizationUnlinkedActionType.IGNORE);
    syncConfigCustom.setMissingEntityAction(SynchronizationMissingEntityActionType.CREATE_ENTITY);
    syncConfigCustom.setMissingAccountAction(ReconciliationMissingAccountActionType.IGNORE);
    syncConfigCustom.setReconciliation(true);
    syncConfigService.save(syncConfigCustom);
    // Check state before sync
    Assert.assertNull(identityService.getByUsername("x" + IDENTITY_USERNAME_ONE));
    Assert.assertNull(identityService.getByUsername("x" + IDENTITY_USERNAME_TWO));
    // Start synchronization
    synchornizationService.setSynchronizationConfigId(syncConfigCustom.getId());
    synchornizationService.process();
    // 
    SysSyncLogFilter logFilter = new SysSyncLogFilter();
    logFilter.setSynchronizationConfigId(syncConfigCustom.getId());
    List<SysSyncLogDto> logs = syncLogService.find(logFilter, null).getContent();
    Assert.assertEquals(1, logs.size());
    SysSyncLogDto log = logs.get(0);
    Assert.assertFalse(log.isRunning());
    Assert.assertFalse(log.isContainsError());
    SysSyncActionLogFilter actionLogFilter = new SysSyncActionLogFilter();
    actionLogFilter.setSynchronizationLogId(log.getId());
    List<SysSyncActionLogDto> actions = syncActionLogService.find(actionLogFilter, null).getContent();
    Assert.assertEquals(1, actions.size());
    SysSyncActionLogDto actionLog = actions.stream().filter(action -> {
        return SynchronizationActionType.CREATE_ENTITY == action.getSyncAction();
    }).findFirst().get();
    SysSyncItemLogFilter itemLogFilter = new SysSyncItemLogFilter();
    itemLogFilter.setSyncActionLogId(actionLog.getId());
    List<SysSyncItemLogDto> items = syncItemLogService.find(itemLogFilter, null).getContent();
    Assert.assertEquals(2, items.size());
    // Check state after sync
    Assert.assertEquals(IDENTITY_USERNAME_ONE, identityService.getByUsername("x" + IDENTITY_USERNAME_ONE).getFirstName());
    Assert.assertEquals(IDENTITY_USERNAME_TWO, identityService.getByUsername("x" + IDENTITY_USERNAME_TWO).getLastName());
    Assert.assertEquals(IDENTITY_EMAIL_CORRECT, identityService.getByUsername("x" + IDENTITY_USERNAME_ONE).getEmail());
    Assert.assertEquals(IDENTITY_EMAIL_CORRECT, identityService.getByUsername("x" + IDENTITY_USERNAME_TWO).getEmail());
    // Delete log
    syncLogService.delete(log);
    // Change data
    this.getBean().changeResourceData();
    // Start synchronization aging
    synchornizationService.setSynchronizationConfigId(syncConfigCustom.getId());
    synchornizationService.process();
    // 
    logFilter = new SysSyncLogFilter();
    logFilter.setSynchronizationConfigId(syncConfigCustom.getId());
    logs = syncLogService.find(logFilter, null).getContent();
    Assert.assertEquals(1, logs.size());
    log = logs.get(0);
    Assert.assertFalse(log.isRunning());
    Assert.assertFalse(log.isContainsError());
    actionLogFilter = new SysSyncActionLogFilter();
    actionLogFilter.setSynchronizationLogId(log.getId());
    actions = syncActionLogService.find(actionLogFilter, null).getContent();
    Assert.assertEquals(1, actions.size());
    actionLog = actions.stream().filter(action -> {
        return SynchronizationActionType.UPDATE_ENTITY == action.getSyncAction();
    }).findFirst().get();
    itemLogFilter = new SysSyncItemLogFilter();
    itemLogFilter.setSyncActionLogId(actionLog.getId());
    items = syncItemLogService.find(itemLogFilter, null).getContent();
    Assert.assertEquals(2, items.size());
    // Check state after sync
    Assert.assertEquals(ATTRIBUTE_VALUE_CHANGED, identityService.getByUsername("x" + IDENTITY_USERNAME_ONE).getFirstName());
    Assert.assertEquals(ATTRIBUTE_VALUE_CHANGED, identityService.getByUsername("x" + IDENTITY_USERNAME_TWO).getLastName());
    Assert.assertEquals(IDENTITY_EMAIL_CORRECT, identityService.getByUsername("x" + IDENTITY_USERNAME_ONE).getEmail());
    Assert.assertEquals(IDENTITY_EMAIL_CORRECT, identityService.getByUsername("x" + IDENTITY_USERNAME_TWO).getEmail());
    // Delete log
    syncLogService.delete(log);
}
Also used : MethodSorters(org.junit.runners.MethodSorters) OperationResultType(eu.bcvsolutions.idm.acc.domain.OperationResultType) SysSchemaAttributeDto(eu.bcvsolutions.idm.acc.dto.SysSchemaAttributeDto) SysSyncConfigFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncConfigFilter) IdmFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto) Autowired(org.springframework.beans.factory.annotation.Autowired) FormService(eu.bcvsolutions.idm.core.eav.api.service.FormService) AccAccountDto(eu.bcvsolutions.idm.acc.dto.AccAccountDto) After(org.junit.After) SynchronizationMissingEntityActionType(eu.bcvsolutions.idm.acc.domain.SynchronizationMissingEntityActionType) SysSyncConfigService(eu.bcvsolutions.idm.acc.service.api.SysSyncConfigService) SynchronizationUnlinkedActionType(eu.bcvsolutions.idm.acc.domain.SynchronizationUnlinkedActionType) SysSyncLogService(eu.bcvsolutions.idm.acc.service.api.SysSyncLogService) AbstractSysSyncConfigDto(eu.bcvsolutions.idm.acc.dto.AbstractSysSyncConfigDto) AccIdentityAccountDto(eu.bcvsolutions.idm.acc.dto.AccIdentityAccountDto) IdmIdentity(eu.bcvsolutions.idm.core.model.entity.IdmIdentity) SysSchemaAttributeFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSchemaAttributeFilter) SystemOperationType(eu.bcvsolutions.idm.acc.domain.SystemOperationType) SysSchemaObjectClassDto(eu.bcvsolutions.idm.acc.dto.SysSchemaObjectClassDto) Page(org.springframework.data.domain.Page) ReconciliationMissingAccountActionType(eu.bcvsolutions.idm.acc.domain.ReconciliationMissingAccountActionType) Serializable(java.io.Serializable) SysSyncIdentityConfigDto(eu.bcvsolutions.idm.acc.dto.SysSyncIdentityConfigDto) List(java.util.List) Query(javax.persistence.Query) AccAccountService(eu.bcvsolutions.idm.acc.service.api.AccAccountService) AccountType(eu.bcvsolutions.idm.acc.domain.AccountType) AccIdentityAccountService(eu.bcvsolutions.idm.acc.service.api.AccIdentityAccountService) SysSchemaObjectClassService(eu.bcvsolutions.idm.acc.service.api.SysSchemaObjectClassService) IdmIdentityService(eu.bcvsolutions.idm.core.api.service.IdmIdentityService) FixMethodOrder(org.junit.FixMethodOrder) TestResource(eu.bcvsolutions.idm.acc.entity.TestResource) IcConnectorFacade(eu.bcvsolutions.idm.ic.service.api.IcConnectorFacade) AttributeMappingStrategyType(eu.bcvsolutions.idm.acc.domain.AttributeMappingStrategyType) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) ArrayList(java.util.ArrayList) SysSystemMappingService(eu.bcvsolutions.idm.acc.service.api.SysSystemMappingService) ImmutableList(com.google.common.collect.ImmutableList) SynchronizationActionType(eu.bcvsolutions.idm.acc.domain.SynchronizationActionType) SystemEntityType(eu.bcvsolutions.idm.acc.domain.SystemEntityType) Service(org.springframework.stereotype.Service) SynchronizationLinkedActionType(eu.bcvsolutions.idm.acc.domain.SynchronizationLinkedActionType) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Before(org.junit.Before) SysSystemMappingFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemMappingFilter) InitApplicationData(eu.bcvsolutions.idm.InitApplicationData) SysSyncActionLogDto(eu.bcvsolutions.idm.acc.dto.SysSyncActionLogDto) AccIdentityAccountFilter(eu.bcvsolutions.idm.acc.dto.filter.AccIdentityAccountFilter) SysSystemService(eu.bcvsolutions.idm.acc.service.api.SysSystemService) IdmIdentityDto(eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto) Test(org.junit.Test) SysSyncLogDto(eu.bcvsolutions.idm.acc.dto.SysSyncLogDto) EntityManager(javax.persistence.EntityManager) LocalDateTime(org.joda.time.LocalDateTime) ApplicationContext(org.springframework.context.ApplicationContext) SysSyncItemLogFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncItemLogFilter) SysSchemaAttributeService(eu.bcvsolutions.idm.acc.service.api.SysSchemaAttributeService) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) SysSystemAttributeMappingFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemAttributeMappingFilter) SysSyncActionLogFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncActionLogFilter) SynchronizationService(eu.bcvsolutions.idm.acc.service.api.SynchronizationService) SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) IcFilterOperationType(eu.bcvsolutions.idm.ic.domain.IcFilterOperationType) SysSyncLogFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncLogFilter) SysSyncItemLogService(eu.bcvsolutions.idm.acc.service.api.SysSyncItemLogService) TestHelper(eu.bcvsolutions.idm.acc.TestHelper) Assert(org.junit.Assert) SysSyncActionLogService(eu.bcvsolutions.idm.acc.service.api.SysSyncActionLogService) SysSystemAttributeMappingService(eu.bcvsolutions.idm.acc.service.api.SysSystemAttributeMappingService) Rollback(org.springframework.test.annotation.Rollback) Transactional(org.springframework.transaction.annotation.Transactional) SysSyncItemLogDto(eu.bcvsolutions.idm.acc.dto.SysSyncItemLogDto) SysSystemAttributeMappingFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemAttributeMappingFilter) SysSystemAttributeMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto) SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) SysSyncActionLogDto(eu.bcvsolutions.idm.acc.dto.SysSyncActionLogDto) AbstractSysSyncConfigDto(eu.bcvsolutions.idm.acc.dto.AbstractSysSyncConfigDto) SysSystemMappingFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemMappingFilter) SysSyncLogFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncLogFilter) SysSyncItemLogDto(eu.bcvsolutions.idm.acc.dto.SysSyncItemLogDto) SysSyncItemLogFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncItemLogFilter) SysSyncActionLogFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncActionLogFilter) SysSyncConfigFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncConfigFilter) SysSyncLogDto(eu.bcvsolutions.idm.acc.dto.SysSyncLogDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 27 with SysSyncActionLogFilter

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

the class DefaultSynchronizationServiceTest method doStartSyncB_Linked_doEntityUpdate_Filtered.

@Test
public /**
 * We will do synchronize with use inner connector synch function.
 */
void doStartSyncB_Linked_doEntityUpdate_Filtered() {
    SysSyncConfigFilter configFilter = new SysSyncConfigFilter();
    configFilter.setName(SYNC_CONFIG_NAME);
    List<AbstractSysSyncConfigDto> syncConfigs = syncConfigService.find(configFilter, null).getContent();
    this.getBean().changeResourceData();
    Assert.assertEquals(1, syncConfigs.size());
    AbstractSysSyncConfigDto syncConfigCustom = syncConfigs.get(0);
    Assert.assertFalse(syncConfigService.isRunning(syncConfigCustom));
    SysSystemMappingDto systemMapping = systemMappingService.get(syncConfigCustom.getSystemMapping());
    SysSystemDto system = systemService.get(schemaObjectClassService.get(systemMapping.getObjectClass()).getSystem());
    IdmFormDefinitionDto savedFormDefinition = systemService.getConnectorFormDefinition(system.getConnectorInstance());
    IdmFormAttributeDto changeLogColumn = savedFormDefinition.getMappedAttributeByCode("changeLogColumn");
    formService.saveValues(system, changeLogColumn, ImmutableList.of("modified"));
    // Set sync config
    syncConfigCustom.setLinkedAction(SynchronizationLinkedActionType.UPDATE_ENTITY);
    syncConfigCustom.setUnlinkedAction(SynchronizationUnlinkedActionType.IGNORE);
    syncConfigCustom.setMissingEntityAction(SynchronizationMissingEntityActionType.IGNORE);
    syncConfigCustom.setMissingAccountAction(ReconciliationMissingAccountActionType.IGNORE);
    syncConfigCustom.setCustomFilter(false);
    syncConfigCustom.setReconciliation(false);
    // We want do sync for account changed in future
    syncConfigCustom.setToken(LocalDateTime.now().toString("yyyy-MM-dd HH:mm:ss"));
    // We don`t use custom filter. This option will be not used.
    syncConfigCustom.setFilterOperation(IcFilterOperationType.ENDS_WITH);
    syncConfigService.save(syncConfigCustom);
    synchornizationService.setSynchronizationConfigId(syncConfigCustom.getId());
    synchornizationService.process();
    // 
    SysSyncLogFilter logFilter = new SysSyncLogFilter();
    logFilter.setSynchronizationConfigId(syncConfigCustom.getId());
    List<SysSyncLogDto> logs = syncLogService.find(logFilter, null).getContent();
    Assert.assertEquals(1, logs.size());
    SysSyncLogDto log = logs.get(0);
    Assert.assertFalse(log.isRunning());
    Assert.assertFalse(log.isContainsError());
    SysSyncActionLogFilter actionLogFilter = new SysSyncActionLogFilter();
    actionLogFilter.setSynchronizationLogId(log.getId());
    List<SysSyncActionLogDto> actions = syncActionLogService.find(actionLogFilter, null).getContent();
    Assert.assertEquals(1, actions.size());
    SysSyncActionLogDto actionLog = actions.stream().filter(action -> {
        return SynchronizationActionType.UPDATE_ENTITY == action.getSyncAction();
    }).findFirst().get();
    SysSyncItemLogFilter itemLogFilter = new SysSyncItemLogFilter();
    itemLogFilter.setSyncActionLogId(actionLog.getId());
    List<SysSyncItemLogDto> items = syncItemLogService.find(itemLogFilter, null).getContent();
    Assert.assertEquals(1, items.size());
    Assert.assertEquals("x" + IDENTITY_USERNAME_TWO, items.get(0).getIdentification());
    // Delete log
    syncLogService.delete(log);
    // We have to change property of connector configuration "changeLogColumn" from "modified" on empty string.
    // When is this property set, then custom filter not working. Bug in Table connector !!!
    formService.saveValues(system, changeLogColumn, ImmutableList.of(""));
}
Also used : SysSystemMappingDto(eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto) IdmFormDefinitionDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormDefinitionDto) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) SysSyncActionLogDto(eu.bcvsolutions.idm.acc.dto.SysSyncActionLogDto) AbstractSysSyncConfigDto(eu.bcvsolutions.idm.acc.dto.AbstractSysSyncConfigDto) IdmFormAttributeDto(eu.bcvsolutions.idm.core.eav.api.dto.IdmFormAttributeDto) SysSyncLogFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncLogFilter) SysSyncItemLogDto(eu.bcvsolutions.idm.acc.dto.SysSyncItemLogDto) SysSyncItemLogFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncItemLogFilter) SysSyncActionLogFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncActionLogFilter) SysSyncConfigFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncConfigFilter) SysSyncLogDto(eu.bcvsolutions.idm.acc.dto.SysSyncLogDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 28 with SysSyncActionLogFilter

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

the class DefaultSynchronizationServiceTest method doStartSyncD_Missing_Account_doDeleteEntity.

@Test
public void doStartSyncD_Missing_Account_doDeleteEntity() {
    SysSyncConfigFilter configFilter = new SysSyncConfigFilter();
    configFilter.setName(SYNC_CONFIG_NAME);
    List<AbstractSysSyncConfigDto> syncConfigs = syncConfigService.find(configFilter, null).getContent();
    Assert.assertEquals(1, syncConfigs.size());
    AbstractSysSyncConfigDto syncConfigCustom = syncConfigs.get(0);
    Assert.assertFalse(syncConfigService.isRunning(syncConfigCustom));
    // Delete all accounts in resource
    this.getBean().deleteAllResourceData();
    // Set sync config
    syncConfigCustom.setLinkedAction(SynchronizationLinkedActionType.IGNORE);
    syncConfigCustom.setUnlinkedAction(SynchronizationUnlinkedActionType.IGNORE);
    syncConfigCustom.setMissingEntityAction(SynchronizationMissingEntityActionType.IGNORE);
    syncConfigCustom.setMissingAccountAction(ReconciliationMissingAccountActionType.DELETE_ENTITY);
    syncConfigCustom.setReconciliation(true);
    syncConfigService.save(syncConfigCustom);
    // Check state before sync
    Assert.assertNotNull(identityService.getByUsername("x" + IDENTITY_USERNAME_ONE));
    Assert.assertNotNull(identityService.getByUsername("x" + IDENTITY_USERNAME_TWO));
    Assert.assertNotNull(identityService.getByUsername("x" + IDENTITY_USERNAME_THREE));
    // Start synchronization
    synchornizationService.setSynchronizationConfigId(syncConfigCustom.getId());
    synchornizationService.process();
    // 
    SysSyncLogFilter logFilter = new SysSyncLogFilter();
    logFilter.setSynchronizationConfigId(syncConfigCustom.getId());
    List<SysSyncLogDto> logs = syncLogService.find(logFilter, null).getContent();
    Assert.assertEquals(1, logs.size());
    SysSyncLogDto log = logs.get(0);
    Assert.assertFalse(log.isRunning());
    Assert.assertFalse(log.isContainsError());
    SysSyncActionLogFilter actionLogFilter = new SysSyncActionLogFilter();
    actionLogFilter.setSynchronizationLogId(log.getId());
    List<SysSyncActionLogDto> actions = syncActionLogService.find(actionLogFilter, null).getContent();
    Assert.assertEquals(1, actions.size());
    SysSyncActionLogDto actionLog = actions.stream().filter(action -> {
        return SynchronizationActionType.DELETE_ENTITY == action.getSyncAction();
    }).findFirst().get();
    SysSyncItemLogFilter itemLogFilter = new SysSyncItemLogFilter();
    itemLogFilter.setSyncActionLogId(actionLog.getId());
    List<SysSyncItemLogDto> items = syncItemLogService.find(itemLogFilter, null).getContent();
    Assert.assertEquals(3, items.size());
    // Check state after sync
    Assert.assertNull(identityService.getByUsername("x" + IDENTITY_USERNAME_ONE));
    Assert.assertNull(identityService.getByUsername("x" + IDENTITY_USERNAME_TWO));
    Assert.assertNull(identityService.getByUsername("x" + IDENTITY_USERNAME_THREE));
    // Delete log
    syncLogService.delete(log);
}
Also used : SysSyncActionLogDto(eu.bcvsolutions.idm.acc.dto.SysSyncActionLogDto) AbstractSysSyncConfigDto(eu.bcvsolutions.idm.acc.dto.AbstractSysSyncConfigDto) SysSyncLogFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncLogFilter) SysSyncItemLogDto(eu.bcvsolutions.idm.acc.dto.SysSyncItemLogDto) SysSyncItemLogFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncItemLogFilter) SysSyncActionLogFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncActionLogFilter) SysSyncConfigFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncConfigFilter) SysSyncLogDto(eu.bcvsolutions.idm.acc.dto.SysSyncLogDto) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest) Test(org.junit.Test)

Example 29 with SysSyncActionLogFilter

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

the class DefaultSysSyncLogService method delete.

@Override
@Transactional
public void delete(SysSyncLogDto syncLog, BasePermission... permission) {
    Assert.notNull(syncLog);
    checkAccess(this.getEntity(syncLog.getId()), permission);
    // 
    // remove all synchronization action logs
    SysSyncActionLogFilter filter = new SysSyncActionLogFilter();
    filter.setSynchronizationLogId(syncLog.getId());
    syncActionLogService.find(filter, null).forEach(log -> {
        syncActionLogService.delete(log);
    });
    // 
    super.delete(syncLog);
}
Also used : SysSyncActionLogFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncActionLogFilter) Transactional(org.springframework.transaction.annotation.Transactional)

Example 30 with SysSyncActionLogFilter

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

the class DefaultSysSyncLogService method getActionsForLog.

/**
 * Method return all {@link SysSyncActionLogDto} for given log id
 *
 * @param logId
 * @return
 */
private List<SysSyncActionLogDto> getActionsForLog(UUID logId) {
    Assert.notNull(logId);
    // 
    SysSyncActionLogFilter filter = new SysSyncActionLogFilter();
    filter.setSynchronizationLogId(logId);
    return syncActionLogService.find(filter, null).getContent();
}
Also used : SysSyncActionLogFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncActionLogFilter)

Aggregations

SysSyncActionLogFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSyncActionLogFilter)30 SysSyncActionLogDto (eu.bcvsolutions.idm.acc.dto.SysSyncActionLogDto)26 SysSyncItemLogDto (eu.bcvsolutions.idm.acc.dto.SysSyncItemLogDto)26 SysSyncLogDto (eu.bcvsolutions.idm.acc.dto.SysSyncLogDto)26 SysSyncItemLogFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSyncItemLogFilter)25 SysSyncLogFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSyncLogFilter)25 AbstractSysSyncConfigDto (eu.bcvsolutions.idm.acc.dto.AbstractSysSyncConfigDto)24 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)23 Test (org.junit.Test)23 SysSyncConfigFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSyncConfigFilter)21 IdmIdentityDto (eu.bcvsolutions.idm.core.api.dto.IdmIdentityDto)8 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)6 SysSystemMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemMappingDto)6 AccIdentityAccountFilter (eu.bcvsolutions.idm.acc.dto.filter.AccIdentityAccountFilter)6 SysSystemAttributeMappingDto (eu.bcvsolutions.idm.acc.dto.SysSystemAttributeMappingDto)4 SysSystemAttributeMappingFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSystemAttributeMappingFilter)4 SysSystemMappingFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSystemMappingFilter)4 SystemEntityType (eu.bcvsolutions.idm.acc.domain.SystemEntityType)3 Transactional (org.springframework.transaction.annotation.Transactional)3 ImmutableList (com.google.common.collect.ImmutableList)2