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;
}
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;
}
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;
}
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());
}
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());
}
Aggregations