diff options
author | Brett Porter <brett@apache.org> | 2006-09-10 23:21:19 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2006-09-10 23:21:19 +0000 |
commit | b57273dff3f31895f05d8a669cc15a9db7a92f5b (patch) | |
tree | d03b6325727bd940eeacee3b7f5342ff572b1ef9 /archiva-core | |
parent | 9dd5b3e9880fbbf3ae5bf5072edc61446587206e (diff) | |
download | archiva-b57273dff3f31895f05d8a669cc15a9db7a92f5b.tar.gz archiva-b57273dff3f31895f05d8a669cc15a9db7a92f5b.zip |
[MRM-166] add multiple report groups
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@442028 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-core')
-rw-r--r-- | archiva-core/src/main/java/org/apache/maven/archiva/DefaultRepositoryManager.java | 8 | ||||
-rw-r--r-- | archiva-core/src/main/java/org/apache/maven/archiva/scheduler/task/IndexerTask.java | 12 |
2 files changed, 16 insertions, 4 deletions
diff --git a/archiva-core/src/main/java/org/apache/maven/archiva/DefaultRepositoryManager.java b/archiva-core/src/main/java/org/apache/maven/archiva/DefaultRepositoryManager.java index c37e6b608..eeb4b6895 100644 --- a/archiva-core/src/main/java/org/apache/maven/archiva/DefaultRepositoryManager.java +++ b/archiva-core/src/main/java/org/apache/maven/archiva/DefaultRepositoryManager.java @@ -6,6 +6,7 @@ import org.apache.maven.archiva.discoverer.ArtifactDiscoverer; import org.apache.maven.archiva.discoverer.DiscovererException; import org.apache.maven.archiva.discoverer.filter.AcceptAllArtifactFilter; import org.apache.maven.archiva.discoverer.filter.SnapshotArtifactFilter; +import org.apache.maven.archiva.reporting.ReportGroup; import org.apache.maven.archiva.reporting.ReportingDatabase; import org.apache.maven.archiva.reporting.ReportingStore; import org.apache.maven.archiva.reporting.ReportingStoreException; @@ -55,6 +56,11 @@ public class DefaultRepositoryManager */ private ReportingStore reportingStore; + /** + * @plexus.requirement role-hint="health" + */ + private ReportGroup reportGroup; + public void convertLegacyRepository( File legacyRepositoryDirectory, File repositoryDirectory, boolean includeSnapshots ) throws RepositoryConversionException, DiscovererException @@ -85,7 +91,7 @@ public class DefaultRepositoryManager ReportingDatabase reporter; try { - reporter = reportingStore.getReportsFromStore( repository ); + reporter = reportingStore.getReportsFromStore( repository, reportGroup ); repositoryConverter.convert( legacyArtifacts, repository, reporter ); diff --git a/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/task/IndexerTask.java b/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/task/IndexerTask.java index 454a4dabb..d563b7b28 100644 --- a/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/task/IndexerTask.java +++ b/archiva-core/src/main/java/org/apache/maven/archiva/scheduler/task/IndexerTask.java @@ -32,6 +32,7 @@ import org.apache.maven.archiva.indexer.RepositoryIndexException; import org.apache.maven.archiva.indexer.record.IndexRecordExistsArtifactFilter; import org.apache.maven.archiva.indexer.record.RepositoryIndexRecordFactory; import org.apache.maven.archiva.reporting.ReportExecutor; +import org.apache.maven.archiva.reporting.ReportGroup; import org.apache.maven.archiva.reporting.ReportingDatabase; import org.apache.maven.archiva.reporting.ReportingMetadataFilter; import org.apache.maven.archiva.reporting.ReportingStoreException; @@ -96,6 +97,11 @@ public class IndexerTask */ private ReportExecutor reportExecutor; + /** + * @plexus.requirement role-hint="health" + */ + private ReportGroup reportGroup; + private static final int ARTIFACT_BUFFER_SIZE = 1000; public void execute() @@ -154,7 +160,7 @@ public class IndexerTask boolean includeSnapshots = repositoryConfiguration.isIncludeSnapshots(); ArtifactRepository repository = repoFactory.createRepository( repositoryConfiguration ); - ReportingDatabase reporter = reportExecutor.getReportDatabase( repository ); + ReportingDatabase reporter = reportExecutor.getReportDatabase( repository, reportGroup ); // keep original value in case there is another process under way long origStartTime = reporter.getStartTime(); @@ -192,7 +198,7 @@ public class IndexerTask // run the reports. Done intermittently to avoid losing track of what is indexed since // that is what the filter is based on. - reportExecutor.runArtifactReports( currentArtifacts, repository ); + reportExecutor.runArtifactReports( reportGroup, currentArtifacts, repository ); index.indexArtifacts( currentArtifacts, recordFactory ); @@ -214,7 +220,7 @@ public class IndexerTask getLogger().info( "Discovered " + metadata.size() + " unprocessed metadata files" ); // run the reports - reportExecutor.runMetadataReports( metadata, repository ); + reportExecutor.runMetadataReports( reportGroup, metadata, repository ); } reporter.setStartTime( origStartTime ); |