Search in sources :

Example 1 with MetadataScanTask

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;
}
Also used : MetadataScanTask(org.apache.archiva.admin.model.beans.MetadataScanTask)

Example 2 with MetadataScanTask

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;
}
Also used : StorageAsset(org.apache.archiva.repository.storage.StorageAsset) MetadataScanTask(org.apache.archiva.admin.model.beans.MetadataScanTask)

Example 3 with MetadataScanTask

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);
}
Also used : ArrayList(java.util.ArrayList) MetadataScanTask(org.apache.archiva.admin.model.beans.MetadataScanTask)

Aggregations

MetadataScanTask (org.apache.archiva.admin.model.beans.MetadataScanTask)3 ArrayList (java.util.ArrayList)1 StorageAsset (org.apache.archiva.repository.storage.StorageAsset)1