use of org.apache.archiva.redback.components.taskqueue.TaskQueueException in project archiva by apache.
the class NexusIndexerConsumer method processFile.
@Override
public void processFile(String path) throws ConsumerException {
Path artifactFile = managedRepository.resolve(path);
ArtifactIndexingTask task = new ArtifactIndexingTask(repository, artifactFile, ArtifactIndexingTask.Action.ADD, repository.getIndexingContext());
try {
log.debug("Queueing indexing task '{}' to add or update the artifact in the index.", task);
scheduler.queueTask(task);
} catch (TaskQueueException e) {
throw new ConsumerException(e.getMessage(), e);
}
}
use of org.apache.archiva.redback.components.taskqueue.TaskQueueException in project archiva by apache.
the class DefaultRepositoryProxyConnectors method queueRepositoryTask.
private void queueRepositoryTask(String repositoryId, Path localFile) {
RepositoryTask task = new RepositoryTask();
task.setRepositoryId(repositoryId);
task.setResourceFile(localFile);
task.setUpdateRelatedArtifacts(true);
task.setScanAll(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 ArchivaDavResource method queueRepositoryTask.
private void queueRepositoryTask(Path localFile) {
RepositoryTask task = new RepositoryTask();
task.setRepositoryId(repository.getId());
task.setResourceFile(localFile);
task.setUpdateRelatedArtifacts(false);
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 NexusIndexerConsumer method processFile.
@Override
public void processFile(String path, boolean executeOnEntireRepo) throws Exception {
if (executeOnEntireRepo) {
processFile(path);
} else {
Path artifactFile = managedRepository.resolve(path);
// specify in indexing task that this is not a repo scan request!
ArtifactIndexingTask task = new ArtifactIndexingTask(repository, artifactFile, ArtifactIndexingTask.Action.ADD, repository.getIndexingContext(), false);
// only update index we don't need to scan the full repo here
task.setOnlyUpdate(true);
try {
log.debug("Queueing indexing task '{}' to add or update the artifact in the index.", task);
scheduler.queueTask(task);
} catch (TaskQueueException e) {
throw new ConsumerException(e.getMessage(), e);
}
}
}
use of org.apache.archiva.redback.components.taskqueue.TaskQueueException in project archiva by apache.
the class NexusIndexerConsumer method completeScan.
@Override
public void completeScan() {
ArtifactIndexingTask task = new ArtifactIndexingTask(repository, null, ArtifactIndexingTask.Action.FINISH, repository.getIndexingContext());
try {
log.debug("Queueing indexing task '{}' to finish indexing.", task);
scheduler.queueTask(task);
} catch (TaskQueueException e) {
log.error("Error queueing task: {}: {}", task, e.getMessage(), e);
}
}
Aggregations