diff options
author | Olivier Lamy <olamy@apache.org> | 2012-10-29 20:58:54 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2012-10-29 20:58:54 +0000 |
commit | 9074bfb0f42034b5f1248d9d022594e4f4556599 (patch) | |
tree | ae8a859156afbcccdd6f161eb68ff1e0fe9927e0 | |
parent | dcc622b870ff561b5d08cab70eee4810ec9ef175 (diff) | |
download | archiva-9074bfb0f42034b5f1248d9d022594e4f4556599.tar.gz archiva-9074bfb0f42034b5f1248d9d022594e4f4556599.zip |
[MRM-1704] Refactor to remove maven specific part from various repository/metadata apis
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1403504 13f79535-47bb-0310-9956-ffa450edef68
12 files changed, 42 insertions, 172 deletions
diff --git a/archiva-modules/archiva-base/archiva-proxy/pom.xml b/archiva-modules/archiva-base/archiva-proxy/pom.xml index 16a9948a5..56714b70c 100644 --- a/archiva-modules/archiva-base/archiva-proxy/pom.xml +++ b/archiva-modules/archiva-base/archiva-proxy/pom.xml @@ -39,10 +39,6 @@ </dependency> <dependency> <groupId>org.apache.archiva</groupId> - <artifactId>archiva-scheduler-repository</artifactId> - </dependency> - <dependency> - <groupId>org.apache.archiva</groupId> <artifactId>archiva-repository-layer</artifactId> <exclusions> <exclusion> @@ -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> diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml index 4088371a5..2d72d1a14 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml @@ -37,9 +37,9 @@ <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> @@ -47,6 +47,10 @@ </dependency> <dependency> <groupId>org.apache.archiva</groupId> + <artifactId>repository-statistics</artifactId> + </dependency> + <dependency> + <groupId>org.apache.archiva</groupId> <artifactId>archiva-plexus-bridge</artifactId> </dependency> <dependency> @@ -58,6 +62,10 @@ <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> <exclusions> diff --git a/archiva-modules/archiva-base/archiva-repository-layer/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-repository-layer/src/main/resources/META-INF/spring-context.xml index c49f9edb4..ec802252d 100644 --- a/archiva-modules/archiva-base/archiva-repository-layer/src/main/resources/META-INF/spring-context.xml +++ b/archiva-modules/archiva-base/archiva-repository-layer/src/main/resources/META-INF/spring-context.xml @@ -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>
\ No newline at end of file diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/pom.xml b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/pom.xml index fb3b73664..5bb2b77ef 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/pom.xml +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/pom.xml @@ -33,6 +33,11 @@ <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> </dependency> diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryArchivaTaskScheduler.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/DefaultRepositoryArchivaTaskScheduler.java index 65894ac78..90a28a3fa 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryArchivaTaskScheduler.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/DefaultRepositoryArchivaTaskScheduler.java @@ -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 ) { diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryTask.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryTask.java deleted file mode 100644 index b023cdd2f..000000000 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryTask.java +++ /dev/null @@ -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; - } -} diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryTaskJob.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryTaskJob.java index eea487d72..6789459b9 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryTaskJob.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryTaskJob.java @@ -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 ); diff --git a/archiva-modules/archiva-scheduler/pom.xml b/archiva-modules/archiva-scheduler/pom.xml index 4e215012a..df0fe7289 100644 --- a/archiva-modules/archiva-scheduler/pom.xml +++ b/archiva-modules/archiva-scheduler/pom.xml @@ -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> diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java index 9a7ce13e2..7d5273618 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java @@ -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; diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/ArchivaStartup.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/ArchivaStartup.java index f35e7b768..3d4a444ee 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/ArchivaStartup.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/startup/ArchivaStartup.java @@ -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 ); diff --git a/archiva-modules/plugins/maven2-repository/src/main/resources/META-INF/spring-context.xml b/archiva-modules/plugins/maven2-repository/src/main/resources/META-INF/spring-context.xml index 1eb4daf9d..47125c353 100644 --- a/archiva-modules/plugins/maven2-repository/src/main/resources/META-INF/spring-context.xml +++ b/archiva-modules/plugins/maven2-repository/src/main/resources/META-INF/spring-context.xml @@ -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>
\ No newline at end of file @@ -372,6 +372,11 @@ </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> <version>${project.version}</version> </dependency> |