use of org.apache.archiva.redback.components.taskqueue.TaskQueueException in project archiva by apache.
the class DefaultFileUploadService method queueRepositoryTask.
private void queueRepositoryTask(String repositoryId, Path localFile) {
RepositoryTask task = new RepositoryTask();
task.setRepositoryId(repositoryId);
task.setResourceFile(localFile);
task.setUpdateRelatedArtifacts(true);
task.setScanAll(false);
try {
scheduler.queueTask(task);
} catch (TaskQueueException e) {
log.error("Unable to queue repository task to execute consumers on resource file ['{}" + "'].", localFile.getFileName());
}
}
use of org.apache.archiva.redback.components.taskqueue.TaskQueueException in project archiva by apache.
the class DefaultRepositoriesService method removeScanningTaskFromQueue.
@Override
public Boolean removeScanningTaskFromQueue(String repositoryId) {
RepositoryTask task = new RepositoryTask();
task.setRepositoryId(repositoryId);
try {
return repositoryTaskScheduler.unQueueTask(task);
} catch (TaskQueueException e) {
log.error("failed to unschedule scanning of repo with id {}", repositoryId, e);
return false;
}
}
use of org.apache.archiva.redback.components.taskqueue.TaskQueueException in project archiva by apache.
the class DefaultRepositoriesService method queueRepositoryTask.
private void queueRepositoryTask(String repositoryId, Path localFile) {
RepositoryTask task = new RepositoryTask();
task.setRepositoryId(repositoryId);
task.setResourceFile(localFile);
task.setUpdateRelatedArtifacts(true);
try {
scheduler.queueTask(task);
} catch (TaskQueueException e) {
log.error("Unable to queue repository task to execute consumers on resource file ['{}" + "'].", localFile.getFileName());
}
}
use of org.apache.archiva.redback.components.taskqueue.TaskQueueException in project archiva by apache.
the class AbstractRestService method doScanRepository.
protected Boolean doScanRepository(String repositoryId, boolean fullScan) {
if (repositoryTaskScheduler.isProcessingRepositoryTask(repositoryId)) {
log.info("scanning of repository with id {} already scheduled", repositoryId);
return Boolean.FALSE;
}
RepositoryTask task = new RepositoryTask();
task.setRepositoryId(repositoryId);
task.setScanAll(fullScan);
try {
repositoryTaskScheduler.queueTask(task);
} catch (TaskQueueException e) {
log.error("failed to schedule scanning of repo with id {}", repositoryId, e);
return false;
}
return true;
}
use of org.apache.archiva.redback.components.taskqueue.TaskQueueException in project archiva by apache.
the class DefaultRepositoryArchivaTaskScheduler method queueInitialRepoScan.
// MRM-848: Pre-configured repository initially appear to be empty
private synchronized void queueInitialRepoScan(ManagedRepositoryConfiguration repoConfig) {
String repoId = repoConfig.getId();
RepositoryTask task = new RepositoryTask();
task.setRepositoryId(repoId);
if (!queuedRepos.contains(repoId)) {
log.info("Repository [{}] is queued to be scanned as it hasn't been previously.", repoId);
try {
queuedRepos.add(repoConfig.getId());
this.queueTask(task);
} catch (TaskQueueException e) {
log.error("Error occurred while queueing repository [{}] task : {}", e.getMessage(), repoId);
}
}
}
Aggregations