use of org.apache.archiva.admin.model.beans.MetadataScanTask in project archiva by apache.
the class ScanTask method of.
public static ScanTask of(MetadataScanTask repositoryTask) {
ScanTask scanTask = new ScanTask();
scanTask.setFullRepository(repositoryTask.isFullScan());
scanTask.setUpdateRelatedArtifacts(repositoryTask.isUpdateRelatedArtifacts());
scanTask.setResource(repositoryTask.getResource());
scanTask.setMaxExecutionTimeMs(repositoryTask.getMaxExecutionTimeMs());
scanTask.setRepositoryId(repositoryTask.getRepositoryId());
return scanTask;
}
use of org.apache.archiva.admin.model.beans.MetadataScanTask in project archiva by apache.
the class DefaultRepositoryTaskAdministration method getMetadataScanTaskInfo.
public static MetadataScanTask getMetadataScanTaskInfo(RepositoryTask repositoryTask) {
MetadataScanTask scanTask = new MetadataScanTask();
scanTask.setFullScan(repositoryTask.isScanAll());
scanTask.setUpdateRelatedArtifacts(repositoryTask.isUpdateRelatedArtifacts());
StorageAsset file = repositoryTask.getResourceFile();
scanTask.setResource(repositoryTask.getResourceFile() == null ? "" : repositoryTask.getResourceFile().toString());
scanTask.setMaxExecutionTimeMs(repositoryTask.getMaxExecutionTime());
scanTask.setRepositoryId(repositoryTask.getRepositoryId());
return scanTask;
}
use of org.apache.archiva.admin.model.beans.MetadataScanTask in project archiva by apache.
the class DefaultRepositoryTaskAdministration method updateScanInfo.
public void updateScanInfo(ScanStatus scanStatus, RepositoryTask runningRepositoryTask, List<RepositoryTask> taskQueue) {
List<MetadataScanTask> newScanQueue = new ArrayList<>();
if (runningRepositoryTask != null) {
MetadataScanTask taskInfo = getMetadataScanTaskInfo(runningRepositoryTask);
taskInfo.setRunning(true);
newScanQueue.add(0, taskInfo);
}
newScanQueue.addAll(taskQueue.stream().map(task -> getMetadataScanTaskInfo(task)).collect(Collectors.toList()));
scanStatus.setScanQueue(newScanQueue);
}
Aggregations