git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1403504 13f79535-47bb-0310-9956-ffa450edef68tags/archiva-1.4-M4
@@ -37,10 +37,6 @@ | |||
<groupId>org.apache.archiva</groupId> | |||
<artifactId>archiva-scheduler-api</artifactId> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.archiva</groupId> | |||
<artifactId>archiva-scheduler-repository</artifactId> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.archiva</groupId> | |||
<artifactId>archiva-repository-layer</artifactId> | |||
@@ -59,10 +55,10 @@ | |||
<groupId>org.apache.archiva</groupId> | |||
<artifactId>archiva-repository-scanner</artifactId> | |||
</dependency> | |||
<!--dependency> | |||
<dependency> | |||
<groupId>org.apache.archiva</groupId> | |||
<artifactId>archiva-scheduler-repository</artifactId> | |||
</dependency--> | |||
<artifactId>archiva-scheduler-repository-api</artifactId> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.archiva</groupId> | |||
<artifactId>archiva-proxy-common</artifactId> |
@@ -37,14 +37,18 @@ | |||
<groupId>org.apache.archiva</groupId> | |||
<artifactId>archiva-security-common</artifactId> | |||
</dependency> | |||
<dependency> | |||
<dependency> | |||
<groupId>org.apache.archiva</groupId> | |||
<artifactId>archiva-scheduler-repository</artifactId> | |||
<artifactId>archiva-scheduler-repository-api</artifactId> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.archiva</groupId> | |||
<artifactId>archiva-repository-admin-api</artifactId> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.archiva</groupId> | |||
<artifactId>repository-statistics</artifactId> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.archiva</groupId> | |||
<artifactId>archiva-plexus-bridge</artifactId> | |||
@@ -57,6 +61,10 @@ | |||
<groupId>javax.inject</groupId> | |||
<artifactId>javax.inject</artifactId> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.archiva.redback.components</groupId> | |||
<artifactId>spring-taskqueue</artifactId> | |||
</dependency> | |||
<dependency> | |||
<groupId>net.sf.beanlib</groupId> | |||
<artifactId>beanlib</artifactId> |
@@ -30,10 +30,4 @@ | |||
<context:annotation-config/> | |||
<context:component-scan base-package="org.apache.archiva.repository"/> | |||
<bean name="pathParser#legacy" class="org.apache.archiva.repository.content.LegacyPathParser"> | |||
<constructor-arg> | |||
<ref bean="archivaConfiguration#default"/> | |||
</constructor-arg> | |||
</bean> | |||
</beans> |
@@ -32,6 +32,11 @@ | |||
<groupId>org.apache.archiva</groupId> | |||
<artifactId>archiva-scheduler-api</artifactId> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.archiva</groupId> | |||
<artifactId>archiva-scheduler-repository-api</artifactId> | |||
<version>${project.version}</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>commons-io</groupId> | |||
<artifactId>commons-io</artifactId> |
@@ -55,10 +55,10 @@ import java.util.Set; | |||
* Default implementation of a scheduling component for archiva. | |||
*/ | |||
@Service ("archivaTaskScheduler#repository") | |||
public class RepositoryArchivaTaskScheduler | |||
implements ArchivaTaskScheduler<RepositoryTask>, ConfigurationListener | |||
public class DefaultRepositoryArchivaTaskScheduler | |||
implements RepositoryArchivaTaskScheduler, ConfigurationListener | |||
{ | |||
private Logger log = LoggerFactory.getLogger( RepositoryArchivaTaskScheduler.class ); | |||
private Logger log = LoggerFactory.getLogger( getClass() ); | |||
/** | |||
* | |||
@@ -200,8 +200,7 @@ public class RepositoryArchivaTaskScheduler | |||
} | |||
} | |||
@SuppressWarnings ("unchecked") | |||
private boolean isProcessingRepositoryTask( RepositoryTask task ) | |||
public boolean isProcessingRepositoryTask( RepositoryTask task ) | |||
{ | |||
synchronized ( repositoryScanningQueue ) | |||
{ |
@@ -1,145 +0,0 @@ | |||
package org.apache.archiva.scheduler.repository; | |||
import org.apache.archiva.redback.components.taskqueue.Task; | |||
import java.io.File; | |||
/* | |||
* Licensed to the Apache Software Foundation (ASF) under one | |||
* or more contributor license agreements. See the NOTICE file | |||
* distributed with this work for additional information | |||
* regarding copyright ownership. The ASF licenses this file | |||
* to you under the Apache License, Version 2.0 (the | |||
* "License"); you may not use this file except in compliance | |||
* with the License. You may obtain a copy of the License at | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 | |||
* | |||
* Unless required by applicable law or agreed to in writing, | |||
* software distributed under the License is distributed on an | |||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |||
* KIND, either express or implied. See the License for the | |||
* specific language governing permissions and limitations | |||
* under the License. | |||
*/ | |||
/** | |||
* DataRefreshTask - task for discovering changes in the repository | |||
* and updating all associated data. | |||
* | |||
* | |||
*/ | |||
public class RepositoryTask | |||
implements Task | |||
{ | |||
private String repositoryId; | |||
private File resourceFile; | |||
private boolean updateRelatedArtifacts; | |||
private boolean scanAll; | |||
public boolean isScanAll() | |||
{ | |||
return scanAll; | |||
} | |||
public void setScanAll( boolean scanAll ) | |||
{ | |||
this.scanAll = scanAll; | |||
} | |||
public String getRepositoryId() | |||
{ | |||
return repositoryId; | |||
} | |||
public void setRepositoryId( String repositoryId ) | |||
{ | |||
this.repositoryId = repositoryId; | |||
} | |||
public long getMaxExecutionTime() | |||
{ | |||
return 0; | |||
} | |||
public File getResourceFile() | |||
{ | |||
return resourceFile; | |||
} | |||
public void setResourceFile( File resourceFile ) | |||
{ | |||
this.resourceFile = resourceFile; | |||
} | |||
public boolean isUpdateRelatedArtifacts() | |||
{ | |||
return updateRelatedArtifacts; | |||
} | |||
public void setUpdateRelatedArtifacts( boolean updateRelatedArtifacts ) | |||
{ | |||
this.updateRelatedArtifacts = updateRelatedArtifacts; | |||
} | |||
@Override | |||
public String toString() | |||
{ | |||
return "RepositoryTask [repositoryId=" + repositoryId + ", resourceFile=" + resourceFile + ", scanAll=" | |||
+ scanAll + ", updateRelatedArtifacts=" + updateRelatedArtifacts + "]"; | |||
} | |||
@Override | |||
public int hashCode() | |||
{ | |||
final int prime = 31; | |||
int result = 1; | |||
result = prime * result + ( ( repositoryId == null ) ? 0 : repositoryId.hashCode() ); | |||
result = prime * result + ( ( resourceFile == null ) ? 0 : resourceFile.hashCode() ); | |||
return result; | |||
} | |||
@Override | |||
public boolean equals( Object obj ) | |||
{ | |||
if ( this == obj ) | |||
{ | |||
return true; | |||
} | |||
if ( obj == null ) | |||
{ | |||
return false; | |||
} | |||
if ( getClass() != obj.getClass() ) | |||
{ | |||
return false; | |||
} | |||
RepositoryTask other = (RepositoryTask) obj; | |||
if ( repositoryId == null ) | |||
{ | |||
if ( other.repositoryId != null ) | |||
{ | |||
return false; | |||
} | |||
} | |||
else if ( !repositoryId.equals( other.repositoryId ) ) | |||
{ | |||
return false; | |||
} | |||
if ( resourceFile == null ) | |||
{ | |||
if ( other.resourceFile != null ) | |||
{ | |||
return false; | |||
} | |||
} | |||
else if ( !resourceFile.equals( other.resourceFile ) ) | |||
{ | |||
return false; | |||
} | |||
return true; | |||
} | |||
} |
@@ -44,9 +44,9 @@ public class RepositoryTaskJob | |||
JobDataMap dataMap = context.getJobDetail().getJobDataMap(); | |||
setJobDataMap( dataMap ); | |||
TaskQueue taskQueue = (TaskQueue) dataMap.get( RepositoryArchivaTaskScheduler.TASK_QUEUE ); | |||
TaskQueue taskQueue = (TaskQueue) dataMap.get( DefaultRepositoryArchivaTaskScheduler.TASK_QUEUE ); | |||
String repositoryId = (String) dataMap.get( RepositoryArchivaTaskScheduler.TASK_REPOSITORY ); | |||
String repositoryId = (String) dataMap.get( DefaultRepositoryArchivaTaskScheduler.TASK_REPOSITORY ); | |||
RepositoryTask task = new RepositoryTask(); | |||
task.setRepositoryId( repositoryId ); | |||
@@ -31,6 +31,7 @@ | |||
<modules> | |||
<module>archiva-scheduler-api</module> | |||
<module>archiva-scheduler-indexing</module> | |||
<module>archiva-scheduler-repository-api</module> | |||
<module>archiva-scheduler-repository</module> | |||
</modules> | |||
</project> |
@@ -38,7 +38,7 @@ import org.apache.archiva.repository.RepositoryContentFactory; | |||
import org.apache.archiva.repository.RepositoryException; | |||
import org.apache.archiva.rest.api.services.ArchivaRestServiceException; | |||
import org.apache.archiva.rest.services.utils.ArtifactBuilder; | |||
import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler; | |||
import org.apache.archiva.scheduler.repository.DefaultRepositoryArchivaTaskScheduler; | |||
import org.apache.archiva.scheduler.repository.RepositoryTask; | |||
import org.apache.archiva.security.AccessDeniedException; | |||
import org.apache.archiva.security.ArchivaSecurityException; | |||
@@ -93,7 +93,7 @@ public abstract class AbstractRestService | |||
@Inject | |||
@Named ( value = "archivaTaskScheduler#repository" ) | |||
protected RepositoryArchivaTaskScheduler repositoryTaskScheduler; | |||
protected DefaultRepositoryArchivaTaskScheduler repositoryTaskScheduler; | |||
@Context | |||
protected HttpServletRequest httpServletRequest; |
@@ -23,7 +23,7 @@ import org.apache.archiva.common.ArchivaException; | |||
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; | |||
import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException; | |||
import org.apache.archiva.redback.components.scheduler.DefaultScheduler; | |||
import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler; | |||
import org.apache.archiva.scheduler.repository.DefaultRepositoryArchivaTaskScheduler; | |||
import org.apache.maven.index.NexusIndexer; | |||
import org.apache.maven.index.context.IndexingContext; | |||
import org.apache.archiva.redback.components.taskqueue.Task; | |||
@@ -52,7 +52,7 @@ public class ArchivaStartup | |||
private ThreadedTaskQueueExecutor tqeIndexing; | |||
private RepositoryArchivaTaskScheduler repositoryTaskScheduler; | |||
private DefaultRepositoryArchivaTaskScheduler repositoryTaskScheduler; | |||
private PlexusSisuBridge plexusSisuBridge; | |||
@@ -66,7 +66,7 @@ public class ArchivaStartup | |||
SecuritySynchronization securitySync = wac.getBean( SecuritySynchronization.class ); | |||
repositoryTaskScheduler = | |||
wac.getBean( "archivaTaskScheduler#repository", RepositoryArchivaTaskScheduler.class ); | |||
wac.getBean( "archivaTaskScheduler#repository", DefaultRepositoryArchivaTaskScheduler.class ); | |||
Properties archivaRuntimeProperties = wac.getBean( "archivaRuntimeProperties", Properties.class ); | |||
@@ -31,4 +31,11 @@ | |||
<context:component-scan base-package="org.apache.archiva.dependency.tree.maven2,org.apache.archiva.metadata.repository.storage.maven2, | |||
org.apache.archiva.repository.content.maven2,org.apache.archiva.repository.content.legacy"/> | |||
<bean name="pathParser#legacy" class="org.apache.archiva.repository.content.LegacyPathParser"> | |||
<constructor-arg> | |||
<ref bean="archivaConfiguration#default"/> | |||
</constructor-arg> | |||
</bean> | |||
</beans> |
@@ -370,6 +370,11 @@ | |||
<artifactId>archiva-scheduler-api</artifactId> | |||
<version>${project.version}</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.archiva</groupId> | |||
<artifactId>archiva-scheduler-repository-api</artifactId> | |||
<version>${project.version}</version> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.archiva</groupId> | |||
<artifactId>archiva-scheduler-repository</artifactId> |