*/
@Service( "taskExecutor#repository-scanning" )
public class ArchivaRepositoryScanningTaskExecutor
- implements TaskExecutor
+ implements TaskExecutor<RepositoryTask>
{
private Logger log = LoggerFactory.getLogger( ArchivaRepositoryScanningTaskExecutor.class );
@SuppressWarnings( "unchecked" )
@Override
- public void executeTask( Task task )
+ public void executeTask( RepositoryTask task )
throws TaskExecutionException
{
try
this.task = task;
- RepositoryTask repoTask = (RepositoryTask) task;
-
- String repoId = repoTask.getRepositoryId();
+ String repoId = task.getRepositoryId();
if ( StringUtils.isBlank( repoId ) )
{
throw new TaskExecutionException( "Unable to execute RepositoryTask with blank repository Id." );
ManagedRepository arepo = managedRepositoryAdmin.getManagedRepository( repoId );
// execute consumers on resource file if set
- if ( repoTask.getResourceFile() != null )
+ if ( task.getResourceFile() != null )
{
- log.debug( "Executing task from queue with job name: {}", repoTask );
- consumers.executeConsumers( arepo, repoTask.getResourceFile(), repoTask.isUpdateRelatedArtifacts() );
+ log.debug( "Executing task from queue with job name: {}", task );
+ consumers.executeConsumers( arepo, task.getResourceFile(), task.isUpdateRelatedArtifacts() );
}
else
{
- log.info( "Executing task from queue with job name: {}", repoTask );
+ log.info( "Executing task from queue with job name: {}", task );
// otherwise, execute consumers on whole repository
if ( arepo == null )
MetadataRepository metadataRepository = repositorySession.getRepository();
try
{
- if ( !repoTask.isScanAll() )
+ if ( !task.isScanAll() )
{
RepositoryStatistics previousStats =
repositoryStatisticsManager.getLastStatistics( metadataRepository, repoId );
// metadataRepository.findAllProjects();
// FIXME: do something
- log.info( "Finished repository task: {}", repoTask );
+ log.info( "Finished repository task: {}", task );
this.task = null;
}