summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-scheduler/archiva-scheduler-indexing
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2011-09-13 12:12:39 +0000
committerOlivier Lamy <olamy@apache.org>2011-09-13 12:12:39 +0000
commit919a5ac3eb725dc676e81fcbf868f3cc165598a4 (patch)
tree9aecd4829e214ecbb256dbd0ec5f13f428016ab3 /archiva-modules/archiva-scheduler/archiva-scheduler-indexing
parent5c067f2a4deaa775213a3b5c2ca44ce62f4ba914 (diff)
downloadarchiva-919a5ac3eb725dc676e81fcbf868f3cc165598a4.tar.gz
archiva-919a5ac3eb725dc676e81fcbf868f3cc165598a4.zip
[MRM-1504] Add a new module for repository administration management
split the repo admin in two modules : api and default implementation (to be able to more easily change the impl). Use the repo admin api consumers and indexing modules. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1170135 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-scheduler/archiva-scheduler-indexing')
-rw-r--r--archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml4
-rw-r--r--archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java5
-rw-r--r--archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArtifactIndexingTask.java18
-rw-r--r--archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java10
4 files changed, 19 insertions, 18 deletions
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml
index 1f36de795..6bd9b7804 100644
--- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml
+++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml
@@ -34,6 +34,10 @@
</dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-repository-admin-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
<artifactId>archiva-configuration</artifactId>
</dependency>
<dependency>
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java
index 527fa8bce..2477c7898 100644
--- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java
+++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutor.java
@@ -20,6 +20,7 @@ package org.apache.archiva.scheduler.indexing;
* under the License.
*/
+import org.apache.archiva.admin.model.managed.ManagedRepository;
import org.apache.archiva.common.plexusbridge.MavenIndexerUtils;
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
import org.apache.archiva.common.plexusbridge.PlexusSisuBridgeException;
@@ -104,7 +105,7 @@ public class ArchivaIndexingTaskExecutor
{
ArtifactIndexingTask indexingTask = (ArtifactIndexingTask) task;
- ManagedRepositoryConfiguration repository = indexingTask.getRepository();
+ ManagedRepository repository = indexingTask.getRepository();
IndexingContext context = indexingTask.getContext();
if ( ArtifactIndexingTask.Action.FINISH.equals( indexingTask.getAction() )
@@ -231,7 +232,7 @@ public class ArchivaIndexingTaskExecutor
}
}
- private void finishIndexingTask( ArtifactIndexingTask indexingTask, ManagedRepositoryConfiguration repository,
+ private void finishIndexingTask( ArtifactIndexingTask indexingTask, ManagedRepository repository,
IndexingContext context )
throws TaskExecutionException
{
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArtifactIndexingTask.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArtifactIndexingTask.java
index 8302f89a7..c39650af6 100644
--- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArtifactIndexingTask.java
+++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/ArtifactIndexingTask.java
@@ -19,7 +19,7 @@ package org.apache.archiva.scheduler.indexing;
* under the License.
*/
-import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.archiva.admin.model.managed.ManagedRepository;
import org.apache.maven.index.NexusIndexer;
import org.apache.maven.index.context.IndexCreator;
import org.apache.maven.index.context.IndexingContext;
@@ -41,7 +41,7 @@ public class ArtifactIndexingTask
FINISH
}
- private final ManagedRepositoryConfiguration repository;
+ private final ManagedRepository repository;
private final File resourceFile;
@@ -56,7 +56,7 @@ public class ArtifactIndexingTask
*/
private boolean onlyUpdate = false;
- public ArtifactIndexingTask( ManagedRepositoryConfiguration repository, File resourceFile, Action action,
+ public ArtifactIndexingTask( ManagedRepository repository, File resourceFile, Action action,
IndexingContext context )
{
this.repository = repository;
@@ -65,14 +65,14 @@ public class ArtifactIndexingTask
this.context = context;
}
- public ArtifactIndexingTask( ManagedRepositoryConfiguration repository, File resourceFile, Action action,
+ public ArtifactIndexingTask( ManagedRepository repository, File resourceFile, Action action,
IndexingContext context, boolean executeOnEntireRepo )
{
this( repository, resourceFile, action, context );
this.executeOnEntireRepo = executeOnEntireRepo;
}
- public ArtifactIndexingTask( ManagedRepositoryConfiguration repository, File resourceFile, Action action,
+ public ArtifactIndexingTask( ManagedRepository repository, File resourceFile, Action action,
IndexingContext context, boolean executeOnEntireRepo, boolean onlyUpdate )
{
this( repository, resourceFile, action, context, executeOnEntireRepo );
@@ -104,7 +104,7 @@ public class ArtifactIndexingTask
return action;
}
- public ManagedRepositoryConfiguration getRepository()
+ public ManagedRepository getRepository()
{
return repository;
}
@@ -190,17 +190,17 @@ public class ArtifactIndexingTask
* @throws IOException
* @throws UnsupportedExistingLuceneIndexException
*/
- public static IndexingContext createContext( ManagedRepositoryConfiguration repository, NexusIndexer indexer,
+ public static IndexingContext createContext( ManagedRepository repository, NexusIndexer indexer,
List<? extends IndexCreator> indexCreators )
throws IOException, UnsupportedExistingLuceneIndexException
{
- String indexDir = repository.getIndexDir();
+ String indexDir = repository.getIndexDirectory();
File managedRepository = new File( repository.getLocation() );
File indexDirectory = null;
if ( indexDir != null && !"".equals( indexDir ) )
{
- indexDirectory = new File( repository.getIndexDir() );
+ indexDirectory = new File( repository.getIndexDirectory() );
}
else
{
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java
index 3b8da8e5d..86e164ab9 100644
--- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java
+++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/ArchivaIndexingTaskExecutorTest.java
@@ -20,6 +20,7 @@ package org.apache.archiva.scheduler.indexing;
*/
import junit.framework.TestCase;
+import org.apache.archiva.admin.model.managed.ManagedRepository;
import org.apache.archiva.common.plexusbridge.MavenIndexerUtils;
import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
import org.apache.commons.io.FileUtils;
@@ -67,9 +68,7 @@ public class ArchivaIndexingTaskExecutorTest
@Inject
private ArchivaIndexingTaskExecutor indexingExecutor;
- private ManagedRepositoryConfiguration repositoryConfig;
-
- private Configuration configuration;
+ private ManagedRepository repositoryConfig;
private NexusIndexer indexer;
@@ -85,7 +84,7 @@ public class ArchivaIndexingTaskExecutorTest
{
super.setUp();
- repositoryConfig = new ManagedRepositoryConfiguration();
+ repositoryConfig = new ManagedRepository();
repositoryConfig.setId( "test-repo" );
repositoryConfig.setLocation( "target/test-classes/test-repo" );
repositoryConfig.setLayout( "default" );
@@ -94,9 +93,6 @@ public class ArchivaIndexingTaskExecutorTest
repositoryConfig.setSnapshots( false );
repositoryConfig.setReleases( true );
- configuration = new Configuration();
- configuration.addManagedRepository( repositoryConfig );
-
indexer = plexusSisuBridge.lookup( NexusIndexer.class );
ArtifactIndexingTask.createContext( repositoryConfig, indexer, mavenIndexerUtils.getAllIndexCreators() );