From af2a929978a21ddd615ab84e3b1bb4ebe3c7f3b7 Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Tue, 9 Mar 2010 04:24:32 +0000 Subject: [MNG-1301] remove the problem reports dependency on the repository layer, start to migrate path parsing into metadata API git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@920649 13f79535-47bb-0310-9956-ffa450edef68 --- .../storage/RepositoryPathTranslator.java | 7 +++++ .../repository/events/RepositoryListener.java | 33 +++++++++++++++++++++ archiva-modules/metadata/pom.xml | 3 +- archiva-modules/metadata/test-repository/pom.xml | 13 ++++++++ .../resources/com/example/invalid-artifact.txt | 1 + .../test-artifact/1.0-SNAPSHOT/maven-metadata.xml | 13 ++++++++ .../1.0-SNAPSHOT/maven-metadata.xml.md5 | 1 + .../1.0-SNAPSHOT/maven-metadata.xml.sha1 | 1 + .../test-artifact-1.0-20100308.230825-1.jar | Bin 0 -> 2367 bytes .../test-artifact-1.0-20100308.230825-1.jar.md5 | 1 + .../test-artifact-1.0-20100308.230825-1.jar.sha1 | 1 + .../test-artifact-1.0-20100308.230825-1.pom | 24 +++++++++++++++ .../test-artifact-1.0-20100308.230825-1.pom.md5 | 1 + .../test-artifact-1.0-20100308.230825-1.pom.sha1 | 1 + .../example/test/test-artifact/maven-metadata.xml | 12 ++++++++ .../test/test-artifact/maven-metadata.xml.md5 | 1 + .../test/test-artifact/maven-metadata.xml.sha1 | 1 + 17 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/repository/events/RepositoryListener.java create mode 100644 archiva-modules/metadata/test-repository/pom.xml create mode 100644 archiva-modules/metadata/test-repository/src/main/resources/com/example/invalid-artifact.txt create mode 100644 archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml create mode 100644 archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.md5 create mode 100644 archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.sha1 create mode 100644 archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar create mode 100644 archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.md5 create mode 100644 archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.sha1 create mode 100644 archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom create mode 100644 archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.md5 create mode 100644 archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.sha1 create mode 100644 archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml create mode 100644 archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml.md5 create mode 100644 archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml.sha1 (limited to 'archiva-modules/metadata') diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryPathTranslator.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryPathTranslator.java index c877ec8ec..ee9358219 100644 --- a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryPathTranslator.java +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryPathTranslator.java @@ -19,6 +19,8 @@ package org.apache.archiva.metadata.repository.storage; * under the License. */ +import org.apache.archiva.metadata.model.ArtifactMetadata; + import java.io.File; public interface RepositoryPathTranslator @@ -32,4 +34,9 @@ public interface RepositoryPathTranslator File toFile( File basedir, String namespace ); File toFile( File basedir, String namespace, String projectId, String projectVersion ); + + ArtifactMetadata getArtifactForPath( String repoId, String relativePath ); + + ArtifactMetadata getArtifactFromId( String repoId, String namespace, String projectId, String projectVersion, + String id ); } diff --git a/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/repository/events/RepositoryListener.java b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/repository/events/RepositoryListener.java new file mode 100644 index 000000000..2978d1a9b --- /dev/null +++ b/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/repository/events/RepositoryListener.java @@ -0,0 +1,33 @@ +package org.apache.archiva.repository.events; + +/* + * 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. + */ + +/** + * Listen to events on the repository. This class is a stopgap + * refactoring measure until an event bus is in place to handle + * generic events such as these. + */ +public interface RepositoryListener +{ + /** + * Event for the deletion of a given artifact. + */ + void deleteArtifact( String repositoryId, String namespace, String project, String version, String id ); +} diff --git a/archiva-modules/metadata/pom.xml b/archiva-modules/metadata/pom.xml index 646612a45..fc3c88642 100644 --- a/archiva-modules/metadata/pom.xml +++ b/archiva-modules/metadata/pom.xml @@ -29,5 +29,6 @@ metadata-model metadata-repository-api + test-repository - + \ No newline at end of file diff --git a/archiva-modules/metadata/test-repository/pom.xml b/archiva-modules/metadata/test-repository/pom.xml new file mode 100644 index 000000000..2755b31ec --- /dev/null +++ b/archiva-modules/metadata/test-repository/pom.xml @@ -0,0 +1,13 @@ + + + 4.0.0 + + metadata + org.apache.archiva + 1.4-SNAPSHOT + + test-repository + Archiva Repository for Testing + diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/invalid-artifact.txt b/archiva-modules/metadata/test-repository/src/main/resources/com/example/invalid-artifact.txt new file mode 100644 index 000000000..acfe11318 --- /dev/null +++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/invalid-artifact.txt @@ -0,0 +1 @@ +invalid path diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml new file mode 100644 index 000000000..89f58d525 --- /dev/null +++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml @@ -0,0 +1,13 @@ + + + com.example.test + test-artifact + 1.0-SNAPSHOT + + + 20100308.230825 + 1 + + 20100308230825 + + diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.md5 b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.md5 new file mode 100644 index 000000000..d774a5365 --- /dev/null +++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.md5 @@ -0,0 +1 @@ +7210867ac16cd955db89cfca699e7c96 \ No newline at end of file diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.sha1 b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.sha1 new file mode 100644 index 000000000..0e44079af --- /dev/null +++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +271faeb2039d026ee6a3c937375b5ff7d4b1d605 \ No newline at end of file diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar new file mode 100644 index 000000000..dab36c0bb Binary files /dev/null and b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar differ diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.md5 b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.md5 new file mode 100644 index 000000000..e98bc51e4 --- /dev/null +++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.md5 @@ -0,0 +1 @@ +cc2236dd70af3667080a786c7dcb4a9b \ No newline at end of file diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.sha1 b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.sha1 new file mode 100644 index 000000000..2d7e3840f --- /dev/null +++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.jar.sha1 @@ -0,0 +1 @@ +edf5938e646956f445c6ecb719d44579cdeed974 \ No newline at end of file diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom new file mode 100644 index 000000000..69a7d1689 --- /dev/null +++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom @@ -0,0 +1,24 @@ + + 4.0.0 + com.example.test + test-artifact + jar + 1.0-SNAPSHOT + test-artifact + http://maven.apache.org + + + junit + junit + 3.8.1 + test + + + + + test-repo + file:${basedir}/repository + + + diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.md5 b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.md5 new file mode 100644 index 000000000..531fc330c --- /dev/null +++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.md5 @@ -0,0 +1 @@ +ce7eeb9586dc4992dc961d9f3a28006b \ No newline at end of file diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.sha1 b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.sha1 new file mode 100644 index 000000000..c0edca2a1 --- /dev/null +++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/1.0-SNAPSHOT/test-artifact-1.0-20100308.230825-1.pom.sha1 @@ -0,0 +1 @@ +be040c8462fd31d4e03749e3586afbb21f43594e \ No newline at end of file diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml new file mode 100644 index 000000000..2678fa1dc --- /dev/null +++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml @@ -0,0 +1,12 @@ + + + com.example.test + test-artifact + 1.0-SNAPSHOT + + + 1.0-SNAPSHOT + + 20100308230825 + + diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml.md5 b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml.md5 new file mode 100644 index 000000000..3dff69b48 --- /dev/null +++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml.md5 @@ -0,0 +1 @@ +93afaac7340faadc7efd097952d79fa4 \ No newline at end of file diff --git a/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml.sha1 b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml.sha1 new file mode 100644 index 000000000..1ff7fb544 --- /dev/null +++ b/archiva-modules/metadata/test-repository/src/main/resources/com/example/test/test-artifact/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +d59d588343d61fd7d838984a0daa4aaa2546bf9d \ No newline at end of file -- cgit v1.2.3