@Service(value="archivaTaskScheduler#repository") public class DefaultRepositoryArchivaTaskScheduler extends Object implements RepositoryArchivaTaskScheduler, ConfigurationListener
Modifier and Type | Field and Description |
---|---|
private ArchivaConfiguration |
archivaConfiguration |
static String |
CRON_HOURLY |
private org.apache.archiva.redback.components.scheduler.CronExpressionValidator |
cronValidator |
private Set<String> |
jobs |
private org.slf4j.Logger |
log |
private List<String> |
queuedRepos |
private static String |
REPOSITORY_JOB |
private static String |
REPOSITORY_JOB_TRIGGER |
private static String |
REPOSITORY_SCAN_GROUP |
private org.apache.archiva.redback.components.taskqueue.TaskQueue |
repositoryScanningQueue |
private RepositorySessionFactory |
repositorySessionFactory
TODO: could have multiple implementations
|
private RepositoryStatisticsManager |
repositoryStatisticsManager |
private org.apache.archiva.redback.components.scheduler.Scheduler |
scheduler |
(package private) static String |
TASK_QUEUE |
(package private) static String |
TASK_REPOSITORY |
Constructor and Description |
---|
DefaultRepositoryArchivaTaskScheduler() |
Modifier and Type | Method and Description |
---|---|
void |
configurationEvent(ConfigurationEvent event)
Generic event point to notify components that something has happend in the configuration.
|
private boolean |
isPreviouslyScanned(ManagedRepositoryConfiguration repoConfig,
MetadataRepository metadataRepository) |
boolean |
isProcessingRepositoryTask(RepositoryTask task) |
boolean |
isProcessingRepositoryTask(String repositoryId) |
private void |
queueInitialRepoScan(ManagedRepositoryConfiguration repoConfig) |
void |
queueTask(RepositoryTask task)
Adds the task to the scanning queue.
|
private void |
scheduleRepositoryJobs(ManagedRepositoryConfiguration repoConfig) |
void |
startup() |
void |
stop() |
boolean |
unQueueTask(RepositoryTask task) |
private org.slf4j.Logger log
@Inject private org.apache.archiva.redback.components.scheduler.Scheduler scheduler
@Inject private org.apache.archiva.redback.components.scheduler.CronExpressionValidator cronValidator
@Inject @Named(value="taskQueue#repository-scanning") private org.apache.archiva.redback.components.taskqueue.TaskQueue repositoryScanningQueue
@Inject private ArchivaConfiguration archivaConfiguration
@Inject @Named(value="repositoryStatisticsManager#default") private RepositoryStatisticsManager repositoryStatisticsManager
@Inject private RepositorySessionFactory repositorySessionFactory
private static final String REPOSITORY_SCAN_GROUP
private static final String REPOSITORY_JOB
private static final String REPOSITORY_JOB_TRIGGER
static final String TASK_QUEUE
static final String TASK_REPOSITORY
public static final String CRON_HOURLY
private List<String> queuedRepos
public DefaultRepositoryArchivaTaskScheduler()
@PostConstruct public void startup() throws ArchivaException
ArchivaException
@PreDestroy public void stop() throws org.quartz.SchedulerException
org.quartz.SchedulerException
public boolean isProcessingRepositoryTask(String repositoryId)
isProcessingRepositoryTask
in interface RepositoryArchivaTaskScheduler
public boolean isProcessingRepositoryTask(RepositoryTask task)
isProcessingRepositoryTask
in interface RepositoryArchivaTaskScheduler
public void queueTask(RepositoryTask task) throws org.apache.archiva.redback.components.taskqueue.TaskQueueException
ArchivaTaskScheduler
queueTask
in interface ArchivaTaskScheduler<RepositoryTask>
queueTask
in interface RepositoryArchivaTaskScheduler
org.apache.archiva.redback.components.taskqueue.TaskQueueException
public boolean unQueueTask(RepositoryTask task) throws org.apache.archiva.redback.components.taskqueue.TaskQueueException
unQueueTask
in interface RepositoryArchivaTaskScheduler
org.apache.archiva.redback.components.taskqueue.TaskQueueException
public void configurationEvent(ConfigurationEvent event)
ConfigurationListener
configurationEvent
in interface ConfigurationListener
private boolean isPreviouslyScanned(ManagedRepositoryConfiguration repoConfig, MetadataRepository metadataRepository) throws MetadataRepositoryException
MetadataRepositoryException
private void queueInitialRepoScan(ManagedRepositoryConfiguration repoConfig)
private void scheduleRepositoryJobs(ManagedRepositoryConfiguration repoConfig) throws org.quartz.SchedulerException
org.quartz.SchedulerException
Copyright © 2006–2023 The Apache Software Foundation. All rights reserved.