diff options
author | Olivier Lamy <olamy@apache.org> | 2011-09-13 12:12:39 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2011-09-13 12:12:39 +0000 |
commit | 919a5ac3eb725dc676e81fcbf868f3cc165598a4 (patch) | |
tree | 9aecd4829e214ecbb256dbd0ec5f13f428016ab3 /archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src | |
parent | 5c067f2a4deaa775213a3b5c2ca44ce62f4ba914 (diff) | |
download | archiva-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-base/archiva-consumers/archiva-lucene-consumers/src')
2 files changed, 11 insertions, 11 deletions
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java index 3e87693e9..3fdf86d9d 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java @@ -19,6 +19,7 @@ package org.apache.archiva.consumers.lucene; * 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; @@ -27,7 +28,6 @@ import org.apache.archiva.scheduler.indexing.ArtifactIndexingTask; import org.apache.maven.archiva.configuration.ArchivaConfiguration; import org.apache.maven.archiva.configuration.ConfigurationNames; import org.apache.maven.archiva.configuration.FileTypes; -import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer; import org.apache.maven.archiva.consumers.ConsumerException; import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer; @@ -35,14 +35,13 @@ import org.apache.maven.index.NexusIndexer; import org.apache.maven.index.context.IndexCreator; import org.apache.maven.index.context.IndexingContext; import org.apache.maven.index.context.UnsupportedExistingLuceneIndexException; -import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable; -import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException; import org.codehaus.plexus.registry.Registry; import org.codehaus.plexus.registry.RegistryListener; import org.codehaus.plexus.taskqueue.TaskQueueException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.PostConstruct; import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -55,7 +54,7 @@ import java.util.List; */ public class NexusIndexerConsumer extends AbstractMonitoredConsumer - implements KnownRepositoryContentConsumer, RegistryListener, Initializable + implements KnownRepositoryContentConsumer, RegistryListener { private Logger log = LoggerFactory.getLogger( NexusIndexerConsumer.class ); @@ -73,7 +72,7 @@ public class NexusIndexerConsumer private List<String> includes = new ArrayList<String>(); - private ManagedRepositoryConfiguration repository; + private ManagedRepository repository; private List<? extends IndexCreator> allIndexCreators; @@ -104,7 +103,7 @@ public class NexusIndexerConsumer return false; } - public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered ) + public void beginScan( ManagedRepository repository, Date whenGathered ) throws ConsumerException { this.repository = repository; @@ -125,7 +124,7 @@ public class NexusIndexerConsumer } } - public void beginScan( ManagedRepositoryConfiguration repository, Date whenGathered, boolean executeOnEntireRepo ) + public void beginScan( ManagedRepository repository, Date whenGathered, boolean executeOnEntireRepo ) throws ConsumerException { if ( executeOnEntireRepo ) @@ -238,8 +237,8 @@ public class NexusIndexerConsumer includes.addAll( filetypes.getFileTypePatterns( FileTypes.ARTIFACTS ) ); } + @PostConstruct public void initialize() - throws InitializationException { configuration.addChangeListener( this ); diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java index 53a8fc6bf..f9d8c8fb5 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumerTest.java @@ -20,6 +20,7 @@ package org.apache.archiva.consumers.lucene; */ 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.archiva.scheduler.ArchivaTaskScheduler; @@ -88,7 +89,7 @@ public class NexusIndexerConsumerTest private KnownRepositoryContentConsumer nexusIndexerConsumer; - private ManagedRepositoryConfiguration repositoryConfig; + private ManagedRepository repositoryConfig; private ArchivaTaskSchedulerStub scheduler; @@ -119,9 +120,9 @@ public class NexusIndexerConsumerTest new NexusIndexerConsumer( scheduler, configuration, filetypes, plexusSisuBridge, mavenIndexerUtils ); // initialize to set the file types to be processed - ( (Initializable) nexusIndexerConsumer ).initialize(); + ( (NexusIndexerConsumer) nexusIndexerConsumer ).initialize(); - repositoryConfig = new ManagedRepositoryConfiguration(); + repositoryConfig = new ManagedRepository(); repositoryConfig.setId( "test-repo" ); repositoryConfig.setLocation( "target/test-classes/test-repo" ); repositoryConfig.setLayout( "default" ); |