Search in sources :

Example 1 with SysSystemFilter

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

the class SysSystemController method toFilter.

@Override
protected SysSystemFilter toFilter(MultiValueMap<String, Object> parameters) {
    SysSystemFilter filter = new SysSystemFilter(parameters);
    // 
    filter.setPasswordPolicyValidationId(getParameterConverter().toUuid(parameters, "passwordPolicyValidationId"));
    filter.setPasswordPolicyGenerationId(getParameterConverter().toUuid(parameters, "passwordPolicyGenerationId"));
    filter.setVirtual(getParameterConverter().toBoolean(parameters, "virtual"));
    return filter;
}
Also used : SysSystemFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemFilter)

Example 2 with SysSystemFilter

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

the class RemoteServerDeleteBulkAction method prevalidate.

@Override
public ResultModels prevalidate() {
    IdmBulkActionDto action = getAction();
    List<UUID> entities = getEntities(action, new StringBuilder());
    ResultModels result = new ResultModels();
    Map<ResultModel, Long> models = new HashMap<>();
    entities.forEach(remoteServerId -> {
        SysSystemFilter systemFilter = new SysSystemFilter();
        systemFilter.setRemoteServerId(remoteServerId);
        long count = systemService.count(systemFilter);
        if (count > 0) {
            SysConnectorServerDto remoteServer = getService().get(remoteServerId);
            models.put(new DefaultResultModel(AccResultCode.REMOTE_SYSTEM_DELETE_FAILED_HAS_SYSTEMS, ImmutableMap.of("remoteServer", remoteServer.getFullServerName(), "count", count)), count);
        }
    });
    // 
    // Sort by count
    List<Entry<ResultModel, Long>> collect = models.entrySet().stream().sorted(Collections.reverseOrder(Map.Entry.comparingByValue())).collect(Collectors.toList());
    collect.forEach(entry -> {
        result.addInfo(entry.getKey());
    });
    // 
    return result;
}
Also used : IdmBulkActionDto(eu.bcvsolutions.idm.core.api.bulk.action.dto.IdmBulkActionDto) SysSystemFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemFilter) DefaultResultModel(eu.bcvsolutions.idm.core.api.dto.DefaultResultModel) HashMap(java.util.HashMap) DefaultResultModel(eu.bcvsolutions.idm.core.api.dto.DefaultResultModel) ResultModel(eu.bcvsolutions.idm.core.api.dto.ResultModel) ResultModels(eu.bcvsolutions.idm.core.api.dto.ResultModels) Entry(java.util.Map.Entry) UUID(java.util.UUID) SysConnectorServerDto(eu.bcvsolutions.idm.acc.dto.SysConnectorServerDto)

Example 3 with SysSystemFilter

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

the class ComplexHrProcessIntegrationTest method startSynchronization.

/**
 * Wrapper function triggering defined HR system sychronisation
 * @param systemName
 * @return
 */
private IdmLongRunningTaskDto startSynchronization(String systemName) {
    SysSystemFilter sysFilt = new SysSystemFilter();
    sysFilt.setText(systemName);
    SysSystemDto system = systemService.getByCode(systemName);
    Assert.assertNotNull(system);
    SysSyncConfigFilter syncFilt = new SysSyncConfigFilter();
    syncFilt.setSystemId(system.getId());
    List<AbstractSysSyncConfigDto> syncs = sysSyncConfigService.find(syncFilt, null).getContent();
    Assert.assertEquals(1, syncs.size());
    AbstractSysSyncConfigDto config = syncs.get(0);
    SynchronizationSchedulableTaskExecutor lrt = new SynchronizationSchedulableTaskExecutor(config.getId());
    LongRunningFutureTask<Boolean> longRunningFutureTask = longRunningTaskManager.execute(lrt);
    IdmLongRunningTaskDto lrtDto = longRunningTaskService.get(longRunningFutureTask.getExecutor().getLongRunningTaskId());
    return lrtDto;
}
Also used : AbstractSysSyncConfigDto(eu.bcvsolutions.idm.acc.dto.AbstractSysSyncConfigDto) IdmLongRunningTaskDto(eu.bcvsolutions.idm.core.scheduler.api.dto.IdmLongRunningTaskDto) SysSystemFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemFilter) SynchronizationSchedulableTaskExecutor(eu.bcvsolutions.idm.acc.scheduler.task.impl.SynchronizationSchedulableTaskExecutor) SysSyncConfigFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSyncConfigFilter) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto)

Example 4 with SysSystemFilter

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

the class DefaultSysSystemServiceFilterTest method testSystemVirtualFilter.

@Test
public void testSystemVirtualFilter() {
    SysSystemDto system1 = createSystem("test001" + System.currentTimeMillis(), true);
    createSystem("test002" + System.currentTimeMillis(), false);
    // 
    SysSystemFilter testFilter = new SysSystemFilter();
    testFilter.setVirtual(true);
    Page<SysSystemDto> pages = systemService.find(testFilter, null);
    assertEquals(1, pages.getTotalElements());
    assertEquals(system1.getId(), pages.getContent().get(0).getId());
}
Also used : SysSystemFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemFilter) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Example 5 with SysSystemFilter

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

the class DefaultSysSystemServiceFilterTest method testSystemNameFilter.

@Test
public void testSystemNameFilter() {
    SysSystemDto system1 = createSystem("test001" + System.currentTimeMillis(), null);
    createSystem("test002" + System.currentTimeMillis(), null);
    // 
    SysSystemFilter testFilter = new SysSystemFilter();
    testFilter.setText(system1.getName());
    Page<SysSystemDto> pages = systemService.find(testFilter, null);
    assertEquals(1, pages.getTotalElements());
    assertEquals(system1.getId(), pages.getContent().get(0).getId());
}
Also used : SysSystemFilter(eu.bcvsolutions.idm.acc.dto.filter.SysSystemFilter) SysSystemDto(eu.bcvsolutions.idm.acc.dto.SysSystemDto) Test(org.junit.Test) AbstractIntegrationTest(eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)

Aggregations

SysSystemFilter (eu.bcvsolutions.idm.acc.dto.filter.SysSystemFilter)18 SysSystemDto (eu.bcvsolutions.idm.acc.dto.SysSystemDto)11 Test (org.junit.Test)10 SysConnectorServerDto (eu.bcvsolutions.idm.acc.dto.SysConnectorServerDto)8 AbstractIntegrationTest (eu.bcvsolutions.idm.test.api.AbstractIntegrationTest)7 UUID (java.util.UUID)7 IdmPasswordPolicyDto (eu.bcvsolutions.idm.core.api.dto.IdmPasswordPolicyDto)6 GuardedString (eu.bcvsolutions.idm.core.security.api.domain.GuardedString)6 SysSystem (eu.bcvsolutions.idm.acc.entity.SysSystem)5 SysRemoteServerService (eu.bcvsolutions.idm.acc.service.api.SysRemoteServerService)5 SysSystemService (eu.bcvsolutions.idm.acc.service.api.SysSystemService)5 ConfidentialStorage (eu.bcvsolutions.idm.core.api.service.ConfidentialStorage)5 List (java.util.List)5 Autowired (org.springframework.beans.factory.annotation.Autowired)5 DefaultEventResult (eu.bcvsolutions.idm.core.api.event.DefaultEventResult)4 Assert (org.junit.Assert)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 IdmPasswordPolicyGenerateType (eu.bcvsolutions.idm.core.api.domain.IdmPasswordPolicyGenerateType)3 IdmPasswordPolicyType (eu.bcvsolutions.idm.core.api.domain.IdmPasswordPolicyType)3 AbstractReadWriteDtoController (eu.bcvsolutions.idm.core.api.rest.AbstractReadWriteDtoController)3