Search in sources :

Example 1 with RebuildTreeNodeIndexTaskExecutor

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;
}
Also used : IdmTreeTypeDto(eu.bcvsolutions.idm.core.api.dto.IdmTreeTypeDto) RebuildTreeNodeIndexTaskExecutor(eu.bcvsolutions.idm.core.scheduler.task.impl.RebuildTreeNodeIndexTaskExecutor) UUID(java.util.UUID) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

IdmTreeTypeDto (eu.bcvsolutions.idm.core.api.dto.IdmTreeTypeDto)1 RebuildTreeNodeIndexTaskExecutor (eu.bcvsolutions.idm.core.scheduler.task.impl.RebuildTreeNodeIndexTaskExecutor)1 UUID (java.util.UUID)1 Transactional (org.springframework.transaction.annotation.Transactional)1