archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1051788 [2/2] - in /archiva/trunk/archiva-modules: archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ archiva-base/archiva-proxy/src/test/java/org/apache/archiva/metadata/repositor...
Date Wed, 22 Dec 2010 08:31:58 GMT
Modified: archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java?rev=1051788&r1=1051787&r2=1051788&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java (original)
+++ archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java Wed Dec 22 08:31:56 2010
@@ -30,7 +30,6 @@ import java.util.Date;
 import java.util.List;
 
 public interface MetadataRepository
-    extends MetadataResolver
 {
     /**
      * Update metadata for a particular project in the metadata repository, or create it if it does not already exist.
@@ -81,7 +80,7 @@ public interface MetadataRepository
     List<ArtifactMetadata> getArtifactsByChecksum( String repositoryId, String checksum )
         throws MetadataRepositoryException;
 
-    void deleteArtifact( String repositoryId, String namespace, String project, String version, String id )
+    void removeArtifact( String repositoryId, String namespace, String project, String version, String id )
         throws MetadataRepositoryException;
 
     /**
@@ -89,9 +88,49 @@ public interface MetadataRepository
      *
      * @param repositoryId the repository to delete
      */
-    void deleteRepository( String repositoryId )
+    void removeRepository( String repositoryId )
         throws MetadataRepositoryException;
 
     List<ArtifactMetadata> getArtifacts( String repositoryId )
         throws MetadataRepositoryException;
+
+    ProjectMetadata getProject( String repoId, String namespace, String projectId )
+        throws MetadataResolutionException;
+
+    ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId, String projectVersion )
+        throws MetadataResolutionException;
+
+    Collection<String> getArtifactVersions( String repoId, String namespace, String projectId, String projectVersion )
+        throws MetadataResolutionException;
+
+    /**
+     * Retrieve project references from the metadata repository. Note that this is not built into the content model for
+     * a project version as a reference may be present (due to reverse-lookup of dependencies) before the actual
+     * project is, and we want to avoid adding a stub model to the content repository.
+     *
+     * @param repoId         the repository ID to look within
+     * @param namespace      the namespace of the project to get references to
+     * @param projectId      the identifier of the project to get references to
+     * @param projectVersion the version of the project to get references to
+     * @return a list of project references
+     */
+    Collection<ProjectVersionReference> getProjectReferences( String repoId, String namespace, String projectId,
+                                                              String projectVersion )
+        throws MetadataResolutionException;
+
+    Collection<String> getRootNamespaces( String repoId )
+        throws MetadataResolutionException;
+
+    Collection<String> getNamespaces( String repoId, String namespace )
+        throws MetadataResolutionException;
+
+    Collection<String> getProjects( String repoId, String namespace )
+        throws MetadataResolutionException;
+
+    Collection<String> getProjectVersions( String repoId, String namespace, String projectId )
+        throws MetadataResolutionException;
+
+    Collection<ArtifactMetadata> getArtifacts( String repoId, String namespace, String projectId,
+                                               String projectVersion )
+        throws MetadataResolutionException;
 }

Modified: archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolver.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolver.java?rev=1051788&r1=1051787&r2=1051788&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolver.java (original)
+++ archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataResolver.java Wed Dec 22 08:31:56 2010
@@ -20,7 +20,6 @@ package org.apache.archiva.metadata.repo
  */
 
 import org.apache.archiva.metadata.model.ArtifactMetadata;
-import org.apache.archiva.metadata.model.ProjectMetadata;
 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
 import org.apache.archiva.metadata.model.ProjectVersionReference;
 
@@ -28,13 +27,8 @@ import java.util.Collection;
 
 public interface MetadataResolver
 {
-    ProjectMetadata getProject( String repoId, String namespace, String projectId )
-        throws MetadataResolutionException;
-
-    ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId, String projectVersion )
-        throws MetadataResolutionException;
-
-    Collection<String> getArtifactVersions( String repoId, String namespace, String projectId, String projectVersion )
+    ProjectVersionMetadata resolveProjectVersion( String repoId, String namespace, String projectId,
+                                                  String projectVersion )
         throws MetadataResolutionException;
 
     /**
@@ -48,23 +42,23 @@ public interface MetadataResolver
      * @param projectVersion the version of the project to get references to
      * @return a list of project references
      */
-    Collection<ProjectVersionReference> getProjectReferences( String repoId, String namespace, String projectId,
-                                                              String projectVersion )
+    Collection<ProjectVersionReference> resolveProjectReferences( String repoId, String namespace, String projectId,
+                                                                  String projectVersion )
         throws MetadataResolutionException;
 
-    Collection<String> getRootNamespaces( String repoId )
+    Collection<String> resolveRootNamespaces( String repoId )
         throws MetadataResolutionException;
 
-    Collection<String> getNamespaces( String repoId, String namespace )
+    Collection<String> resolveNamespaces( String repoId, String namespace )
         throws MetadataResolutionException;
 
-    Collection<String> getProjects( String repoId, String namespace )
+    Collection<String> resolveProjects( String repoId, String namespace )
         throws MetadataResolutionException;
 
-    Collection<String> getProjectVersions( String repoId, String namespace, String projectId )
+    Collection<String> resolveProjectVersions( String repoId, String namespace, String projectId )
         throws MetadataResolutionException;
 
-    Collection<ArtifactMetadata> getArtifacts( String repoId, String namespace, String projectId,
-                                               String projectVersion )
+    Collection<ArtifactMetadata> resolveArtifacts( String repoId, String namespace, String projectId,
+                                                   String projectVersion )
         throws MetadataResolutionException;
 }

Copied: archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java (from r1050283, archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/StorageMetadataResolver.java)
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java?p2=archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java&p1=archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/StorageMetadataResolver.java&r1=1050283&r2=1051788&rev=1051788&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/StorageMetadataResolver.java (original)
+++ archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java Wed Dec 22 08:31:56 2010
@@ -20,25 +20,33 @@ package org.apache.archiva.metadata.repo
  */
 
 import org.apache.archiva.metadata.model.ArtifactMetadata;
-import org.apache.archiva.metadata.repository.MetadataResolver;
+import org.apache.archiva.metadata.model.ProjectMetadata;
+import org.apache.archiva.metadata.model.ProjectVersionMetadata;
+import org.apache.archiva.metadata.repository.MetadataResolutionException;
 import org.apache.archiva.metadata.repository.filter.Filter;
 
 import java.util.Collection;
 
-public interface StorageMetadataResolver
-    extends MetadataResolver
+public interface RepositoryStorage
 {
-    Collection<String> getRootNamespaces( String repoId, Filter<String> filter );
+    ProjectMetadata readProjectMetadata( String repoId, String namespace, String projectId )
+        throws MetadataResolutionException;
 
-    Collection<String> getNamespaces( String repoId, String namespace, Filter<String> filter );
+    ProjectVersionMetadata readProjectVersionMetadata( String repoId, String namespace, String projectId,
+                                                       String projectVersion )
+        throws MetadataResolutionException;
 
-    Collection<String> getProjects( String repoId, String namespace, Filter<String> filter );
+    Collection<String> listRootNamespaces( String repoId, Filter<String> filter );
 
-    Collection<String> getProjectVersions( String repoId, String namespace, String projectId, Filter<String> filter );
+    Collection<String> listNamespaces( String repoId, String namespace, Filter<String> filter );
 
-    Collection<ArtifactMetadata> getArtifacts( String repoId, String namespace, String projectId, String projectVersion,
-                                               Filter<String> filter );
+    Collection<String> listProjects( String repoId, String namespace, Filter<String> filter );
+
+    Collection<String> listProjectVersions( String repoId, String namespace, String projectId, Filter<String> filter );
+
+    Collection<ArtifactMetadata> readArtifactsMetadata( String repoId, String namespace, String projectId,
+                                                        String projectVersion, Filter<String> filter );
 
     // TODO: reconsider this API, do we want to expose storage format in the form of a path?
-    ArtifactMetadata getArtifactForPath( String repoId, String path );
+    ArtifactMetadata readArtifactMetadataFromPath( String repoId, String path );
 }

Propchange: archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/RepositoryStorage.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Dec 22 08:31:56 2010
@@ -0,0 +1,5 @@
+/archiva/branches/MRM-1025/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/StorageMetadataResolver.java:721945-723577
+/archiva/branches/MRM-541/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/StorageMetadataResolver.java:686983-687034
+/archiva/branches/archiva-search-improvements/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/StorageMetadataResolver.java:723609-726925
+/archiva/branches/archiva-struts2/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/StorageMetadataResolver.java:699795-705848
+/archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/storage/StorageMetadataResolver.java:825850-882383,885006-909464,960322

Modified: archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java?rev=1051788&r1=1051787&r2=1051788&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java (original)
+++ archiva/trunk/archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java Wed Dec 22 08:31:56 2010
@@ -873,7 +873,7 @@ public abstract class AbstractMetadataRe
         assertEquals( Collections.singletonList( artifact ), new ArrayList<ArtifactMetadata>( repository.getArtifacts(
             TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ) ) );
 
-        repository.deleteArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact.getId() );
+        repository.removeArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact.getId() );
 
         assertTrue( repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT,
                                              TEST_PROJECT_VERSION ).isEmpty() );
@@ -909,7 +909,7 @@ public abstract class AbstractMetadataRe
 
         assertEquals( expected, actual );
 
-        repository.deleteRepository( TEST_REPO_ID );
+        repository.removeRepository( TEST_REPO_ID );
 
         assertTrue( repository.getArtifacts( TEST_REPO_ID ).isEmpty() );
         assertTrue( repository.getRootNamespaces( TEST_REPO_ID ).isEmpty() );

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/DefaultDependencyTreeBuilder.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/DefaultDependencyTreeBuilder.java?rev=1051788&r1=1051787&r2=1051788&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/DefaultDependencyTreeBuilder.java (original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/dependency/tree/maven2/DefaultDependencyTreeBuilder.java Wed Dec 22 08:31:56 2010
@@ -425,8 +425,8 @@ public class DefaultDependencyTreeBuilde
                 Collection<String> projectVersions;
                 try
                 {
-                    projectVersions = metadataResolver.getProjectVersions( repoId, artifact.getGroupId(),
-                                                                           artifact.getArtifactId() );
+                    projectVersions = metadataResolver.resolveProjectVersions( repoId, artifact.getGroupId(),
+                                                                               artifact.getArtifactId() );
                 }
                 catch ( MetadataResolutionException e )
                 {

Copied: archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java (from r1051732, archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolver.java)
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java?p2=archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java&p1=archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolver.java&r1=1051732&r2=1051788&rev=1051788&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolver.java (original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java Wed Dec 22 08:31:56 2010
@@ -24,14 +24,12 @@ import org.apache.archiva.checksum.Check
 import org.apache.archiva.metadata.model.ArtifactMetadata;
 import org.apache.archiva.metadata.model.ProjectMetadata;
 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
-import org.apache.archiva.metadata.model.ProjectVersionReference;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.MetadataRepositoryException;
 import org.apache.archiva.metadata.repository.MetadataResolutionException;
-import org.apache.archiva.metadata.repository.filter.AllFilter;
 import org.apache.archiva.metadata.repository.filter.Filter;
 import org.apache.archiva.metadata.repository.storage.RepositoryPathTranslator;
-import org.apache.archiva.metadata.repository.storage.StorageMetadataResolver;
+import org.apache.archiva.metadata.repository.storage.RepositoryStorage;
 import org.apache.archiva.reports.RepositoryProblemFacet;
 import org.apache.maven.archiva.common.utils.VersionUtil;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
@@ -63,10 +61,10 @@ import java.util.Date;
 import java.util.List;
 
 /**
- * @plexus.component role="org.apache.archiva.metadata.repository.storage.StorageMetadataResolver" role-hint="maven2"
+ * @plexus.component role="org.apache.archiva.metadata.repository.storage.RepositoryStorage" role-hint="maven2"
  */
-public class Maven2RepositoryMetadataResolver
-    implements StorageMetadataResolver
+public class Maven2RepositoryStorage
+    implements RepositoryStorage
 {
     /**
      * @plexus.requirement
@@ -88,12 +86,10 @@ public class Maven2RepositoryMetadataRes
      */
     private MetadataRepository metadataRepository;
 
-    private final static Logger log = LoggerFactory.getLogger( Maven2RepositoryMetadataResolver.class );
+    private final static Logger log = LoggerFactory.getLogger( Maven2RepositoryStorage.class );
 
     private static final String METADATA_FILENAME = "maven-metadata.xml";
 
-    private static final Filter<String> ALL = new AllFilter<String>();
-
     private static final String PROBLEM_MISSING_POM = "missing-pom";
 
     private static final String PROBLEM_INVALID_POM = "invalid-pom";
@@ -103,14 +99,14 @@ public class Maven2RepositoryMetadataRes
     private static final List<String> POTENTIAL_PROBLEMS = Arrays.asList( PROBLEM_INVALID_POM, PROBLEM_MISSING_POM,
                                                                           PROBLEM_MISLOCATED_POM );
 
-    public ProjectMetadata getProject( String repoId, String namespace, String projectId )
+    public ProjectMetadata readProjectMetadata( String repoId, String namespace, String projectId )
     {
         // TODO: could natively implement the "shared model" concept from the browse action to avoid needing it there?
         return null;
     }
 
-    public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId,
-                                                     String projectVersion )
+    public ProjectVersionMetadata readProjectVersionMetadata( String repoId, String namespace, String projectId,
+                                                              String projectVersion )
         throws MetadataResolutionException
     {
         // Remove problems associated with this version, since we'll be re-adding any that still exist
@@ -372,26 +368,7 @@ public class Maven2RepositoryMetadataRes
         return ci;
     }
 
-    public Collection<String> getArtifactVersions( String repoId, String namespace, String projectId,
-                                                   String projectVersion )
-    {
-        // TODO: useful, but not implemented yet, not called from DefaultMetadataResolver
-        throw new UnsupportedOperationException();
-    }
-
-    public Collection<ProjectVersionReference> getProjectReferences( String repoId, String namespace, String projectId,
-                                                                     String projectVersion )
-    {
-        // Can't be determined on a Maven 2 repository
-        throw new UnsupportedOperationException();
-    }
-
-    public Collection<String> getRootNamespaces( String repoId )
-    {
-        return getRootNamespaces( repoId, ALL );
-    }
-
-    public Collection<String> getRootNamespaces( String repoId, Filter<String> filter )
+    public Collection<String> listRootNamespaces( String repoId, Filter<String> filter )
     {
         File dir = getRepositoryBasedir( repoId );
 
@@ -422,12 +399,7 @@ public class Maven2RepositoryMetadataRes
         return new File( repositoryConfiguration.getLocation() );
     }
 
-    public Collection<String> getNamespaces( String repoId, String namespace )
-    {
-        return getNamespaces( repoId, namespace, ALL );
-    }
-
-    public Collection<String> getNamespaces( String repoId, String namespace, Filter<String> filter )
+    public Collection<String> listNamespaces( String repoId, String namespace, Filter<String> filter )
     {
         File dir = pathTranslator.toFile( getRepositoryBasedir( repoId ), namespace );
 
@@ -448,12 +420,7 @@ public class Maven2RepositoryMetadataRes
         return namespaces;
     }
 
-    public Collection<String> getProjects( String repoId, String namespace )
-    {
-        return getProjects( repoId, namespace, ALL );
-    }
-
-    public Collection<String> getProjects( String repoId, String namespace, Filter<String> filter )
+    public Collection<String> listProjects( String repoId, String namespace, Filter<String> filter )
     {
         File dir = pathTranslator.toFile( getRepositoryBasedir( repoId ), namespace );
 
@@ -474,19 +441,8 @@ public class Maven2RepositoryMetadataRes
         return projects;
     }
 
-    public Collection<String> getProjectVersions( String repoId, String namespace, String projectId )
-    {
-        return getProjectVersions( repoId, namespace, projectId, ALL );
-    }
-
-    public Collection<ArtifactMetadata> getArtifacts( String repoId, String namespace, String projectId,
-                                                      String projectVersion )
-    {
-        return getArtifacts( repoId, namespace, projectId, projectVersion, ALL );
-    }
-
-    public Collection<String> getProjectVersions( String repoId, String namespace, String projectId,
-                                                  Filter<String> filter )
+    public Collection<String> listProjectVersions( String repoId, String namespace, String projectId,
+                                                   Filter<String> filter )
     {
         File dir = pathTranslator.toFile( getRepositoryBasedir( repoId ), namespace, projectId );
 
@@ -494,8 +450,8 @@ public class Maven2RepositoryMetadataRes
         return getSortedFiles( dir, filter );
     }
 
-    public Collection<ArtifactMetadata> getArtifacts( String repoId, String namespace, String projectId,
-                                                      String projectVersion, Filter<String> filter )
+    public Collection<ArtifactMetadata> readArtifactsMetadata( String repoId, String namespace, String projectId,
+                                                               String projectVersion, Filter<String> filter )
     {
         File dir = pathTranslator.toFile( getRepositoryBasedir( repoId ), namespace, projectId, projectVersion );
 
@@ -514,7 +470,7 @@ public class Maven2RepositoryMetadataRes
         return artifacts;
     }
 
-    public ArtifactMetadata getArtifactForPath( String repoId, String path )
+    public ArtifactMetadata readArtifactMetadataFromPath( String repoId, String path )
     {
         ArtifactMetadata metadata = pathTranslator.getArtifactForPath( repoId, path );
 
@@ -653,11 +609,6 @@ public class Maven2RepositoryMetadataRes
         return metadata;
     }
 
-    public void setConfiguration( ArchivaConfiguration configuration )
-    {
-        this.archivaConfiguration = configuration;
-    }
-
     private static class DirectoryFilter
         implements FilenameFilter
     {

Propchange: archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Dec 22 08:31:56 2010
@@ -0,0 +1,5 @@
+/archiva/branches/MRM-1025/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolver.java:721945-723577
+/archiva/branches/MRM-541/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolver.java:686983-687034
+/archiva/branches/archiva-search-improvements/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolver.java:723609-726925
+/archiva/branches/archiva-struts2/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolver.java:699795-705848
+/archiva/trunk/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolver.java:825850-909464,960322

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java?rev=1051788&r1=1051787&r2=1051788&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java (original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java Wed Dec 22 08:31:56 2010
@@ -19,6 +19,12 @@ package org.apache.archiva.metadata.repo
  * under the License.
  */
 
+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;
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
@@ -26,14 +32,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-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;
-
 public class TestMetadataRepository
-    extends TestMetadataResolver
     implements MetadataRepository
 {
     private Map<String, MetadataFacet> facets = new HashMap<String, MetadataFacet>();
@@ -49,7 +48,8 @@ public class TestMetadataRepository
         //To change body of implemented methods use File | Settings | File Templates.
     }
 
-    public void updateProjectVersion( String repoId, String namespace, String projectId, ProjectVersionMetadata versionMetadata )
+    public void updateProjectVersion( String repoId, String namespace, String projectId,
+                                      ProjectVersionMetadata versionMetadata )
     {
         //To change body of implemented methods use File | Settings | File Templates.
     }
@@ -105,16 +105,76 @@ public class TestMetadataRepository
         return null;  //To change body of implemented methods use File | Settings | File Templates.
     }
 
-    public void deleteArtifact( String repositoryId, String namespace, String project, String version, String id )
+    public void removeArtifact( String repositoryId, String namespace, String project, String version, String id )
     {
         //To change body of implemented methods use File | Settings | File Templates.
     }
 
-    public void deleteRepository( String repoId )
+    public void removeRepository( String repoId )
     {
         //To change body of implemented methods use File | Settings | File Templates.
     }
-    public List<ArtifactMetadata> getArtifacts(String repositoryId){
+
+    public List<ArtifactMetadata> getArtifacts( String repositoryId )
+    {
         return null;
     }
+
+    public ProjectMetadata getProject( String repoId, String namespace, String projectId )
+        throws MetadataResolutionException
+    {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId,
+                                                     String projectVersion )
+        throws MetadataResolutionException
+    {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public Collection<String> getArtifactVersions( String repoId, String namespace, String projectId,
+                                                   String projectVersion )
+        throws MetadataResolutionException
+    {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public Collection<ProjectVersionReference> getProjectReferences( String repoId, String namespace, String projectId,
+                                                                     String projectVersion )
+        throws MetadataResolutionException
+    {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public Collection<String> getRootNamespaces( String repoId )
+        throws MetadataResolutionException
+    {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public Collection<String> getNamespaces( String repoId, String namespace )
+        throws MetadataResolutionException
+    {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public Collection<String> getProjects( String repoId, String namespace )
+        throws MetadataResolutionException
+    {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public Collection<String> getProjectVersions( String repoId, String namespace, String projectId )
+        throws MetadataResolutionException
+    {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public Collection<ArtifactMetadata> getArtifacts( String repoId, String namespace, String projectId,
+                                                      String projectVersion )
+        throws MetadataResolutionException
+    {
+        return null;  //To change body of implemented methods use File | Settings | File Templates.
+    }
 }
\ No newline at end of file

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataResolver.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataResolver.java?rev=1051788&r1=1051787&r2=1051788&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataResolver.java (original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataResolver.java Wed Dec 22 08:31:56 2010
@@ -19,61 +19,49 @@ package org.apache.archiva.metadata.repo
  * under the License.
  */
 
-import java.util.Collection;
-
 import org.apache.archiva.metadata.model.ArtifactMetadata;
-import org.apache.archiva.metadata.model.ProjectMetadata;
 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
 import org.apache.archiva.metadata.model.ProjectVersionReference;
 
+import java.util.Collection;
+
 public class TestMetadataResolver
     implements MetadataResolver
 {
-    public ProjectMetadata getProject( String repoId, String namespace, String projectId )
-    {
-        return null;  //To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    public ProjectVersionMetadata getProjectVersion( String repoId, String namespace, String projectId,
-                                                     String projectVersion )
-    {
-        return null;  //To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    public Collection<String> getArtifactVersions( String repoId, String namespace, String projectId,
-                                                   String projectVersion )
+    public ProjectVersionMetadata resolveProjectVersion( String repoId, String namespace, String projectId,
+                                                         String projectVersion )
     {
         return null;  //To change body of implemented methods use File | Settings | File Templates.
     }
 
-    public Collection<ProjectVersionReference> getProjectReferences( String repoId, String namespace, String projectId,
-                                                                     String projectVersion )
+    public Collection<ProjectVersionReference> resolveProjectReferences( String repoId, String namespace,
+                                                                         String projectId, String projectVersion )
     {
         return null;  //To change body of implemented methods use File | Settings | File Templates.
     }
 
-    public Collection<String> getRootNamespaces( String repoId )
+    public Collection<String> resolveRootNamespaces( String repoId )
     {
         return null;  //To change body of implemented methods use File | Settings | File Templates.
     }
 
-    public Collection<String> getNamespaces( String repoId, String namespace )
+    public Collection<String> resolveNamespaces( String repoId, String namespace )
     {
         return null;  //To change body of implemented methods use File | Settings | File Templates.
     }
 
-    public Collection<String> getProjects( String repoId, String namespace )
+    public Collection<String> resolveProjects( String repoId, String namespace )
     {
         return null;  //To change body of implemented methods use File | Settings | File Templates.
     }
 
-    public Collection<String> getProjectVersions( String repoId, String namespace, String projectId )
+    public Collection<String> resolveProjectVersions( String repoId, String namespace, String projectId )
     {
         return null;  //To change body of implemented methods use File | Settings | File Templates.
     }
 
-    public Collection<ArtifactMetadata> getArtifacts( String repoId, String namespace, String projectId,
-                                                      String projectVersion )
+    public Collection<ArtifactMetadata> resolveArtifacts( String repoId, String namespace, String projectId,
+                                                          String projectVersion )
     {
         return null;  //To change body of implemented methods use File | Settings | File Templates.
     }

Modified: archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java?rev=1051788&r1=1051787&r2=1051788&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java (original)
+++ archiva/trunk/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java Wed Dec 22 08:31:56 2010
@@ -27,8 +27,10 @@ import org.apache.archiva.metadata.model
 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
 import org.apache.archiva.metadata.repository.MetadataRepository;
 import org.apache.archiva.metadata.repository.MetadataResolutionException;
+import org.apache.archiva.metadata.repository.filter.AllFilter;
 import org.apache.archiva.metadata.repository.filter.ExcludesFilter;
-import org.apache.archiva.metadata.repository.storage.StorageMetadataResolver;
+import org.apache.archiva.metadata.repository.filter.Filter;
+import org.apache.archiva.metadata.repository.storage.RepositoryStorage;
 import org.apache.archiva.reports.RepositoryProblemFacet;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.Configuration;
@@ -45,7 +47,9 @@ import java.util.List;
 public class Maven2RepositoryMetadataResolverTest
     extends PlexusInSpringTestCase
 {
-    private Maven2RepositoryMetadataResolver resolver;
+    private static final Filter<String> ALL = new AllFilter<String>();
+
+    private Maven2RepositoryStorage resolver;
 
     private static final String TEST_REPO_ID = "test";
 
@@ -74,7 +78,7 @@ public class Maven2RepositoryMetadataRes
         c.addManagedRepository( testRepo );
         configuration.save( c );
 
-        resolver = (Maven2RepositoryMetadataResolver) lookup( StorageMetadataResolver.class, "maven2" );
+        resolver = (Maven2RepositoryStorage) lookup( RepositoryStorage.class, "maven2" );
         metadataRepository = (MetadataRepository) lookup( MetadataRepository.class );
         metadataRepository.removeMetadataFacets( TEST_REPO_ID, RepositoryProblemFacet.FACET_ID );
     }
@@ -82,8 +86,8 @@ public class Maven2RepositoryMetadataRes
     public void testGetProjectVersionMetadata()
         throws Exception
     {
-        ProjectVersionMetadata metadata = resolver.getProjectVersion( TEST_REPO_ID, "org.apache.archiva",
-                                                                      "archiva-common", "1.2.1" );
+        ProjectVersionMetadata metadata = resolver.readProjectVersionMetadata( TEST_REPO_ID, "org.apache.archiva",
+                                                                               "archiva-common", "1.2.1" );
         MavenProjectFacet facet = (MavenProjectFacet) metadata.getFacet( MavenProjectFacet.FACET_ID );
         assertEquals( "jar", facet.getPackaging() );
         assertEquals( "http://archiva.apache.org/ref/1.2.1/archiva-base/archiva-common", metadata.getUrl() );
@@ -136,8 +140,9 @@ public class Maven2RepositoryMetadataRes
     public void testGetArtifactMetadata()
         throws Exception
     {
-        Collection<ArtifactMetadata> springArtifacts = resolver.getArtifacts( TEST_REPO_ID, "org.codehaus.plexus",
-                                                                              "plexus-spring", "1.2" );
+        Collection<ArtifactMetadata> springArtifacts = resolver.readArtifactsMetadata( TEST_REPO_ID,
+                                                                                       "org.codehaus.plexus",
+                                                                                       "plexus-spring", "1.2", ALL );
         List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( springArtifacts );
         Collections.sort( artifacts, new Comparator<ArtifactMetadata>()
         {
@@ -177,8 +182,9 @@ public class Maven2RepositoryMetadataRes
     public void testGetArtifactMetadataSnapshots()
         throws Exception
     {
-        Collection<ArtifactMetadata> testArtifacts = resolver.getArtifacts( TEST_REPO_ID, "com.example.test",
-                                                                            "test-artifact", "1.0-SNAPSHOT" );
+        Collection<ArtifactMetadata> testArtifacts = resolver.readArtifactsMetadata( TEST_REPO_ID, "com.example.test",
+                                                                                     "test-artifact", "1.0-SNAPSHOT",
+                                                                                     ALL );
         List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( testArtifacts );
         Collections.sort( artifacts, new Comparator<ArtifactMetadata>()
         {
@@ -259,8 +265,8 @@ public class Maven2RepositoryMetadataRes
     public void testGetProjectVersionMetadataForTimestampedSnapshot()
         throws Exception
     {
-        ProjectVersionMetadata metadata = resolver.getProjectVersion( TEST_REPO_ID, "org.apache", "apache",
-                                                                      "5-SNAPSHOT" );
+        ProjectVersionMetadata metadata = resolver.readProjectVersionMetadata( TEST_REPO_ID, "org.apache", "apache",
+                                                                               "5-SNAPSHOT" );
         MavenProjectFacet facet = (MavenProjectFacet) metadata.getFacet( MavenProjectFacet.FACET_ID );
         assertEquals( "pom", facet.getPackaging() );
         assertEquals( "http://www.apache.org/", metadata.getUrl() );
@@ -296,24 +302,24 @@ public class Maven2RepositoryMetadataRes
     public void testGetProjectVersionMetadataForTimestampedSnapshotMissingMetadata()
         throws Exception
     {
-        FacetedMetadata metadata = resolver.getProjectVersion( TEST_REPO_ID, "com.example.test", "missing-metadata",
-                                                               "1.0-SNAPSHOT" );
+        FacetedMetadata metadata = resolver.readProjectVersionMetadata( TEST_REPO_ID, "com.example.test",
+                                                                        "missing-metadata", "1.0-SNAPSHOT" );
         assertNull( metadata );
     }
 
     public void testGetProjectVersionMetadataForTimestampedSnapshotMalformedMetadata()
         throws Exception
     {
-        FacetedMetadata metadata = resolver.getProjectVersion( TEST_REPO_ID, "com.example.test", "malformed-metadata",
-                                                               "1.0-SNAPSHOT" );
+        FacetedMetadata metadata = resolver.readProjectVersionMetadata( TEST_REPO_ID, "com.example.test",
+                                                                        "malformed-metadata", "1.0-SNAPSHOT" );
         assertNull( metadata );
     }
 
     public void testGetProjectVersionMetadataForTimestampedSnapshotIncompleteMetadata()
         throws Exception
     {
-        FacetedMetadata metadata = resolver.getProjectVersion( TEST_REPO_ID, "com.example.test", "incomplete-metadata",
-                                                               "1.0-SNAPSHOT" );
+        FacetedMetadata metadata = resolver.readProjectVersionMetadata( TEST_REPO_ID, "com.example.test",
+                                                                        "incomplete-metadata", "1.0-SNAPSHOT" );
         assertNull( metadata );
     }
 
@@ -324,7 +330,7 @@ public class Maven2RepositoryMetadataRes
 
         try
         {
-            resolver.getProjectVersion( TEST_REPO_ID, "com.example.test", "invalid-pom", "1.0" );
+            resolver.readProjectVersionMetadata( TEST_REPO_ID, "com.example.test", "invalid-pom", "1.0" );
             fail( "Should have received an exception due to invalid POM" );
         }
         catch ( MetadataResolutionException e )
@@ -345,7 +351,7 @@ public class Maven2RepositoryMetadataRes
 
         try
         {
-            resolver.getProjectVersion( TEST_REPO_ID, "com.example.test", "mislocated-pom", "1.0" );
+            resolver.readProjectVersionMetadata( TEST_REPO_ID, "com.example.test", "mislocated-pom", "1.0" );
             fail( "Should have received an exception due to mislocated POM" );
         }
         catch ( MetadataResolutionException e )
@@ -364,7 +370,8 @@ public class Maven2RepositoryMetadataRes
     {
         assertTrue( metadataRepository.getMetadataFacets( TEST_REPO_ID, RepositoryProblemFacet.FACET_ID ).isEmpty() );
 
-        FacetedMetadata metadata = resolver.getProjectVersion( TEST_REPO_ID, "com.example.test", "missing-pom", "1.0" );
+        FacetedMetadata metadata = resolver.readProjectVersionMetadata( TEST_REPO_ID, "com.example.test", "missing-pom",
+                                                                        "1.0" );
         assertNull( metadata );
 
         assertFalse( metadataRepository.getMetadataFacets( TEST_REPO_ID, RepositoryProblemFacet.FACET_ID ).isEmpty() );
@@ -377,84 +384,87 @@ public class Maven2RepositoryMetadataRes
 
     public void testGetRootNamespaces()
     {
-        assertEquals( Arrays.asList( "com", "org" ), resolver.getRootNamespaces( TEST_REPO_ID ) );
+        assertEquals( Arrays.asList( "com", "org" ), resolver.listRootNamespaces( TEST_REPO_ID, ALL ) );
     }
 
     public void testGetNamespaces()
     {
-        assertEquals( Arrays.asList( "example" ), resolver.getNamespaces( TEST_REPO_ID, "com" ) );
-        assertEquals( Arrays.asList( "test" ), resolver.getNamespaces( TEST_REPO_ID, "com.example" ) );
-        assertEquals( Collections.<String>emptyList(), resolver.getNamespaces( TEST_REPO_ID, "com.example.test" ) );
-
-        assertEquals( Arrays.asList( "apache", "codehaus" ), resolver.getNamespaces( TEST_REPO_ID, "org" ) );
-        assertEquals( Arrays.asList( "archiva", "maven" ), resolver.getNamespaces( TEST_REPO_ID, "org.apache" ) );
-        assertEquals( Collections.<String>emptyList(), resolver.getNamespaces( TEST_REPO_ID, "org.apache.archiva" ) );
-        assertEquals( Arrays.asList( "plugins", "shared" ), resolver.getNamespaces( TEST_REPO_ID,
-                                                                                    "org.apache.maven" ) );
-        assertEquals( Collections.<String>emptyList(), resolver.getNamespaces( TEST_REPO_ID,
-                                                                               "org.apache.maven.plugins" ) );
-        assertEquals( Collections.<String>emptyList(), resolver.getNamespaces( TEST_REPO_ID,
-                                                                               "org.apache.maven.shared" ) );
-
-        assertEquals( Arrays.asList( "plexus" ), resolver.getNamespaces( TEST_REPO_ID, "org.codehaus" ) );
-        assertEquals( Collections.<String>emptyList(), resolver.getNamespaces( TEST_REPO_ID, "org.codehaus.plexus" ) );
+        assertEquals( Arrays.asList( "example" ), resolver.listNamespaces( TEST_REPO_ID, "com", ALL ) );
+        assertEquals( Arrays.asList( "test" ), resolver.listNamespaces( TEST_REPO_ID, "com.example", ALL ) );
+        assertEquals( Collections.<String>emptyList(), resolver.listNamespaces( TEST_REPO_ID, "com.example.test",
+                                                                                ALL ) );
+
+        assertEquals( Arrays.asList( "apache", "codehaus" ), resolver.listNamespaces( TEST_REPO_ID, "org", ALL ) );
+        assertEquals( Arrays.asList( "archiva", "maven" ), resolver.listNamespaces( TEST_REPO_ID, "org.apache", ALL ) );
+        assertEquals( Collections.<String>emptyList(), resolver.listNamespaces( TEST_REPO_ID, "org.apache.archiva",
+                                                                                ALL ) );
+        assertEquals( Arrays.asList( "plugins", "shared" ), resolver.listNamespaces( TEST_REPO_ID, "org.apache.maven",
+                                                                                     ALL ) );
+        assertEquals( Collections.<String>emptyList(), resolver.listNamespaces( TEST_REPO_ID,
+                                                                                "org.apache.maven.plugins", ALL ) );
+        assertEquals( Collections.<String>emptyList(), resolver.listNamespaces( TEST_REPO_ID, "org.apache.maven.shared",
+                                                                                ALL ) );
+
+        assertEquals( Arrays.asList( "plexus" ), resolver.listNamespaces( TEST_REPO_ID, "org.codehaus", ALL ) );
+        assertEquals( Collections.<String>emptyList(), resolver.listNamespaces( TEST_REPO_ID, "org.codehaus.plexus",
+                                                                                ALL ) );
     }
 
     public void testGetProjects()
     {
-        assertEquals( Collections.<String>emptyList(), resolver.getProjects( TEST_REPO_ID, "com" ) );
-        assertEquals( Collections.<String>emptyList(), resolver.getProjects( TEST_REPO_ID, "com.example" ) );
+        assertEquals( Collections.<String>emptyList(), resolver.listProjects( TEST_REPO_ID, "com", ALL ) );
+        assertEquals( Collections.<String>emptyList(), resolver.listProjects( TEST_REPO_ID, "com.example", ALL ) );
         assertEquals( Arrays.asList( "incomplete-metadata", "invalid-pom", "malformed-metadata", "mislocated-pom",
-                                     "missing-metadata", "test-artifact" ), resolver.getProjects( TEST_REPO_ID,
-                                                                                                  "com.example.test" ) );
+                                     "missing-metadata", "test-artifact" ), resolver.listProjects( TEST_REPO_ID,
+                                                                                                   "com.example.test",
+                                                                                                   ALL ) );
 
-        assertEquals( Collections.<String>emptyList(), resolver.getProjects( TEST_REPO_ID, "org" ) );
-        assertEquals( Arrays.asList( "apache" ), resolver.getProjects( TEST_REPO_ID, "org.apache" ) );
+        assertEquals( Collections.<String>emptyList(), resolver.listProjects( TEST_REPO_ID, "org", ALL ) );
+        assertEquals( Arrays.asList( "apache" ), resolver.listProjects( TEST_REPO_ID, "org.apache", ALL ) );
         assertEquals( Arrays.asList( "archiva", "archiva-base", "archiva-common", "archiva-modules", "archiva-parent" ),
-                      resolver.getProjects( TEST_REPO_ID, "org.apache.archiva" ) );
-        assertEquals( Collections.<String>emptyList(), resolver.getProjects( TEST_REPO_ID, "org.apache.maven" ) );
-        assertEquals( Collections.<String>emptyList(), resolver.getProjects( TEST_REPO_ID,
-                                                                             "org.apache.maven.plugins" ) );
-        assertEquals( Arrays.asList( "maven-downloader" ), resolver.getProjects( TEST_REPO_ID,
-                                                                                 "org.apache.maven.shared" ) );
+                      resolver.listProjects( TEST_REPO_ID, "org.apache.archiva", ALL ) );
+        assertEquals( Collections.<String>emptyList(), resolver.listProjects( TEST_REPO_ID, "org.apache.maven", ALL ) );
+        assertEquals( Collections.<String>emptyList(), resolver.listProjects( TEST_REPO_ID, "org.apache.maven.plugins",
+                                                                              ALL ) );
+        assertEquals( Arrays.asList( "maven-downloader" ), resolver.listProjects( TEST_REPO_ID,
+                                                                                  "org.apache.maven.shared", ALL ) );
     }
 
     public void testGetProjectVersions()
     {
-        assertEquals( Arrays.asList( "1.0-SNAPSHOT" ), resolver.getProjectVersions( TEST_REPO_ID, "com.example.test",
-                                                                                    "incomplete-metadata" ) );
-        assertEquals( Arrays.asList( "1.0-SNAPSHOT" ), resolver.getProjectVersions( TEST_REPO_ID, "com.example.test",
-                                                                                    "malformed-metadata" ) );
-        assertEquals( Arrays.asList( "1.0-SNAPSHOT" ), resolver.getProjectVersions( TEST_REPO_ID, "com.example.test",
-                                                                                    "missing-metadata" ) );
-        assertEquals( Arrays.asList( "1.0" ), resolver.getProjectVersions( TEST_REPO_ID, "com.example.test",
-                                                                           "invalid-pom" ) );
-
-        assertEquals( Arrays.asList( "4", "5-SNAPSHOT" ), resolver.getProjectVersions( TEST_REPO_ID, "org.apache",
-                                                                                       "apache" ) );
-
-        assertEquals( Arrays.asList( "1.2.1", "1.2.2" ), resolver.getProjectVersions( TEST_REPO_ID, "org.apache.archiva",
-                                                                             "archiva" ) );
-        assertEquals( Arrays.asList( "1.2.1" ), resolver.getProjectVersions( TEST_REPO_ID, "org.apache.archiva",
-                                                                             "archiva-base" ) );
-        assertEquals( Arrays.asList( "1.2.1" ), resolver.getProjectVersions( TEST_REPO_ID, "org.apache.archiva",
-                                                                             "archiva-common" ) );
-        assertEquals( Arrays.asList( "1.2.1" ), resolver.getProjectVersions( TEST_REPO_ID, "org.apache.archiva",
-                                                                             "archiva-modules" ) );
-        assertEquals( Arrays.asList( "3" ), resolver.getProjectVersions( TEST_REPO_ID, "org.apache.archiva",
-                                                                         "archiva-parent" ) );
-
-        assertEquals( Collections.<String>emptyList(), resolver.getProjectVersions( TEST_REPO_ID,
-                                                                                    "org.apache.maven.shared",
-                                                                                    "maven-downloader" ) );
+        assertEquals( Arrays.asList( "1.0-SNAPSHOT" ), resolver.listProjectVersions( TEST_REPO_ID, "com.example.test",
+                                                                                     "incomplete-metadata", ALL ) );
+        assertEquals( Arrays.asList( "1.0-SNAPSHOT" ), resolver.listProjectVersions( TEST_REPO_ID, "com.example.test",
+                                                                                     "malformed-metadata", ALL ) );
+        assertEquals( Arrays.asList( "1.0-SNAPSHOT" ), resolver.listProjectVersions( TEST_REPO_ID, "com.example.test",
+                                                                                     "missing-metadata", ALL ) );
+        assertEquals( Arrays.asList( "1.0" ), resolver.listProjectVersions( TEST_REPO_ID, "com.example.test",
+                                                                            "invalid-pom", ALL ) );
+
+        assertEquals( Arrays.asList( "4", "5-SNAPSHOT" ), resolver.listProjectVersions( TEST_REPO_ID, "org.apache",
+                                                                                        "apache", ALL ) );
+
+        assertEquals( Arrays.asList( "1.2.1", "1.2.2" ), resolver.listProjectVersions( TEST_REPO_ID,
+                                                                                       "org.apache.archiva", "archiva",
+                                                                                       ALL ) );
+        assertEquals( Arrays.asList( "1.2.1" ), resolver.listProjectVersions( TEST_REPO_ID, "org.apache.archiva",
+                                                                              "archiva-base", ALL ) );
+        assertEquals( Arrays.asList( "1.2.1" ), resolver.listProjectVersions( TEST_REPO_ID, "org.apache.archiva",
+                                                                              "archiva-common", ALL ) );
+        assertEquals( Arrays.asList( "1.2.1" ), resolver.listProjectVersions( TEST_REPO_ID, "org.apache.archiva",
+                                                                              "archiva-modules", ALL ) );
+        assertEquals( Arrays.asList( "3" ), resolver.listProjectVersions( TEST_REPO_ID, "org.apache.archiva",
+                                                                          "archiva-parent", ALL ) );
+
+        assertEquals( Collections.<String>emptyList(), resolver.listProjectVersions( TEST_REPO_ID,
+                                                                                     "org.apache.maven.shared",
+                                                                                     "maven-downloader", ALL ) );
     }
 
     public void testGetArtifacts()
     {
-        List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( resolver.getArtifacts( TEST_REPO_ID,
-                                                                                                   "org.codehaus.plexus",
-                                                                                                   "plexus-spring",
-                                                                                                   "1.2" ) );
+        List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( resolver.readArtifactsMetadata(
+            TEST_REPO_ID, "org.codehaus.plexus", "plexus-spring", "1.2", ALL ) );
         assertEquals( 3, artifacts.size() );
         Collections.sort( artifacts, new Comparator<ArtifactMetadata>()
         {
@@ -474,10 +484,8 @@ public class Maven2RepositoryMetadataRes
     {
         ExcludesFilter<String> filter = new ExcludesFilter<String>( Collections.singletonList(
             "plexus-spring-1.2.pom" ) );
-        List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( resolver.getArtifacts( TEST_REPO_ID,
-                                                                                                   "org.codehaus.plexus",
-                                                                                                   "plexus-spring",
-                                                                                                   "1.2", filter ) );
+        List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( resolver.readArtifactsMetadata(
+            TEST_REPO_ID, "org.codehaus.plexus", "plexus-spring", "1.2", filter ) );
         assertEquals( 2, artifacts.size() );
         Collections.sort( artifacts, new Comparator<ArtifactMetadata>()
         {
@@ -493,10 +501,8 @@ public class Maven2RepositoryMetadataRes
 
     public void testGetArtifactsTimestampedSnapshots()
     {
-        List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( resolver.getArtifacts( TEST_REPO_ID,
-                                                                                                   "com.example.test",
-                                                                                                   "missing-metadata",
-                                                                                                   "1.0-SNAPSHOT" ) );
+        List<ArtifactMetadata> artifacts = new ArrayList<ArtifactMetadata>( resolver.readArtifactsMetadata(
+            TEST_REPO_ID, "com.example.test", "missing-metadata", "1.0-SNAPSHOT", ALL ) );
         assertEquals( 1, artifacts.size() );
 
         ArtifactMetadata artifact = artifacts.get( 0 );

Modified: archiva/trunk/archiva-modules/plugins/metadata-repository-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/metadata-repository-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java?rev=1051788&r1=1051787&r2=1051788&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/metadata-repository-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java (original)
+++ archiva/trunk/archiva-modules/plugins/metadata-repository-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java Wed Dec 22 08:31:56 2010
@@ -565,7 +565,7 @@ public class FileMetadataRepository
         return artifacts;
     }
 
-    public void deleteArtifact( String repoId, String namespace, String project, String version, String id )
+    public void removeArtifact( String repoId, String namespace, String project, String version, String id )
     {
         File directory = new File( getDirectory( repoId ), namespace + "/" + project + "/" + version );
 
@@ -600,7 +600,7 @@ public class FileMetadataRepository
         }
     }
 
-    public void deleteRepository( String repoId )
+    public void removeRepository( String repoId )
     {
         try
         {

Modified: archiva/trunk/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java?rev=1051788&r1=1051787&r2=1051788&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java (original)
+++ archiva/trunk/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java Wed Dec 22 08:31:56 2010
@@ -589,7 +589,7 @@ public class JcrMetadataRepository
         return artifacts;
     }
 
-    public void deleteArtifact( String repositoryId, String namespace, String projectId, String projectVersion,
+    public void removeArtifact( String repositoryId, String namespace, String projectId, String projectVersion,
                                 String id )
         throws MetadataRepositoryException
     {
@@ -608,7 +608,7 @@ public class JcrMetadataRepository
         }
     }
 
-    public void deleteRepository( String repositoryId )
+    public void removeRepository( String repositoryId )
         throws MetadataRepositoryException
     {
         try



Mime
View raw message