Search in sources :

Example 1 with IndexingTask

use of org.apache.archiva.admin.model.beans.IndexingTask in project archiva by apache.

the class DefaultRepositoryTaskAdministration method updateIndexInfo.

public void updateIndexInfo(ScanStatus scanStatus, ArtifactIndexingTask runningIndexingTask, List<ArtifactIndexingTask> taskQueue) {
    List<IndexingTask> newIndexQueue = new ArrayList<>();
    if (runningIndexingTask != null) {
        IndexingTask taskInfo = getIndexingTaskInfo(runningIndexingTask);
        taskInfo.setRunning(true);
        newIndexQueue.add(taskInfo);
    }
    newIndexQueue.addAll(taskQueue.stream().map(task -> getIndexingTaskInfo(task)).collect(Collectors.toList()));
    scanStatus.setIndexingQueue(newIndexQueue);
}
Also used : ArtifactIndexingTask(org.apache.archiva.scheduler.indexing.ArtifactIndexingTask) IndexingTask(org.apache.archiva.admin.model.beans.IndexingTask) ArrayList(java.util.ArrayList)

Example 2 with IndexingTask

use of org.apache.archiva.admin.model.beans.IndexingTask in project archiva by apache.

the class DefaultRepositoryTaskAdministration method getIndexingTaskInfo.

public static IndexingTask getIndexingTaskInfo(ArtifactIndexingTask repositoryTask) {
    IndexingTask indexingTask = new IndexingTask();
    indexingTask.setFullScan(repositoryTask.isExecuteOnEntireRepo());
    indexingTask.setUpdateOnly(repositoryTask.isOnlyUpdate());
    indexingTask.setResource(repositoryTask.getResourceFile() == null ? "" : repositoryTask.getResourceFile().toString());
    indexingTask.setMaxExecutionTimeMs(repositoryTask.getMaxExecutionTime());
    indexingTask.setRepositoryId(repositoryTask.getRepository().getId());
    return indexingTask;
}
Also used : ArtifactIndexingTask(org.apache.archiva.scheduler.indexing.ArtifactIndexingTask) IndexingTask(org.apache.archiva.admin.model.beans.IndexingTask)

Aggregations

IndexingTask (org.apache.archiva.admin.model.beans.IndexingTask)2 ArtifactIndexingTask (org.apache.archiva.scheduler.indexing.ArtifactIndexingTask)2 ArrayList (java.util.ArrayList)1