]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1025] consolidate more database uses into the database module
authorBrett Porter <brett@apache.org>
Fri, 28 Nov 2008 15:15:57 +0000 (15:15 +0000)
committerBrett Porter <brett@apache.org>
Fri, 28 Nov 2008 15:15:57 +0000 (15:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@721514 13f79535-47bb-0310-9956-ffa450edef68

32 files changed:
archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/ArchivaArtifactConsumer.java [deleted file]
archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/DatabaseCleanupConsumer.java [deleted file]
archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/DatabaseUnprocessedArtifactConsumer.java [deleted file]
archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/BytecodeStatsToDatabaseConsumer.java
archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveArtifactConsumer.java
archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveProjectConsumer.java
archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ProjectModelToDatabaseConsumer.java
archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/VerifyMetadataAgainstDatabaseConsumer.java
archiva-modules/archiva-base/archiva-consumers/archiva-database-consumers/src/test/java/org/apache/maven/archiva/consumers/database/ProjectModelToDatabaseConsumerTest.java
archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml
archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexArchiveTableOfContentsConsumer.java [deleted file]
archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexArtifactConsumer.java
archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexJavaPublicMethodsConsumer.java
archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/LuceneCleanupRemoveIndexedConsumer.java
archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/maven/archiva/consumers/lucene/IndexJavaPublicMethodsConsumerTest.java
archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/java/org/apache/maven/archiva/consumers/lucene/LuceneCleanupRemoveIndexedConsumerTest.java
archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/ArchivaArtifactConsumer.java [new file with mode: 0644]
archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/DatabaseCleanupConsumer.java [new file with mode: 0644]
archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/DatabaseConsumers.java
archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/DatabaseUnprocessedArtifactConsumer.java [new file with mode: 0644]
archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/JdoDatabaseUpdater.java
archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/ProcessArchivaArtifactClosure.java
archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/AbstractArchivaDatabaseTestCase.java
archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/updater/TestDatabaseCleanupConsumer.java
archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/updater/TestDatabaseUnprocessedConsumer.java
archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/DuplicateArtifactsConsumer.java
archiva-modules/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/LocationArtifactsConsumer.java
archiva-modules/archiva-reporting/archiva-artifact-reports/src/test/java/org/apache/maven/archiva/reporting/artifact/DuplicateArtifactReportTest.java
archiva-modules/archiva-reporting/archiva-project-reports/src/main/java/org/apache/maven/archiva/reporting/project/ProjectDependenciesConsumer.java
archiva-modules/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/TestDatabaseCleanupConsumer.java
archiva-modules/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/TestDatabaseUnprocessedConsumer.java
archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/database/AddAdminDatabaseConsumerClosure.java

diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/ArchivaArtifactConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/ArchivaArtifactConsumer.java
deleted file mode 100644 (file)
index 7c10664..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-package org.apache.maven.archiva.consumers;
-
-/*
- * 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.
- */
-
-import org.apache.maven.archiva.model.ArchivaArtifact;
-
-import java.util.List;
-
-/**
- * ArchivaArtifactConsumer - consumer for ArchivaArtifact objects. 
- *
- * @version $Id$
- */
-public interface ArchivaArtifactConsumer extends Consumer
-{
-    /**
-     * Get the list of included file patterns for this consumer.
-     * 
-     * @return the list of ({@link String}) artifact types to process.
-     */
-    public List<String> getIncludedTypes();
-
-    /**
-     * <p>
-     * Event that triggers at the beginning of a scan.
-     * </p>
-     * 
-     * <p>
-     * NOTE: This would be a good place to initialize the consumer, to lock any resources, and to
-     * generally start tracking the scan as a whole.
-     * </p>
-     */
-    public void beginScan();
-
-    /**
-     * <p>
-     * Event indicating an {@link ArchivaArtifact} is to be processed by this consumer.
-     * </p> 
-     * 
-     * <p>
-     * NOTE: The consumer does not need to process the artifact immediately, can can opt to queue and/or track
-     * the artifact to be processed in batch.  Just be sure to complete the processing by the {@link #completeScan()} 
-     * event. 
-     * </p>
-     * 
-     * @param file the file to process.
-     * @throws ConsumerException if there was a problem processing this file.
-     */
-    public void processArchivaArtifact( ArchivaArtifact artifact ) throws ConsumerException;
-
-    /**
-     * <p>
-     * Event that triggers on the completion of a scan.
-     * </p>
-     * 
-     * <p>
-     * NOTE: If the consumer opted to batch up processing requests in the 
-     * {@link #processArchivaArtifact(ArchivaArtifact)} event this would be the last opportunity to drain 
-     * any processing queue's.
-     * </p>
-     */
-    public void completeScan();
-}
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/DatabaseCleanupConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/DatabaseCleanupConsumer.java
deleted file mode 100644 (file)
index 754f2b8..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.apache.maven.archiva.consumers;
-
-/*
- * 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.
- */
-
-/**
- * DatabaseCleanupConsumer 
- *
- * @version $Id$
- */
-public interface DatabaseCleanupConsumer
-    extends ArchivaArtifactConsumer
-{
-
-}
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/DatabaseUnprocessedArtifactConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/DatabaseUnprocessedArtifactConsumer.java
deleted file mode 100644 (file)
index f258d9c..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.apache.maven.archiva.consumers;
-
-/*
- * 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.
- */
-
-/**
- * DatabaseUnprocessedArtifactConsumer 
- *
- * @version $Id$
- */
-public interface DatabaseUnprocessedArtifactConsumer
-    extends ArchivaArtifactConsumer
-{
-
-}
index 7c330967ab6c1ac44818ccfd9d202d3a91b47765..301814ea0f27d6acaf2f6aaee71d03b79d6204e9 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.maven.archiva.consumers.database;
 
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
-import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer;
+import org.apache.maven.archiva.database.updater.DatabaseUnprocessedArtifactConsumer;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 
 import java.util.List;
index 7d1f0b4e2be20c803dcd74adf7abc0e9de928d18..49ca811c22ae08d291af2595a56cfcfb1294f2f5 100644 (file)
@@ -21,10 +21,10 @@ package org.apache.maven.archiva.consumers.database;
 
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
-import org.apache.maven.archiva.consumers.DatabaseCleanupConsumer;
 import org.apache.maven.archiva.database.Constraint;
 import org.apache.maven.archiva.database.RepositoryProblemDAO;
 import org.apache.maven.archiva.database.constraints.RepositoryProblemByArtifactConstraint;
+import org.apache.maven.archiva.database.updater.DatabaseCleanupConsumer;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 import org.apache.maven.archiva.database.ArtifactDAO;
 import org.apache.maven.archiva.database.ArchivaDatabaseException;
index 51da72c73b6befaac7c9af6a8ec884179e1dae16..fa3aad2c6320234e14cf6ae58aee7f0dc0355630 100644 (file)
@@ -22,7 +22,6 @@ package org.apache.maven.archiva.consumers.database;
 import org.apache.commons.lang.StringUtils;
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
-import org.apache.maven.archiva.consumers.DatabaseCleanupConsumer;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 import org.apache.maven.archiva.model.ArchivaProjectModel;
 import org.apache.maven.archiva.repository.ManagedRepositoryContent;
@@ -30,6 +29,7 @@ import org.apache.maven.archiva.repository.RepositoryContentFactory;
 import org.apache.maven.archiva.repository.RepositoryException;
 import org.apache.maven.archiva.database.ProjectModelDAO;
 import org.apache.maven.archiva.database.ArchivaDatabaseException;
+import org.apache.maven.archiva.database.updater.DatabaseCleanupConsumer;
 import org.codehaus.plexus.cache.Cache;
 
 import java.util.List;
index bccda607db31c027c622a4dad24a5a4968d29dcc..58edd1c775efaf13f9ffcfe4771b7fe932f17f42 100644 (file)
@@ -27,10 +27,10 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.maven.archiva.common.utils.VersionUtil;
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
-import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer;
 import org.apache.maven.archiva.database.ArchivaDAO;
 import org.apache.maven.archiva.database.ArchivaDatabaseException;
 import org.apache.maven.archiva.database.ObjectNotFoundException;
+import org.apache.maven.archiva.database.updater.DatabaseUnprocessedArtifactConsumer;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 import org.apache.maven.archiva.model.ArchivaModelCloner;
 import org.apache.maven.archiva.model.ArchivaProjectModel;
index c3d18e4bdd0a8127e3a8d3b3648853d7db146866..b1bf0844483250101ed2154c6c13870047649ef7 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.maven.archiva.consumers.database;
 
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
-import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer;
+import org.apache.maven.archiva.database.updater.DatabaseUnprocessedArtifactConsumer;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 
 import java.util.List;
index 8910798984fed7257e3cbf4a93cacf6f145fb98e..61bbb48feefada37e69eecf60915e13e06371ec9 100644 (file)
@@ -26,10 +26,10 @@ import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.Configuration;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.ConsumerException;
-import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer;
 import org.apache.maven.archiva.database.ArchivaDatabaseException;
 import org.apache.maven.archiva.database.ObjectNotFoundException;
 import org.apache.maven.archiva.database.ProjectModelDAO;
+import org.apache.maven.archiva.database.updater.DatabaseUnprocessedArtifactConsumer;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 import org.apache.maven.archiva.model.ArchivaArtifactModel;
 import org.apache.maven.archiva.model.ArchivaProjectModel;
index 56e38b751baee8e07eb08506248037af31f0e448..cc346c21842f4a8b673c344b9109f25e238fcbfa 100644 (file)
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-indexer</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-database</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-configuration</artifactId>
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexArchiveTableOfContentsConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexArchiveTableOfContentsConsumer.java
deleted file mode 100644 (file)
index 7fbf3a3..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-package org.apache.maven.archiva.consumers.lucene;
-
-/*
- * 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.
- */
-
-import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
-import org.apache.maven.archiva.consumers.ConsumerException;
-import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer;
-import org.apache.maven.archiva.model.ArchivaArtifact;
-
-import java.util.List;
-
-/**
- * IndexArchiveTableOfContentsConsumer 
- *
- * @version $Id$
- * 
- * @plexus.component role="org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer"
- *                   role-hint="index-archive-toc"
- *                   instantiation-strategy="per-lookup"
- */
-public class IndexArchiveTableOfContentsConsumer
-    extends AbstractMonitoredConsumer
-    implements DatabaseUnprocessedArtifactConsumer
-{
-    /**
-     * @plexus.configuration default-value="index-archive-toc"
-     */
-    private String id;
-
-    /**
-     * @plexus.configuration default-value="Index the archive table of contents for Full Text Search."
-     */
-    private String description;
-
-    public void beginScan()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void completeScan()
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public List<String> getIncludedTypes()
-    {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public void processArchivaArtifact( ArchivaArtifact artifact )
-        throws ConsumerException
-    {
-        // TODO Auto-generated method stub
-
-    }
-
-    public String getDescription()
-    {
-        return description;
-    }
-
-    public String getId()
-    {
-        return id;
-    }
-
-    public boolean isPermanent()
-    {
-        return false;
-    }
-
-}
index b5a6c47042de96b86b7b15b97382602c1567e540..36db421c2e9b466ed5673d4664d6d5c01666db26 100644 (file)
@@ -30,7 +30,7 @@ import org.apache.maven.archiva.configuration.ConfigurationNames;
 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.DatabaseUnprocessedArtifactConsumer;
+import org.apache.maven.archiva.database.updater.DatabaseUnprocessedArtifactConsumer;
 import org.apache.maven.archiva.indexer.RepositoryContentIndex;
 import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory;
 import org.apache.maven.archiva.indexer.RepositoryIndexException;
index 3966de0358e7c9b42bb0eb3d2c1ff17ed23013e8..3b7d31a188db592fd26eb5492f2f056831153526 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.maven.archiva.consumers.lucene;
 
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
-import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer;
+import org.apache.maven.archiva.database.updater.DatabaseUnprocessedArtifactConsumer;
 import org.apache.maven.archiva.indexer.RepositoryContentIndex;
 import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory;
 import org.apache.maven.archiva.indexer.RepositoryIndexException;
index da1392fae1017da0269b8785603bbb1cfc8a89a8..5b7a00f90143c90f074e2cf47667467c9739cef5 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.maven.archiva.consumers.lucene;
 
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
-import org.apache.maven.archiva.consumers.DatabaseCleanupConsumer;
+import org.apache.maven.archiva.database.updater.DatabaseCleanupConsumer;
 import org.apache.maven.archiva.indexer.RepositoryContentIndex;
 import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory;
 import org.apache.maven.archiva.indexer.RepositoryIndexException;
index efb3ae0a2d6448f233ea2b472ecbe88c76d4ec6e..90e8bf1ca2d570939c70f28b541d86fd5111b2a8 100644 (file)
@@ -25,7 +25,7 @@ import java.util.List;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.Configuration;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer;
+import org.apache.maven.archiva.database.updater.DatabaseUnprocessedArtifactConsumer;
 import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory;
 import org.apache.maven.archiva.indexer.search.SearchResultLimits;
 import org.apache.maven.archiva.indexer.search.SearchResults;
index 9906de83cd5de976588fe6d15375189a9ecee713..325c725713018a3fc60c6f06f371620b2409a05b 100644 (file)
@@ -19,7 +19,7 @@ package org.apache.maven.archiva.consumers.lucene;
  * under the License.
  */
 
-import org.apache.maven.archiva.consumers.DatabaseCleanupConsumer;
+import org.apache.maven.archiva.database.updater.DatabaseCleanupConsumer;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 import org.apache.maven.archiva.model.ArchivaArtifactModel;
 import org.codehaus.plexus.spring.PlexusInSpringTestCase;
diff --git a/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/ArchivaArtifactConsumer.java b/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/ArchivaArtifactConsumer.java
new file mode 100644 (file)
index 0000000..1dffed7
--- /dev/null
@@ -0,0 +1,82 @@
+package org.apache.maven.archiva.database.updater;
+
+/*
+ * 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.
+ */
+
+import org.apache.maven.archiva.consumers.Consumer;
+import org.apache.maven.archiva.consumers.ConsumerException;
+import org.apache.maven.archiva.model.ArchivaArtifact;
+
+import java.util.List;
+
+/**
+ * ArchivaArtifactConsumer - consumer for ArchivaArtifact objects. 
+ *
+ * @version $Id$
+ */
+public interface ArchivaArtifactConsumer extends Consumer
+{
+    /**
+     * Get the list of included file patterns for this consumer.
+     * 
+     * @return the list of ({@link String}) artifact types to process.
+     */
+    public List<String> getIncludedTypes();
+
+    /**
+     * <p>
+     * Event that triggers at the beginning of a scan.
+     * </p>
+     * 
+     * <p>
+     * NOTE: This would be a good place to initialize the consumer, to lock any resources, and to
+     * generally start tracking the scan as a whole.
+     * </p>
+     */
+    public void beginScan();
+
+    /**
+     * <p>
+     * Event indicating an {@link ArchivaArtifact} is to be processed by this consumer.
+     * </p> 
+     * 
+     * <p>
+     * NOTE: The consumer does not need to process the artifact immediately, can can opt to queue and/or track
+     * the artifact to be processed in batch.  Just be sure to complete the processing by the {@link #completeScan()} 
+     * event. 
+     * </p>
+     * 
+     * @param file the file to process.
+     * @throws ConsumerException if there was a problem processing this file.
+     */
+    public void processArchivaArtifact( ArchivaArtifact artifact ) throws ConsumerException;
+
+    /**
+     * <p>
+     * Event that triggers on the completion of a scan.
+     * </p>
+     * 
+     * <p>
+     * NOTE: If the consumer opted to batch up processing requests in the 
+     * {@link #processArchivaArtifact(ArchivaArtifact)} event this would be the last opportunity to drain 
+     * any processing queue's.
+     * </p>
+     */
+    public void completeScan();
+}
diff --git a/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/DatabaseCleanupConsumer.java b/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/DatabaseCleanupConsumer.java
new file mode 100644 (file)
index 0000000..ac301b8
--- /dev/null
@@ -0,0 +1,31 @@
+package org.apache.maven.archiva.database.updater;
+
+/*
+ * 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.
+ */
+
+/**
+ * DatabaseCleanupConsumer 
+ *
+ * @version $Id$
+ */
+public interface DatabaseCleanupConsumer
+    extends ArchivaArtifactConsumer
+{
+
+}
index c68c53df23416f768a064b2a5d799d0e248c53dd..af5c647de3a82a11e5189f432bb4eddd3a25ef2e 100644 (file)
@@ -24,8 +24,6 @@ import org.apache.commons.collections.Predicate;
 import org.apache.commons.collections.functors.OrPredicate;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.DatabaseScanningConfiguration;
-import org.apache.maven.archiva.consumers.DatabaseCleanupConsumer;
-import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer;
 import org.apache.maven.archiva.consumers.functors.PermanentConsumerPredicate;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
diff --git a/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/DatabaseUnprocessedArtifactConsumer.java b/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/updater/DatabaseUnprocessedArtifactConsumer.java
new file mode 100644 (file)
index 0000000..a3cde7e
--- /dev/null
@@ -0,0 +1,31 @@
+package org.apache.maven.archiva.database.updater;
+
+/*
+ * 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.
+ */
+
+/**
+ * DatabaseUnprocessedArtifactConsumer 
+ *
+ * @version $Id$
+ */
+public interface DatabaseUnprocessedArtifactConsumer
+    extends ArchivaArtifactConsumer
+{
+
+}
index f4ccae8560ca9d68316d1c9cb421e5390f16b8e6..41bd5bf52231e6e1da55498d7de1c97963806d32 100644 (file)
@@ -27,7 +27,6 @@ import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.IteratorUtils;
 import org.apache.commons.collections.Predicate;
 import org.apache.commons.collections.functors.NotPredicate;
-import org.apache.maven.archiva.consumers.ArchivaArtifactConsumer;
 import org.apache.maven.archiva.database.ArchivaDAO;
 import org.apache.maven.archiva.database.ArchivaDatabaseException;
 import org.apache.maven.archiva.database.constraints.ArtifactsProcessedConstraint;
index 5b46bf64f79c3e85557d2e4f3383c12979a6d711..eee178b8f14026d8137e4c320140db9e8739132a 100644 (file)
@@ -20,7 +20,6 @@ package org.apache.maven.archiva.database.updater;
  */
 
 import org.apache.commons.collections.Closure;
-import org.apache.maven.archiva.consumers.ArchivaArtifactConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 import org.slf4j.Logger;
index ab6678f5bcc601ee03faf9cb50378a58b2b77540..94bca9624591b96498e0b8cc1a567e90109dc783 100644 (file)
@@ -20,8 +20,8 @@ package org.apache.maven.archiva.database;
  */
 
 import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.consumers.DatabaseCleanupConsumer;
-import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer;
+import org.apache.maven.archiva.database.updater.DatabaseCleanupConsumer;
+import org.apache.maven.archiva.database.updater.DatabaseUnprocessedArtifactConsumer;
 import org.apache.maven.archiva.database.updater.TestDatabaseCleanupConsumer;
 import org.apache.maven.archiva.database.updater.TestDatabaseUnprocessedConsumer;
 import org.apache.maven.archiva.model.ArtifactReference;
index 6de10fc50bf0790cb766577e2142d859616738d4..12cc9b6bde58bbf5d9b3133d7ae5786edca74438 100644 (file)
@@ -21,7 +21,6 @@ package org.apache.maven.archiva.database.updater;
 
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
-import org.apache.maven.archiva.consumers.DatabaseCleanupConsumer;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 
 import java.util.List;
index be9a9f19b9ba4d333a6483a3c003d5e40543b9ad..d059a4a659edab033c429ab9e890458a3d1ef9bf 100644 (file)
@@ -24,7 +24,6 @@ import java.util.List;
 
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
-import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index 7d37b76be1c2114b6a17f09afc18b0c904c874b1..3691acf5a7b9e8aa35ce303fba14d2ce26761959 100644 (file)
@@ -27,12 +27,12 @@ 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.consumers.AbstractMonitoredConsumer;
-import org.apache.maven.archiva.consumers.ArchivaArtifactConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
 import org.apache.maven.archiva.database.ArchivaDAO;
 import org.apache.maven.archiva.database.ArchivaDatabaseException;
 import org.apache.maven.archiva.database.ObjectNotFoundException;
 import org.apache.maven.archiva.database.constraints.ArtifactsByChecksumConstraint;
+import org.apache.maven.archiva.database.updater.ArchivaArtifactConsumer;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 import org.apache.maven.archiva.model.RepositoryProblem;
 import org.apache.maven.archiva.repository.ManagedRepositoryContent;
index 4b0003f528b5837ad575044eafec3a513cdf2be3..65143de69a3d2fd4121b2944164c1ae1d0c2131a 100644 (file)
@@ -35,10 +35,10 @@ 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.ArchivaArtifactConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
 import org.apache.maven.archiva.database.ArchivaDAO;
 import org.apache.maven.archiva.database.ArchivaDatabaseException;
+import org.apache.maven.archiva.database.updater.ArchivaArtifactConsumer;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 import org.apache.maven.archiva.model.ArchivaProjectModel;
 import org.apache.maven.archiva.model.RepositoryProblem;
index 795447befbb53037f0816a18dd674462aa751e40..1481fa8dbf9446f139622717bbfd27d34203f408 100644 (file)
@@ -22,8 +22,8 @@ package org.apache.maven.archiva.reporting.artifact;
 import org.apache.commons.io.FileUtils;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.maven.archiva.consumers.ArchivaArtifactConsumer;
 import org.apache.maven.archiva.database.ArtifactDAO;
+import org.apache.maven.archiva.database.updater.ArchivaArtifactConsumer;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 import org.apache.maven.archiva.model.RepositoryProblem;
 import org.apache.maven.archiva.reporting.DynamicReportSource;
index b0ede59763de41adb75ab45a8d174511c8d5ce0d..cf7212f53ad467cdffeeb9dcbf03bb736bd34b0b 100644 (file)
@@ -20,8 +20,8 @@ package org.apache.maven.archiva.reporting.project;
  */
 
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
-import org.apache.maven.archiva.consumers.ArchivaArtifactConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
+import org.apache.maven.archiva.database.updater.ArchivaArtifactConsumer;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 
 import java.util.ArrayList;
index 0a30581ddad46281a734c0baaf57ab24238e352c..3b7781a8c6b8314bcf80d6094653444ce1220f4a 100644 (file)
@@ -21,7 +21,7 @@ package org.apache.maven.archiva.scheduled;
 
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
-import org.apache.maven.archiva.consumers.DatabaseCleanupConsumer;
+import org.apache.maven.archiva.database.updater.DatabaseCleanupConsumer;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 
 import java.util.List;
index 0cd7b77b77997535f980846a1e450c0edbf950cc..6e4a6c8d834244cf0282b889f7571f62165e7bcf 100644 (file)
@@ -24,7 +24,7 @@ import java.util.List;
 
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
-import org.apache.maven.archiva.consumers.DatabaseUnprocessedArtifactConsumer;
+import org.apache.maven.archiva.database.updater.DatabaseUnprocessedArtifactConsumer;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index 918fc70fcb55a8dbab16176400175870964c96cb..64b5677329d341ac3cd977745626ab7b5c14cd4f 100644 (file)
@@ -20,7 +20,7 @@ package org.apache.maven.archiva.web.action.admin.database;
  */
 
 import org.apache.commons.collections.Closure;
-import org.apache.maven.archiva.consumers.ArchivaArtifactConsumer;
+import org.apache.maven.archiva.database.updater.ArchivaArtifactConsumer;
 
 import java.util.ArrayList;
 import java.util.List;