use of eu.bcvsolutions.idm.core.scheduler.task.impl.RebuildTreeNodeIndexTaskExecutor in project CzechIdMng by bcvsolutions.
the class DefaultIdmTreeNodeService method rebuildIndexes.
@Override
@Transactional
public UUID rebuildIndexes(UUID treeTypeId) {
Assert.notNull(treeTypeId, "Tree type identifier is required.");
IdmTreeTypeDto treeType = treeTypeService.get(treeTypeId);
Assert.notNull(treeType, "Tree type is required");
//
String treeTypeCode = treeType.getCode();
RebuildTreeNodeIndexTaskExecutor rebuildTask = AutowireHelper.createBean(RebuildTreeNodeIndexTaskExecutor.class);
rebuildTask.setTreeTypeCode(treeTypeCode);
UUID longRunningTaskId = longRunningTaskManager.execute(rebuildTask).getExecutor().getLongRunningTaskId();
// wee need long running task related to index rebuild immediately
configurationService.setValue(treeTypeService.getConfigurationPropertyName(treeTypeCode, IdmTreeTypeService.CONFIGURATION_PROPERTY_REBUILD), longRunningTaskId.toString());
return longRunningTaskId;
}
Aggregations