aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/metadata
diff options
context:
space:
mode:
authorBrett Porter <brett@apache.org>2009-12-07 22:32:10 +0000
committerBrett Porter <brett@apache.org>2009-12-07 22:32:10 +0000
commit7c7fffc71c4c2546c8e5aacb933bea9fd1c8ffa7 (patch)
tree2ea76540d2481df4db7e42d1f3f19cb076d1213b /archiva-modules/metadata
parent8afc66c9d202f12d1cfef8d80db88f3963928e3b (diff)
downloadarchiva-7c7fffc71c4c2546c8e5aacb933bea9fd1c8ffa7.tar.gz
archiva-7c7fffc71c4c2546c8e5aacb933bea9fd1c8ffa7.zip
[MRM-1293] introduce repository statistics as a new plugin that operates over the metadata repository. Currently a work in progress - repository size statistics are not stored, and only the scanner and scheduler have been hooked in (meaning reports will be out of date)
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-1025@888164 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/metadata')
-rw-r--r--archiva-modules/metadata/content-model.txt86
-rw-r--r--archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/MetadataFacet.java (renamed from archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionFacet.java)2
-rw-r--r--archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/MetadataFacetFactory.java2
-rw-r--r--archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java12
-rw-r--r--archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/RepositoryMetadata.java28
-rw-r--r--archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java9
6 files changed, 74 insertions, 65 deletions
diff --git a/archiva-modules/metadata/content-model.txt b/archiva-modules/metadata/content-model.txt
index 6b94b757d..993130466 100644
--- a/archiva-modules/metadata/content-model.txt
+++ b/archiva-modules/metadata/content-model.txt
@@ -94,35 +94,60 @@ The following is the intended content model for the metadata content repository:
| |-- maven:groupId=
| |-- maven:plugins.compiler.artifactId=
| `-- maven:plugins.compiler.name=
- `-- references/
- `-- org/
- `-- apache/
- `-- archiva/
- |-- parent/
- | `-- 1/
- | `-- references/
- | `-- org/
- | `-- apache/
- | `-- archiva/
- | |-- platform/
- | | `-- scanner/
- | | `-- 1.0-SNAPSHOT/
- | | `-- referenceType=parent
- | `-- web/
- | `-- webapp/
- | `-- 1.0-SNAPSHOT/
- | `-- referenceType=parent
- `-- platform/
- `-- scanner/
- `-- 1.0-SNAPSHOT/
- `-- references/
- `-- org/
- `-- apache/
- `-- archiva/
- `-- web/
- `-- webapp/
- `-- 1.0-SNAPSHOT/
- `-- referenceType=dependency
+ |-- references/
+ | `-- org/
+ | `-- apache/
+ | `-- archiva/
+ | |-- parent/
+ | | `-- 1/
+ | | `-- references/
+ | | `-- org/
+ | | `-- apache/
+ | | `-- archiva/
+ | | |-- platform/
+ | | | `-- scanner/
+ | | | `-- 1.0-SNAPSHOT/
+ | | | `-- referenceType=parent
+ | | `-- web/
+ | | `-- webapp/
+ | | `-- 1.0-SNAPSHOT/
+ | | `-- referenceType=parent
+ | `-- platform/
+ | `-- scanner/
+ | `-- 1.0-SNAPSHOT/
+ | `-- references/
+ | `-- org/
+ | `-- apache/
+ | `-- archiva/
+ | `-- web/
+ | `-- webapp/
+ | `-- 1.0-SNAPSHOT/
+ | `-- referenceType=dependency
+ `-- stats/
+ `-- 2009/
+ `-- 12/
+ |-- 02/
+ | `-- 23/
+ | `-- 47/
+ | `-- 00/
+ | |-- scanEndTime=
+ | |-- scanStartTime=
+ | |-- totalArtifactCount=
+ | |-- totalArtifactFileSize=
+ | |-- totalFileCount=
+ | |-- totalGroupCount=
+ | `-- totalProjectCount=
+ `-- 03/
+ `-- 09/
+ `-- 00/
+ `-- 00/
+ |-- scanEndTime=
+ |-- scanStartTime=
+ |-- totalArtifactCount=
+ |-- totalArtifactFileSize=
+ |-- totalFileCount=
+ |-- totalGroupCount=
+ `-- totalProjectCount=
(To update - run "tree --dirstfirst -F" on the unpacked content-model.zip from the sandbox)
@@ -179,6 +204,9 @@ Notes:
*) some of the above needs to be reviewed before going into production. For example:
- the maven specific aspects of dependencies should become a faceted part of the content
- more of the metadata might be faceted in general, keeping the content model basic by default
+ - determine if any of the stats can be derived by functions of the content repository rather than storing and trying
+ to keep them up to date. Historical data might be retained by versioning and taking a snapshot at a given point in
+ time. The current approach of tying them to the scanning process is not optimal
- the storing of metadata as 0-indexed lists would be better in as child nodes. This might require additional levels
in the current repository (.../scanner/versions/1.0-SNAPSHOT/artifacts/scanner-1.0-20091120.012345-1.pom), or
for listed information to be in a separate tree
diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionFacet.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/MetadataFacet.java
index 6d2647829..da3de00df 100644
--- a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionFacet.java
+++ b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/MetadataFacet.java
@@ -21,7 +21,7 @@ package org.apache.archiva.metadata.model;
import java.util.Map;
-public interface ProjectVersionFacet
+public interface MetadataFacet
{
String getFacetId();
diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/MetadataFacetFactory.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/MetadataFacetFactory.java
index 80ac09c51..b9e313a80 100644
--- a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/MetadataFacetFactory.java
+++ b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/MetadataFacetFactory.java
@@ -21,5 +21,5 @@ package org.apache.archiva.metadata.model;
public interface MetadataFacetFactory
{
- ProjectVersionFacet createProjectVersionFacet();
+ MetadataFacet createMetadataFacet();
}
diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java
index f6a2bfb95..e6dcabe84 100644
--- a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java
+++ b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java
@@ -45,7 +45,7 @@ public class ProjectVersionMetadata
private List<License> licenses = new ArrayList<License>();
- private Map<String, ProjectVersionFacet> facets = new HashMap<String, ProjectVersionFacet>();
+ private Map<String, MetadataFacet> facets = new HashMap<String, MetadataFacet>();
private List<MailingList> mailingLists = new ArrayList<MailingList>();
@@ -151,22 +151,22 @@ public class ProjectVersionMetadata
this.licenses.add( license );
}
- public void addFacet( ProjectVersionFacet projectVersionFacet )
+ public void addFacet( MetadataFacet metadataFacet )
{
- this.facets.put( projectVersionFacet.getFacetId(), projectVersionFacet );
+ this.facets.put( metadataFacet.getFacetId(), metadataFacet );
}
- public ProjectVersionFacet getFacet( String facetId )
+ public MetadataFacet getFacet( String facetId )
{
return this.facets.get( facetId );
}
- public Map<String, ProjectVersionFacet> getFacets()
+ public Map<String, MetadataFacet> getFacets()
{
return facets;
}
- public Collection<ProjectVersionFacet> getFacetList()
+ public Collection<MetadataFacet> getFacetList()
{
return this.facets.values();
}
diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/RepositoryMetadata.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/RepositoryMetadata.java
deleted file mode 100644
index d1448f24f..000000000
--- a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/RepositoryMetadata.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.apache.archiva.metadata.model;
-
-/*
- * 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.
- */
-
-/**
- * Information about the repository as a whole.
- */
-public class RepositoryMetadata
-{
- // TODO
-}
diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java
index 3428320f9..edf05c236 100644
--- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java
+++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java
@@ -19,7 +19,10 @@ package org.apache.archiva.metadata.repository;
* under the License.
*/
+import java.util.List;
+
import org.apache.archiva.metadata.model.ArtifactMetadata;
+import org.apache.archiva.metadata.model.MetadataFacet;
import org.apache.archiva.metadata.model.ProjectMetadata;
import org.apache.archiva.metadata.model.ProjectVersionMetadata;
import org.apache.archiva.metadata.model.ProjectVersionReference;
@@ -45,4 +48,10 @@ public interface MetadataRepository
ProjectVersionReference reference );
void updateNamespace( String repoId, String namespace );
+
+ List<String> getMetadataFacets( String repodId, String facetId );
+
+ MetadataFacet getMetadataFacet( String repositoryId, String facetId, String name );
+
+ void addMetadataFacet( String repositoryId, String facetId, String name, MetadataFacet metadataFacet );
}