archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joak...@apache.org
Subject svn commit: r582987 [3/3] - in /maven/archiva/trunk: archiva-base/archiva-consumers/archiva-consumer-api/ archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/maven/archiva/consumers/ archiva-base/archiva-consumers/archiva-core-...
Date Mon, 08 Oct 2007 22:07:50 GMT
Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScanner.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScanner.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScanner.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScanner.java Mon Oct  8 15:07:39 2007
@@ -19,10 +19,9 @@
  * under the License.
  */
 
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer;
 import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
-import org.apache.maven.archiva.model.ArchivaRepository;
-import org.apache.maven.archiva.model.RepositoryContentStatistics;
 import org.apache.maven.archiva.repository.RepositoryException;
 
 import java.util.List;
@@ -36,11 +35,11 @@
 public interface RepositoryScanner
 {
     /**
-     * The value to pass to {@link #scan(ArchivaRepository, long)} to have the scan
+     * The value to pass to {@link #scan(ManagedRepositoryConfiguration, long)} to have the scan
      * operate in a fresh fashion, with no check on changes based on timestamp.
      */
     public static final long FRESH_SCAN = 0;
-    
+
     /**
      * <p>
      * Typical Ignorable Content patterns.
@@ -70,7 +69,7 @@
         "**/README*",
         "**/CHANGELOG*",
         "**/KEYS*" };
-    
+
     /**
      * Scan the repository for content changes.
      * 
@@ -83,9 +82,9 @@
      * @return the statistics for this scan.
      * @throws RepositoryException if there was a fundamental problem with getting the discoverer started.
      */
-    public RepositoryContentStatistics scan( ArchivaRepository repository, long changesSince )
+    public RepositoryScanStatistics scan( ManagedRepositoryConfiguration repository, long changesSince )
         throws RepositoryException;
-    
+
     /**
      * Scan the repository for content changes.
      * 
@@ -103,9 +102,10 @@
      * @return the statistics for this scan.
      * @throws RepositoryException if there was a fundamental problem with getting the discoverer started.
      */
-    public RepositoryContentStatistics scan( ArchivaRepository repository, List knownContentConsumers, 
-                                             List invalidContentConsumers, List ignoredContentPatterns,
-                                             long changesSince )
+    public RepositoryScanStatistics scan( ManagedRepositoryConfiguration repository,
+                                             List<KnownRepositoryContentConsumer> knownContentConsumers,
+                                             List<InvalidRepositoryContentConsumer> invalidContentConsumers,
+                                             List<String> ignoredContentPatterns, long changesSince )
         throws RepositoryException;
-    
+
 }

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScannerInstance.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScannerInstance.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScannerInstance.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/RepositoryScannerInstance.java Mon Oct  8 15:07:39 2007
@@ -24,8 +24,9 @@
 import org.apache.commons.collections.functors.IfClosure;
 import org.apache.commons.lang.SystemUtils;
 import org.apache.maven.archiva.common.utils.BaseFile;
-import org.apache.maven.archiva.model.ArchivaRepository;
-import org.apache.maven.archiva.model.RepositoryContentStatistics;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer;
+import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
 import org.apache.maven.archiva.repository.scanner.functors.ConsumerProcessFileClosure;
 import org.apache.maven.archiva.repository.scanner.functors.ConsumerWantsFilePredicate;
 import org.apache.maven.archiva.repository.scanner.functors.TriggerBeginScanClosure;
@@ -47,16 +48,16 @@
     /**
      * Consumers that process known content.
      */
-    private List knownConsumers;
+    private List<KnownRepositoryContentConsumer> knownConsumers;
 
     /**
      * Consumers that process unknown/invalid content.
      */
-    private List invalidConsumers;
+    private List<InvalidRepositoryContentConsumer> invalidConsumers;
 
-    ArchivaRepository repository;
+    private ManagedRepositoryConfiguration repository;
 
-    private RepositoryContentStatistics stats;
+    private RepositoryScanStatistics stats;
 
     private long onlyModifiedAfterTimestamp = 0;
 
@@ -66,8 +67,9 @@
 
     private Logger logger;
 
-    public RepositoryScannerInstance( ArchivaRepository repository, List knownConsumerList, List invalidConsumerList,
-                                      Logger logger )
+    public RepositoryScannerInstance( ManagedRepositoryConfiguration repository,
+                                      List<KnownRepositoryContentConsumer> knownConsumerList,
+                                      List<InvalidRepositoryContentConsumer> invalidConsumerList, Logger logger )
     {
         this.repository = repository;
         this.knownConsumers = knownConsumerList;
@@ -77,7 +79,7 @@
         this.consumerProcessFile = new ConsumerProcessFileClosure( logger );
         this.consumerWantsFile = new ConsumerWantsFilePredicate();
 
-        stats = new RepositoryContentStatistics();
+        stats = new RepositoryScanStatistics();
         stats.setRepositoryId( repository.getId() );
 
         Closure triggerBeginScan = new TriggerBeginScanClosure( repository, logger );
@@ -91,14 +93,14 @@
         }
     }
 
-    public RepositoryContentStatistics getStatistics()
+    public RepositoryScanStatistics getStatistics()
     {
         return stats;
     }
 
     public void directoryWalkStarting( File basedir )
     {
-        logger.info( "Walk Started: [" + this.repository.getId() + "] " + this.repository.getUrl() );
+        logger.info( "Walk Started: [" + this.repository.getId() + "] " + this.repository.getLocation() );
         stats.triggerStart();
     }
 
@@ -118,7 +120,7 @@
 
         stats.increaseNewFileCount();
 
-        BaseFile basefile = new BaseFile( repository.getUrl().getPath(), file );
+        BaseFile basefile = new BaseFile( repository.getLocation(), file );
         
         consumerProcessFile.setBasefile( basefile );
         consumerWantsFile.setBasefile( basefile );
@@ -135,7 +137,7 @@
 
     public void directoryWalkFinished()
     {
-        logger.info( "Walk Finished: [" + this.repository.getId() + "] " + this.repository.getUrl() );
+        logger.info( "Walk Finished: [" + this.repository.getId() + "] " + this.repository.getLocation() );
         stats.triggerFinished();
     }
 

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/functors/TriggerBeginScanClosure.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/functors/TriggerBeginScanClosure.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/functors/TriggerBeginScanClosure.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/scanner/functors/TriggerBeginScanClosure.java Mon Oct  8 15:07:39 2007
@@ -20,9 +20,9 @@
  */
 
 import org.apache.commons.collections.Closure;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.ConsumerException;
 import org.apache.maven.archiva.consumers.RepositoryContentConsumer;
-import org.apache.maven.archiva.model.ArchivaRepository;
 import org.codehaus.plexus.logging.Logger;
 
 /**
@@ -34,11 +34,11 @@
 public class TriggerBeginScanClosure
     implements Closure
 {
-    private ArchivaRepository repository;
+    private ManagedRepositoryConfiguration repository;
 
     private Logger logger;
 
-    public TriggerBeginScanClosure( ArchivaRepository repository, Logger logger )
+    public TriggerBeginScanClosure( ManagedRepositoryConfiguration repository, Logger logger )
     {
         this.repository = repository;
         this.logger = logger;

Added: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AbstractRepositoryLayerTestCase.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AbstractRepositoryLayerTestCase.java?rev=582987&view=auto
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AbstractRepositoryLayerTestCase.java (added)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AbstractRepositoryLayerTestCase.java Mon Oct  8 15:07:39 2007
@@ -0,0 +1,54 @@
+package org.apache.maven.archiva.repository;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
+import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration;
+import org.codehaus.plexus.PlexusTestCase;
+
+import java.io.File;
+
+/**
+ * AbstractRepositoryLayerTestCase 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public abstract class AbstractRepositoryLayerTestCase
+    extends PlexusTestCase
+{
+    protected ManagedRepositoryConfiguration createRepository( String id, String name, File location )
+    {
+        ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration();
+        repo.setId( id );
+        repo.setName( name );
+        repo.setLocation( location.getAbsolutePath() );
+        return repo;
+    }
+
+    protected RemoteRepositoryConfiguration createRemoteRepository( String id, String name, String url )
+    {
+        RemoteRepositoryConfiguration repo = new RemoteRepositoryConfiguration();
+        repo.setId( id );
+        repo.setName( name );
+        repo.setUrl( url );
+        return repo;
+    }
+}

Propchange: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AbstractRepositoryLayerTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AbstractRepositoryLayerTestCase.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/AbstractRepositoryLayerTestCase.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/layout/AbstractBidirectionalRepositoryLayoutTestCase.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/layout/AbstractBidirectionalRepositoryLayoutTestCase.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/layout/AbstractBidirectionalRepositoryLayoutTestCase.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/layout/AbstractBidirectionalRepositoryLayoutTestCase.java Mon Oct  8 15:07:39 2007
@@ -20,8 +20,8 @@
  */
 
 import org.apache.commons.lang.StringUtils;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.model.ArchivaArtifact;
-import org.apache.maven.archiva.model.ArchivaRepository;
 import org.apache.maven.archiva.model.ArtifactReference;
 import org.apache.maven.archiva.model.ProjectReference;
 import org.apache.maven.archiva.model.VersionedReference;
@@ -38,7 +38,7 @@
 public abstract class AbstractBidirectionalRepositoryLayoutTestCase
     extends PlexusTestCase
 {
-    protected ArchivaRepository repository;
+    protected ManagedRepositoryConfiguration repository;
 
     protected void setUp()
         throws Exception
@@ -48,7 +48,7 @@
         repository = createTestRepository();
     }
 
-    protected ArchivaRepository createTestRepository()
+    protected ManagedRepositoryConfiguration createTestRepository()
     {
         File targetDir = new File( getBasedir(), "target" );
         File testRepo = new File( targetDir, "test-repo" );
@@ -58,9 +58,11 @@
             testRepo.mkdirs();
         }
 
-        String repoUri = "file://" + StringUtils.replace( testRepo.getAbsolutePath(), "\\", "/" );
-
-        return new ArchivaRepository( "testRepo", "Test Repository", repoUri );
+        ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration();
+        repo.setId( "testRepo" );
+        repo.setName( "Test Repository" );
+        repo.setLocation( testRepo.getAbsolutePath() );
+        return repo;
     }
 
     protected ArchivaArtifact createArtifact( String groupId, String artifactId, String version, String classifier,
@@ -92,8 +94,8 @@
     protected void assertArtifactReference( ArtifactReference actualReference, String groupId, String artifactId,
                                             String version, String classifier, String type )
     {
-        String expectedId =
-            "ArtifactReference - " + groupId + ":" + artifactId + ":" + version + ":" + classifier + ":" + type;
+        String expectedId = "ArtifactReference - " + groupId + ":" + artifactId + ":" + version + ":" + classifier
+            + ":" + type;
 
         assertNotNull( expectedId + " - Should not be null.", actualReference );
 

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.java Mon Oct  8 15:07:39 2007
@@ -18,23 +18,22 @@
 
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.common.utils.PathUtil;
 import org.apache.maven.archiva.common.utils.VersionComparator;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.maven.archiva.model.ArchivaRepository;
+import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration;
 import org.apache.maven.archiva.model.ProjectReference;
 import org.apache.maven.archiva.model.VersionedReference;
 import org.apache.maven.archiva.policies.DownloadPolicy;
+import org.apache.maven.archiva.repository.AbstractRepositoryLayerTestCase;
 import org.apache.maven.archiva.repository.MockConfiguration;
 import org.apache.maven.archiva.repository.layout.LayoutException;
-import org.codehaus.plexus.PlexusTestCase;
 import org.custommonkey.xmlunit.DetailedDiff;
 import org.custommonkey.xmlunit.Diff;
 import org.custommonkey.xmlunit.XMLAssert;
 import org.xml.sax.SAXException;
 
-import javax.xml.parsers.ParserConfigurationException;
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -43,6 +42,8 @@
 import java.util.List;
 import java.util.Set;
 
+import javax.xml.parsers.ParserConfigurationException;
+
 /**
  * MetadataToolsTest
  *
@@ -50,7 +51,7 @@
  * @version $Id$
  */
 public class MetadataToolsTest
-    extends PlexusTestCase
+    extends AbstractRepositoryLayerTestCase
 {
     private MetadataTools tools;
 
@@ -65,8 +66,8 @@
     public void testGatherAvailableVersionsMissingMultipleVersions()
         throws Exception
     {
-        assertAvailableVersions( "missing_metadata_b",
-                                 Arrays.asList( "1.0", "1.0.1", "2.0", "2.0.1", "2.0-20070821-dev" ) );
+        assertAvailableVersions( "missing_metadata_b", Arrays.asList( "1.0", "1.0.1", "2.0", "2.0.1",
+                                                                      "2.0-20070821-dev" ) );
     }
 
     public void testGatherAvailableVersionsSimpleYetIncomplete()
@@ -84,10 +85,15 @@
     public void testGatherSnapshotVersionsA()
         throws Exception
     {
-        assertSnapshotVersions( "snap_shots_a", "1.0-alpha-11-SNAPSHOT", new String[]{"1.0-alpha-11-SNAPSHOT",
-            "1.0-alpha-11-20070221.194724-2", "1.0-alpha-11-20070302.212723-3", "1.0-alpha-11-20070303.152828-4",
-            "1.0-alpha-11-20070305.215149-5", "1.0-alpha-11-20070307.170909-6", "1.0-alpha-11-20070314.211405-9",
-            "1.0-alpha-11-20070316.175232-11"} );
+        assertSnapshotVersions( "snap_shots_a", "1.0-alpha-11-SNAPSHOT", new String[] {
+            "1.0-alpha-11-SNAPSHOT",
+            "1.0-alpha-11-20070221.194724-2",
+            "1.0-alpha-11-20070302.212723-3",
+            "1.0-alpha-11-20070303.152828-4",
+            "1.0-alpha-11-20070305.215149-5",
+            "1.0-alpha-11-20070307.170909-6",
+            "1.0-alpha-11-20070314.211405-9",
+            "1.0-alpha-11-20070316.175232-11" } );
     }
 
     public void testGatherSnapshotVersionsAWithProxies()
@@ -99,23 +105,28 @@
         createProxyConnector( "test-repo", "internal-snapshots" );
         createProxyConnector( "test-repo", "snapshots.codehaus.org" );
 
-        assertSnapshotVersions( "snap_shots_a", "1.0-alpha-11-SNAPSHOT", new String[]{"1.0-alpha-11-SNAPSHOT",
-            "1.0-alpha-11-20070221.194724-2", "1.0-alpha-11-20070302.212723-3", "1.0-alpha-11-20070303.152828-4",
-            "1.0-alpha-11-20070305.215149-5", "1.0-alpha-11-20070307.170909-6", "1.0-alpha-11-20070314.211405-9",
+        assertSnapshotVersions( "snap_shots_a", "1.0-alpha-11-SNAPSHOT", new String[] {
+            "1.0-alpha-11-SNAPSHOT",
+            "1.0-alpha-11-20070221.194724-2",
+            "1.0-alpha-11-20070302.212723-3",
+            "1.0-alpha-11-20070303.152828-4",
+            "1.0-alpha-11-20070305.215149-5",
+            "1.0-alpha-11-20070307.170909-6",
+            "1.0-alpha-11-20070314.211405-9",
             "1.0-alpha-11-20070315.033030-10" /* Arrives in via snapshots.codehaus.org proxy */,
-            "1.0-alpha-11-20070316.175232-11"} );
+            "1.0-alpha-11-20070316.175232-11" } );
     }
 
     public void testGetRepositorySpecificName()
     {
-        ArchivaRepository repoJavaNet = new ArchivaRepository( "maven2-repository.dev.java.net",
-                                                               "Java.net Repository for Maven 2",
-                                                               "http://download.java.net/maven/2/" );
-        ArchivaRepository repoCentral =
-            new ArchivaRepository( "central", "Central Global Repository", "http://repo1.maven.org/maven2/" );
+        RemoteRepositoryConfiguration repoJavaNet = createRemoteRepository( "maven2-repository.dev.java.net",
+                                                                            "Java.net Repository for Maven 2",
+                                                                            "http://download.java.net/maven/2/" );
+        RemoteRepositoryConfiguration repoCentral = createRemoteRepository( "central", "Central Global Repository",
+                                                                            "http://repo1.maven.org/maven2/" );
 
-        String convertedName =
-            tools.getRepositorySpecificName( repoJavaNet, "commons-lang/commons-lang/maven-metadata.xml" );
+        String convertedName = tools.getRepositorySpecificName( repoJavaNet,
+                                                                "commons-lang/commons-lang/maven-metadata.xml" );
         assertMetadataPath( "commons-lang/commons-lang/maven-metadata-maven2-repository.dev.java.net.xml",
                             convertedName );
 
@@ -140,8 +151,12 @@
     public void testUpdateProjectMissingMultipleVersions()
         throws Exception
     {
-        assertUpdatedProjectMetadata( "missing_metadata_b",
-                                      new String[]{"1.0", "1.0.1", "2.0", "2.0.1", "2.0-20070821-dev"} );
+        assertUpdatedProjectMetadata( "missing_metadata_b", new String[] {
+            "1.0",
+            "1.0.1",
+            "2.0",
+            "2.0.1",
+            "2.0-20070821-dev" } );
     }
 
     public void testUpdateProjectMissingMultipleVersionsWithProxies()
@@ -153,22 +168,30 @@
         createProxyConnector( "test-repo", "central" );
         createProxyConnector( "test-repo", "java.net" );
 
-        assertUpdatedProjectMetadata( "proxied_multi", new String[]{"1.0-spec" /* in java.net */, "1.0"
-            /* in managed, and central */, "1.0.1" /* in central */, "1.1" /* in managed */, "2.0-proposal-beta"
-            /* in java.net */, "2.0-spec" /* in java.net */, "2.0" /* in central, and java.net */, "2.0.1"
-            /* in java.net */, "2.1" /* in managed */, "3.0" /* in central */, "3.1" /* in central */}, "3.1", "3.1" );
+        assertUpdatedProjectMetadata( "proxied_multi", new String[] { 
+            "1.0-spec" /* in java.net */, 
+            "1.0" /* in managed, and central */, 
+            "1.0.1" /* in central */, 
+            "1.1" /* in managed */, 
+            "2.0-proposal-beta" /* in java.net */, 
+            "2.0-spec" /* in java.net */, 
+            "2.0" /* in central, and java.net */, 
+            "2.0.1" /* in java.net */, 
+            "2.1" /* in managed */, 
+            "3.0" /* in central */, 
+            "3.1" /* in central */}, "3.1", "3.1" );
     }
 
     public void testUpdateProjectSimpleYetIncomplete()
         throws Exception
     {
-        assertUpdatedProjectMetadata( "incomplete_metadata_a", new String[]{"1.0"} );
+        assertUpdatedProjectMetadata( "incomplete_metadata_a", new String[] { "1.0" } );
     }
 
     public void testUpdateProjectSimpleYetMissing()
         throws Exception
     {
-        assertUpdatedProjectMetadata( "missing_metadata_a", new String[]{"1.0"} );
+        assertUpdatedProjectMetadata( "missing_metadata_a", new String[] { "1.0" } );
     }
 
     public void testUpdateVersionSimple10()
@@ -314,8 +337,8 @@
         reference.setGroupId( "org.apache.archiva.metadata.tests" );
         reference.setArtifactId( artifactId );
 
-        String repoRootURL = PathUtil.toUrl( repoRootDir );
-        ArchivaRepository repo = new ArchivaRepository( "test-repo", "Test Repository: " + getName(), repoRootURL );
+        ManagedRepositoryConfiguration repo = createRepository( "test-repo", "Test Repository: "
+                                                                + getName(), repoRootDir );
 
         Set<String> testedVersionSet = tools.gatherAvailableVersions( repo, reference );
 
@@ -338,8 +361,8 @@
         reference.setArtifactId( artifactId );
         reference.setVersion( version );
 
-        String repoRootURL = PathUtil.toUrl( repoRootDir );
-        ArchivaRepository repo = new ArchivaRepository( "test-repo", "Test Repository: " + getName(), repoRootURL );
+        ManagedRepositoryConfiguration repo = createRepository( "test-repo", "Test Repository: "
+                                                                + getName(), repoRootDir );
 
         Set<String> testedVersionSet = tools.gatherSnapshotVersions( repo, reference );
 
@@ -358,19 +381,21 @@
         }
     }
 
-    private void assertMetadata( String expectedMetadata, ArchivaRepository repository, ProjectReference reference )
+    private void assertMetadata( String expectedMetadata, ManagedRepositoryConfiguration repository,
+                                 ProjectReference reference )
         throws LayoutException, IOException, SAXException, ParserConfigurationException
     {
-        File metadataFile = new File( repository.getUrl().getPath(), tools.toPath( reference ) );
+        File metadataFile = new File( repository.getLocation(), tools.toPath( reference ) );
         String actualMetadata = FileUtils.readFileToString( metadataFile, null );
 
         XMLAssert.assertXMLEqual( expectedMetadata, actualMetadata );
     }
 
-    private void assertMetadata( String expectedMetadata, ArchivaRepository repository, VersionedReference reference )
+    private void assertMetadata( String expectedMetadata, ManagedRepositoryConfiguration repository,
+                                 VersionedReference reference )
         throws LayoutException, IOException, SAXException, ParserConfigurationException
     {
-        File metadataFile = new File( repository.getUrl().getPath(), tools.toPath( reference ) );
+        File metadataFile = new File( repository.getLocation(), tools.toPath( reference ) );
         String actualMetadata = FileUtils.readFileToString( metadataFile, null );
 
         DetailedDiff detailedDiff = new DetailedDiff( new Diff( expectedMetadata, actualMetadata ) );
@@ -396,7 +421,7 @@
                                                String releaseVersion )
         throws IOException, LayoutException, RepositoryMetadataException, SAXException, ParserConfigurationException
     {
-        ArchivaRepository testRepo = createTestRepo();
+        ManagedRepositoryConfiguration testRepo = createTestRepo();
         ProjectReference reference = new ProjectReference();
         reference.setGroupId( "org.apache.archiva.metadata.tests" );
         reference.setArtifactId( artifactId );
@@ -439,7 +464,7 @@
     private void assertUpdatedReleaseVersionMetadata( String artifactId, String version )
         throws IOException, LayoutException, RepositoryMetadataException, SAXException, ParserConfigurationException
     {
-        ArchivaRepository testRepo = createTestRepo();
+        ManagedRepositoryConfiguration testRepo = createTestRepo();
         VersionedReference reference = new VersionedReference();
         reference.setGroupId( "org.apache.archiva.metadata.tests" );
         reference.setArtifactId( artifactId );
@@ -463,7 +488,7 @@
                                                        String expectedTime, String expectedBuildNumber )
         throws IOException, LayoutException, RepositoryMetadataException, SAXException, ParserConfigurationException
     {
-        ArchivaRepository testRepo = createTestRepo();
+        ManagedRepositoryConfiguration testRepo = createTestRepo();
         VersionedReference reference = new VersionedReference();
         reference.setGroupId( "org.apache.archiva.metadata.tests" );
         reference.setArtifactId( artifactId );
@@ -516,7 +541,7 @@
         config.triggerChange( prefix + ".policies.cache-failures", connectorConfig.getPolicy( "cache-failures", "" ) );
     }
 
-    private ArchivaRepository createTestRepo()
+    private ManagedRepositoryConfiguration createTestRepo()
         throws IOException
     {
         File repoRoot = new File( "target/metadata-tests/" + getName() );
@@ -527,12 +552,10 @@
 
         repoRoot.mkdirs();
 
-        String repoRootURL = PathUtil.toUrl( repoRoot );
-
-        return new ArchivaRepository( "test-repo", "Test Repository: " + getName(), repoRootURL );
+        return createRepository( "test-repo", "Test Repository: " + getName(), repoRoot );
     }
 
-    private void prepTestRepo( ArchivaRepository repo, ProjectReference reference )
+    private void prepTestRepo( ManagedRepositoryConfiguration repo, ProjectReference reference )
         throws IOException
     {
         String groupDir = StringUtils.replaceChars( reference.getGroupId(), '.', '/' );
@@ -540,7 +563,7 @@
 
         File srcRepoDir = new File( "src/test/repositories/metadata-repository" );
         File srcDir = new File( srcRepoDir, path );
-        File destDir = new File( repo.getUrl().getPath(), path );
+        File destDir = new File( repo.getLocation(), path );
 
         assertTrue( "Source Dir exists: " + srcDir, srcDir.exists() );
         destDir.mkdirs();
@@ -548,7 +571,7 @@
         FileUtils.copyDirectory( srcDir, destDir );
     }
 
-    private void prepTestRepo( ArchivaRepository repo, VersionedReference reference )
+    private void prepTestRepo( ManagedRepositoryConfiguration repo, VersionedReference reference )
         throws IOException
     {
         ProjectReference projectRef = new ProjectReference();

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilterTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilterTest.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilterTest.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/project/filters/EffectiveProjectModelFilterTest.java Mon Oct  8 15:07:39 2007
@@ -20,10 +20,11 @@
  */
 
 import org.apache.maven.archiva.common.utils.VersionUtil;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.model.ArchivaProjectModel;
-import org.apache.maven.archiva.model.ArchivaRepository;
 import org.apache.maven.archiva.model.Dependency;
 import org.apache.maven.archiva.model.Individual;
+import org.apache.maven.archiva.repository.AbstractRepositoryLayerTestCase;
 import org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayout;
 import org.apache.maven.archiva.repository.layout.DefaultBidirectionalRepositoryLayout;
 import org.apache.maven.archiva.repository.project.ProjectModelException;
@@ -32,8 +33,7 @@
 import org.apache.maven.archiva.repository.project.ProjectModelResolver;
 import org.apache.maven.archiva.repository.project.ProjectModelResolverFactory;
 import org.apache.maven.archiva.repository.project.readers.ProjectModel400Reader;
-import org.apache.maven.archiva.repository.project.resolvers.RepositoryProjectResolver;
-import org.codehaus.plexus.PlexusTestCase;
+import org.apache.maven.archiva.repository.project.resolvers.ManagedRepositoryProjectResolver;
 
 import java.io.File;
 import java.util.HashMap;
@@ -48,7 +48,7 @@
  * @version $Id$
  */
 public class EffectiveProjectModelFilterTest
-    extends PlexusTestCase
+    extends AbstractRepositoryLayerTestCase
 {
     private static final String DEFAULT_REPOSITORY = "src/test/repositories/default-repository";
 
@@ -72,12 +72,11 @@
     {
         File defaultRepoDir = new File( getBasedir(), DEFAULT_REPOSITORY );
 
-        ArchivaRepository repo = new ArchivaRepository( "defaultTestRepo", "Default Test Repo", "file://"
-            + defaultRepoDir.getAbsolutePath() );
+        ManagedRepositoryConfiguration repo = createRepository( "defaultTestRepo", "Default Test Repo", defaultRepoDir );
 
         ProjectModelReader reader = new ProjectModel400Reader();
         BidirectionalRepositoryLayout layout = new DefaultBidirectionalRepositoryLayout();
-        RepositoryProjectResolver resolver = new RepositoryProjectResolver( repo, reader, layout );
+        ManagedRepositoryProjectResolver resolver = new ManagedRepositoryProjectResolver( repo, reader, layout );
 
         return resolver;
     }

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/InvalidScanConsumer.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/InvalidScanConsumer.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/InvalidScanConsumer.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/InvalidScanConsumer.java Mon Oct  8 15:07:39 2007
@@ -19,10 +19,10 @@
  * under the License.
  */
 
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
 import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer;
-import org.apache.maven.archiva.model.ArchivaRepository;
 
 import java.util.List;
 
@@ -38,7 +38,7 @@
 {
     private int processCount = 0;
 
-    public void beginScan( ArchivaRepository repository )
+    public void beginScan( ManagedRepositoryConfiguration repository )
         throws ConsumerException
     {
         /* do nothing */

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/KnownScanConsumer.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/KnownScanConsumer.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/KnownScanConsumer.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/KnownScanConsumer.java Mon Oct  8 15:07:39 2007
@@ -19,10 +19,10 @@
  * under the License.
  */
 
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
 import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
-import org.apache.maven.archiva.model.ArchivaRepository;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -68,7 +68,7 @@
         return "Scan Consumer (for testing)";
     }
 
-    public void beginScan( ArchivaRepository repository )
+    public void beginScan( ManagedRepositoryConfiguration repository )
         throws ConsumerException
     {
         /* do nothing */

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumerUtilTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumerUtilTest.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumerUtilTest.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumerUtilTest.java Mon Oct  8 15:07:39 2007
@@ -19,10 +19,11 @@
  * under the License.
  */
 
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.InvalidRepositoryContentConsumer;
 import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
 import org.apache.maven.archiva.consumers.RepositoryContentConsumer;
-import org.apache.maven.archiva.model.ArchivaRepository;
+import org.apache.maven.archiva.repository.AbstractRepositoryLayerTestCase;
 import org.codehaus.plexus.PlexusTestCase;
 import org.easymock.MockControl;
 
@@ -38,7 +39,7 @@
  * @version $Id$
  */
 public class RepositoryContentConsumerUtilTest
-    extends PlexusTestCase
+    extends AbstractRepositoryLayerTestCase
 {
     private RepositoryContentConsumers lookupRepositoryConsumerUtil()
         throws Exception
@@ -118,8 +119,7 @@
         InvalidRepositoryContentConsumer invalidConsumer = (InvalidRepositoryContentConsumer) invalidControl.getMock();
         consumers.setAvailableInvalidConsumers( Collections.singletonList( invalidConsumer ) );
 
-        ArchivaRepository repo =
-            new ArchivaRepository( "id", "name", getTestFile( "target/test-repo" ).toURL().toExternalForm() );
+        ManagedRepositoryConfiguration repo = createRepository( "id", "name", getTestFile( "target/test-repo" ) );
         File testFile = getTestFile( "target/test-repo/path/to/test-file.txt" );
 
         knownConsumer.beginScan( repo );

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryScannerTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryScannerTest.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryScannerTest.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/RepositoryScannerTest.java Mon Oct  8 15:07:39 2007
@@ -19,11 +19,9 @@
  * under the License.
  */
 
-import org.apache.commons.lang.StringUtils;
-import org.apache.maven.archiva.model.ArchivaRepository;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.model.RepositoryContentStatistics;
-import org.apache.maven.archiva.repository.RepositoryException;
-import org.codehaus.plexus.PlexusTestCase;
+import org.apache.maven.archiva.repository.AbstractRepositoryLayerTestCase;
 
 import java.io.File;
 import java.util.ArrayList;
@@ -37,7 +35,7 @@
  * @version $Id$
  */
 public class RepositoryScannerTest
-    extends PlexusTestCase
+    extends AbstractRepositoryLayerTestCase
 {
     private static final String[] ARTIFACT_PATTERNS = new String[] {
         "**/*.jar",
@@ -47,29 +45,25 @@
         "**/*.war",
         "**/*.tar.gz" };
 
-    private ArchivaRepository createDefaultRepository()
+    private ManagedRepositoryConfiguration createDefaultRepository()
     {
         File repoDir = new File( getBasedir(), "src/test/repositories/default-repository" );
 
         assertTrue( "Default Test Repository should exist.", repoDir.exists() && repoDir.isDirectory() );
-
-        String repoUri = "file://" + StringUtils.replace( repoDir.getAbsolutePath(), "\\", "/" );
-
-        ArchivaRepository repo = new ArchivaRepository( "testDefaultRepo", "Test Default Repository", repoUri );
+        
+        ManagedRepositoryConfiguration repo = createRepository( "testDefaultRepo", "Test Default Repository", repoDir );
 
         return repo;
     }
 
-    private ArchivaRepository createLegacyRepository()
+    private ManagedRepositoryConfiguration createLegacyRepository()
     {
         File repoDir = new File( getBasedir(), "src/test/repositories/legacy-repository" );
 
         assertTrue( "Legacy Test Repository should exist.", repoDir.exists() && repoDir.isDirectory() );
 
-        String repoUri = "file://" + StringUtils.replace( repoDir.getAbsolutePath(), "\\", "/" );
-
-        ArchivaRepository repo = new ArchivaRepository( "testLegacyRepo", "Test Legacy Repository", repoUri );
-        repo.getModel().setLayoutName( "legacy" );
+        ManagedRepositoryConfiguration repo = createRepository( "testLegacyRepo", "Test Legacy Repository", repoDir );
+        repo.setLayout( "legacy" );
 
         return repo;
     }
@@ -99,7 +93,7 @@
     public void testDefaultRepositoryScanner()
         throws Exception
     {
-        ArchivaRepository repository = createDefaultRepository();
+        ManagedRepositoryConfiguration repository = createDefaultRepository();
 
         List knownConsumers = new ArrayList();
         KnownScanConsumer consumer = new KnownScanConsumer();
@@ -166,7 +160,7 @@
         actualArtifactPaths.add( "org/apache/testgroup/discovery/1.0/discovery-1.0.pom" );
         actualArtifactPaths.add( "javax/sql/jdbc/2.0/jdbc-2.0.jar" );
 
-        ArchivaRepository repository = createDefaultRepository();
+        ManagedRepositoryConfiguration repository = createDefaultRepository();
 
         List knownConsumers = new ArrayList();
         KnownScanConsumer consumer = new KnownScanConsumer();
@@ -202,7 +196,7 @@
         actualMetadataPaths.add( "javax/sql/maven-metadata-repository.xml" );
         actualMetadataPaths.add( "javax/maven-metadata.xml" );
 
-        ArchivaRepository repository = createDefaultRepository();
+        ManagedRepositoryConfiguration repository = createDefaultRepository();
 
         List knownConsumers = new ArrayList();
         KnownScanConsumer knownConsumer = new KnownScanConsumer();
@@ -238,7 +232,7 @@
         actualProjectPaths.add( "org/apache/maven/samplejar/1.0/samplejar-1.0.pom" );
         actualProjectPaths.add( "org/apache/testgroup/discovery/1.0/discovery-1.0.pom" );
 
-        ArchivaRepository repository = createDefaultRepository();
+        ManagedRepositoryConfiguration repository = createDefaultRepository();
 
         List knownConsumers = new ArrayList();
         KnownScanConsumer consumer = new KnownScanConsumer();
@@ -278,7 +272,7 @@
         actualArtifactPaths.add( "org.apache.maven.update/jars/test-not-updated-1.0.jar" );
         actualArtifactPaths.add( "org.apache.maven.update/jars/test-updated-1.0.jar" );
 
-        ArchivaRepository repository = createLegacyRepository();
+        ManagedRepositoryConfiguration repository = createLegacyRepository();
 
         List knownConsumers = new ArrayList();
         KnownScanConsumer consumer = new KnownScanConsumer();

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/SampleKnownConsumer.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/SampleKnownConsumer.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/SampleKnownConsumer.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/scanner/SampleKnownConsumer.java Mon Oct  8 15:07:39 2007
@@ -19,10 +19,10 @@
  * under the License.
  */
 
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
 import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
-import org.apache.maven.archiva.model.ArchivaRepository;
 
 import java.util.List;
 
@@ -39,7 +39,7 @@
   extends AbstractMonitoredConsumer
     implements KnownRepositoryContentConsumer
 {
-    public void beginScan( ArchivaRepository repository )
+    public void beginScan( ManagedRepositoryConfiguration repository )
         throws ConsumerException
     {
         /* nothing to do */

Modified: maven/archiva/trunk/archiva-cli/src/main/java/org/apache/maven/archiva/cli/AbstractProgressConsumer.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-cli/src/main/java/org/apache/maven/archiva/cli/AbstractProgressConsumer.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-cli/src/main/java/org/apache/maven/archiva/cli/AbstractProgressConsumer.java (original)
+++ maven/archiva/trunk/archiva-cli/src/main/java/org/apache/maven/archiva/cli/AbstractProgressConsumer.java Mon Oct  8 15:07:39 2007
@@ -19,10 +19,10 @@
  * under the License.
  */
 
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
 import org.apache.maven.archiva.consumers.RepositoryContentConsumer;
-import org.apache.maven.archiva.model.ArchivaRepository;
 
 /**
  * AbstractProgressConsumer 
@@ -36,7 +36,7 @@
 {
     private int count = 0;
 
-    public void beginScan( ArchivaRepository repository )
+    public void beginScan( ManagedRepositoryConfiguration repository )
         throws ConsumerException
     {
         this.count = 0;

Modified: maven/archiva/trunk/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java (original)
+++ maven/archiva/trunk/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ArchivaCli.java Mon Oct  8 15:07:39 2007
@@ -24,13 +24,14 @@
 import org.apache.commons.cli.Options;
 import org.apache.commons.lang.StringUtils;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.ConsumerException;
 import org.apache.maven.archiva.consumers.RepositoryContentConsumer;
 import org.apache.maven.archiva.converter.RepositoryConversionException;
 import org.apache.maven.archiva.converter.legacy.LegacyRepositoryConverter;
-import org.apache.maven.archiva.model.ArchivaRepository;
 import org.apache.maven.archiva.model.RepositoryContentStatistics;
 import org.apache.maven.archiva.repository.RepositoryException;
+import org.apache.maven.archiva.repository.scanner.RepositoryScanStatistics;
 import org.apache.maven.archiva.repository.scanner.RepositoryScanner;
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
@@ -167,7 +168,10 @@
     {
         String path = cli.getOptionValue( SCAN );
 
-        ArchivaRepository repo = new ArchivaRepository( "cliRepo", "Archiva CLI Provided Repo", "file://" + path );
+        ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration();
+        repo.setId( "cliRepo" );
+        repo.setName( "Archiva CLI Provided Repo" );
+        repo.setLocation( path );
 
         List knownConsumerList = new ArrayList();
 
@@ -182,8 +186,8 @@
 
         try
         {
-            RepositoryContentStatistics stats = scanner.scan( repo, knownConsumerList, invalidConsumerList,
-                                                              ignoredContent, RepositoryScanner.FRESH_SCAN );
+            RepositoryScanStatistics stats = scanner.scan( repo, knownConsumerList, invalidConsumerList,
+                                                           ignoredContent, RepositoryScanner.FRESH_SCAN );
 
             System.out.println( "\n" + stats.toDump( repo ) );
         }

Modified: maven/archiva/trunk/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ProjectReaderConsumer.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ProjectReaderConsumer.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ProjectReaderConsumer.java (original)
+++ maven/archiva/trunk/archiva-cli/src/main/java/org/apache/maven/archiva/cli/ProjectReaderConsumer.java Mon Oct  8 15:07:39 2007
@@ -19,10 +19,10 @@
  * under the License.
  */
 
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.ConsumerException;
 import org.apache.maven.archiva.consumers.RepositoryContentConsumer;
 import org.apache.maven.archiva.model.ArchivaProjectModel;
-import org.apache.maven.archiva.model.ArchivaRepository;
 import org.apache.maven.archiva.repository.project.ProjectModelException;
 import org.apache.maven.archiva.repository.project.ProjectModelReader;
 import org.apache.maven.archiva.repository.project.readers.ProjectModel400Reader;
@@ -57,7 +57,7 @@
 
     private ProjectModelReader reader;
 
-    private ArchivaRepository repo;
+    private ManagedRepositoryConfiguration repo;
 
     private List includes;
 
@@ -94,7 +94,7 @@
         return includes;
     }
 
-    public void beginScan( ArchivaRepository repository )
+    public void beginScan( ManagedRepositoryConfiguration repository )
         throws ConsumerException
     {
         super.beginScan( repository );
@@ -106,7 +106,7 @@
     {
         super.processFile( path );
 
-        File pomFile = new File( repo.getUrl().getPath(), path );
+        File pomFile = new File( repo.getLocation(), path );
         try
         {
             ArchivaProjectModel model = reader.read( pomFile );

Modified: maven/archiva/trunk/archiva-database/src/main/java/org/apache/maven/archiva/database/ArchivaDAO.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-database/src/main/java/org/apache/maven/archiva/database/ArchivaDAO.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-database/src/main/java/org/apache/maven/archiva/database/ArchivaDAO.java (original)
+++ maven/archiva/trunk/archiva-database/src/main/java/org/apache/maven/archiva/database/ArchivaDAO.java Mon Oct  8 15:07:39 2007
@@ -52,7 +52,5 @@
 
     ProjectModelDAO getProjectModelDAO();
 
-    RepositoryDAO getRepositoryDAO();
-
     RepositoryProblemDAO getRepositoryProblemDAO();
 }

Modified: maven/archiva/trunk/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoArchivaDAO.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoArchivaDAO.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoArchivaDAO.java (original)
+++ maven/archiva/trunk/archiva-database/src/main/java/org/apache/maven/archiva/database/jdo/JdoArchivaDAO.java Mon Oct  8 15:07:39 2007
@@ -22,7 +22,6 @@
 import org.apache.maven.archiva.database.ArchivaDAO;
 import org.apache.maven.archiva.database.ArtifactDAO;
 import org.apache.maven.archiva.database.ProjectModelDAO;
-import org.apache.maven.archiva.database.RepositoryDAO;
 import org.apache.maven.archiva.database.RepositoryProblemDAO;
 import org.apache.maven.archiva.database.SimpleConstraint;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
@@ -60,11 +59,6 @@
     /**
      * @plexus.requirement role-hint="jdo"
      */
-    private RepositoryDAO repositoryDAO;
-
-    /**
-     * @plexus.requirement role-hint="jdo"
-     */
     private RepositoryProblemDAO repositoryProblemDAO;
 
     public List query( SimpleConstraint constraint )
@@ -85,11 +79,6 @@
     public ProjectModelDAO getProjectModelDAO()
     {
         return projectModelDAO;
-    }
-
-    public RepositoryDAO getRepositoryDAO()
-    {
-        return repositoryDAO;
     }
 
     public RepositoryProblemDAO getRepositoryProblemDAO()

Modified: maven/archiva/trunk/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoArchivaDAOTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoArchivaDAOTest.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoArchivaDAOTest.java (original)
+++ maven/archiva/trunk/archiva-database/src/test/java/org/apache/maven/archiva/database/jdo/JdoArchivaDAOTest.java Mon Oct  8 15:07:39 2007
@@ -33,6 +33,7 @@
     public void testSubDAOs()
     {
         assertNotNull( "Artifact DAO", dao.getArtifactDAO() );
-        assertNotNull( "Repository DAO", dao.getRepositoryDAO() );
+        assertNotNull( "Project Model DAO", dao.getProjectModelDAO() );
+        assertNotNull( "Repository Problem DAO", dao.getRepositoryProblemDAO() );
     }
 }

Modified: maven/archiva/trunk/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/LocationArtifactsConsumer.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/LocationArtifactsConsumer.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/LocationArtifactsConsumer.java (original)
+++ maven/archiva/trunk/archiva-reporting/archiva-artifact-reports/src/main/java/org/apache/maven/archiva/reporting/artifact/LocationArtifactsConsumer.java Mon Oct  8 15:07:39 2007
@@ -31,9 +31,7 @@
 import org.apache.maven.archiva.database.ArchivaDatabaseException;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 import org.apache.maven.archiva.model.ArchivaProjectModel;
-import org.apache.maven.archiva.model.ArchivaRepository;
 import org.apache.maven.archiva.model.RepositoryProblem;
-import org.apache.maven.archiva.repository.ArchivaConfigurationAdaptor;
 import org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayout;
 import org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayoutFactory;
 import org.apache.maven.archiva.repository.layout.LayoutException;
@@ -142,9 +140,9 @@
     public void processArchivaArtifact( ArchivaArtifact artifact )
         throws ConsumerException
     {
-        ArchivaRepository repository = findRepository( artifact );
+        ManagedRepositoryConfiguration repository = findRepository( artifact );
 
-        File artifactFile = new File( repository.getUrl().toString(), toPath( artifact ) );
+        File artifactFile = new File( repository.getLocation(), toPath( artifact ) );
         ArchivaProjectModel fsModel = readFilesystemModel( artifactFile );
         ArchivaProjectModel embeddedModel = readEmbeddedModel( artifact, artifactFile );
 
@@ -287,9 +285,9 @@
         return new File( pomFilename );
     }
 
-    private ArchivaRepository findRepository( ArchivaArtifact artifact )
+    private ManagedRepositoryConfiguration findRepository( ArchivaArtifact artifact )
     {
-        return (ArchivaRepository) this.repositoryMap.get( artifact.getModel().getRepositoryId() );
+        return (ManagedRepositoryConfiguration) this.repositoryMap.get( artifact.getModel().getRepositoryId() );
     }
 
     private String toPath( ArchivaArtifact artifact )
@@ -337,12 +335,12 @@
         {
             this.repositoryMap.clear();
 
-            Map<String, ManagedRepositoryConfiguration> map =
+            Map<String, ManagedRepositoryConfiguration> map = 
                 configuration.getConfiguration().getManagedRepositoriesAsMap();
+            
             for ( Map.Entry<String, ManagedRepositoryConfiguration> entry : map.entrySet() )
             {
-                ArchivaRepository repository = ArchivaConfigurationAdaptor.toArchivaRepository( entry.getValue() );
-                this.repositoryMap.put( entry.getKey(), repository );
+                this.repositoryMap.put( entry.getKey(), entry.getValue() );
             }
         }
     }

Modified: maven/archiva/trunk/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutor.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutor.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutor.java (original)
+++ maven/archiva/trunk/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutor.java Mon Oct  8 15:07:39 2007
@@ -21,13 +21,13 @@
 
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
+import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.database.ArchivaDAO;
-import org.apache.maven.archiva.database.ArchivaDatabaseException;
-import org.apache.maven.archiva.database.RepositoryDAO;
 import org.apache.maven.archiva.database.constraints.MostRecentRepositoryScanStatistics;
-import org.apache.maven.archiva.model.ArchivaRepository;
 import org.apache.maven.archiva.model.RepositoryContentStatistics;
 import org.apache.maven.archiva.repository.RepositoryException;
+import org.apache.maven.archiva.repository.scanner.RepositoryScanStatistics;
 import org.apache.maven.archiva.repository.scanner.RepositoryScanner;
 import org.apache.maven.archiva.scheduled.tasks.RepositoryTask;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
@@ -57,11 +57,11 @@
      * @plexus.requirement role-hint="jdo"
      */
     private ArchivaDAO dao;
-
+    
     /**
-     * @plexus.requirement role-hint="jdo"
+     * @plexus.requirement
      */
-    private RepositoryDAO repositoryDAO;
+    private ArchivaConfiguration archivaConfiguration;
 
     /**
      * The repository scanner component.
@@ -90,11 +90,11 @@
         
         try
         {
-            ArchivaRepository arepo = repositoryDAO.getRepository( repoTask.getRepositoryId() );
+            ManagedRepositoryConfiguration arepo = archivaConfiguration.getConfiguration().findManagedRepositoryById( repoTask.getRepositoryId() );
 
             long sinceWhen = RepositoryScanner.FRESH_SCAN;
 
-            List results = dao.query( new MostRecentRepositoryScanStatistics( arepo.getId() ) );
+            List<RepositoryContentStatistics> results = dao.query( new MostRecentRepositoryScanStatistics( arepo.getId() ) );
 
             if ( CollectionUtils.isNotEmpty( results ) )
             {
@@ -102,15 +102,19 @@
                 sinceWhen = lastStats.getWhenGathered().getTime() + lastStats.getDuration();
             }
 
-            RepositoryContentStatistics stats = repoScanner.scan( arepo, sinceWhen );
+            RepositoryScanStatistics stats = repoScanner.scan( arepo, sinceWhen );
 
             getLogger().info( "Finished repository task: " + stats.toDump( arepo ) );
             
-            stats = (RepositoryContentStatistics) dao.save( stats );
-        }
-        catch ( ArchivaDatabaseException e )
-        {
-            throw new TaskExecutionException( "Database error when executing repository job.", e );
+            // I hate jpox and modello
+            RepositoryContentStatistics dbstats = new RepositoryContentStatistics();
+            dbstats.setDuration( stats.getDuration() );
+            dbstats.setNewFileCount( stats.getNewFileCount() );
+            dbstats.setRepositoryId( stats.getRepositoryId() );
+            dbstats.setTotalFileCount( stats.getTotalFileCount() );
+            dbstats.setWhenGathered( stats.getWhenGathered() );
+            
+            dao.save( dbstats );
         }
         catch ( RepositoryException e )
         {

Modified: maven/archiva/trunk/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaDatabaseUpdateTaskExecutorTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaDatabaseUpdateTaskExecutorTest.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaDatabaseUpdateTaskExecutorTest.java (original)
+++ maven/archiva/trunk/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaDatabaseUpdateTaskExecutorTest.java Mon Oct  8 15:07:39 2007
@@ -20,12 +20,11 @@
  */
 
 import org.apache.commons.lang.StringUtils;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.database.ArchivaDAO;
 import org.apache.maven.archiva.database.ArtifactDAO;
-import org.apache.maven.archiva.database.RepositoryDAO;
 import org.apache.maven.archiva.database.constraints.ArtifactsProcessedConstraint;
 import org.apache.maven.archiva.model.ArchivaArtifact;
-import org.apache.maven.archiva.model.ArchivaRepository;
 import org.apache.maven.archiva.scheduled.tasks.DatabaseTask;
 import org.codehaus.plexus.PlexusTestCase;
 import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
@@ -142,28 +141,13 @@
     public void testExecutor()
         throws Exception
     {
-        RepositoryDAO repoDao = dao.getRepositoryDAO();
-
         File repoDir = new File( getBasedir(), "src/test/repositories/default-repository" );
 
         assertTrue( "Default Test Repository should exist.", repoDir.exists() && repoDir.isDirectory() );
 
-        String repoUri = "file://" + StringUtils.replace( repoDir.getAbsolutePath(), "\\", "/" );
-
-        // Create it
-        ArchivaRepository repo = repoDao.createRepository( "testRepo", "Test Repository", repoUri );
+        ManagedRepositoryConfiguration repo = createRepository( "testRepo", "Test Repository", repoDir );
         assertNotNull( repo );
 
-        // Set some mandatory values
-        repo.getModel().setCreationSource( "Test Case" );
-        repo.getModel().setLayoutName( "default" );
-
-        // Save it.
-        ArchivaRepository repoSaved = repoDao.saveRepository( repo );
-        assertNotNull( repoSaved );
-        assertNotNull( repoSaved.getModel() );
-        assertEquals( "testRepo", JDOHelper.getObjectId( repoSaved.getModel() ).toString() );
-
         ArtifactDAO adao = dao.getArtifactDAO();
 
         ArchivaArtifact sqlArtifact = adao.createArtifact( "javax.sql", "jdbc", "2.0", "", "jar" );
@@ -204,5 +188,14 @@
         List processedResultList = adao.queryArtifacts( new ArtifactsProcessedConstraint( true ) );
         assertNotNull( "Processed Results should not be null.", processedResultList );
         assertEquals( "Incorrect number of processed artifacts detected.", 1, processedResultList.size() );
+    }
+    
+    protected ManagedRepositoryConfiguration createRepository( String id, String name, File location )
+    {
+        ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration();
+        repo.setId( id );
+        repo.setName( name );
+        repo.setLocation( location.getAbsolutePath() );
+        return repo;
     }
 }

Modified: maven/archiva/trunk/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.java (original)
+++ maven/archiva/trunk/archiva-scheduled/src/test/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.java Mon Oct  8 15:07:39 2007
@@ -19,12 +19,12 @@
  * under the License.
  */
 
-import org.apache.commons.lang.StringUtils;
+import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.configuration.Configuration;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.database.ArchivaDAO;
 import org.apache.maven.archiva.database.ArtifactDAO;
-import org.apache.maven.archiva.database.RepositoryDAO;
 import org.apache.maven.archiva.database.constraints.ArtifactsProcessedConstraint;
-import org.apache.maven.archiva.model.ArchivaRepository;
 import org.apache.maven.archiva.scheduled.tasks.RepositoryTask;
 import org.codehaus.plexus.PlexusTestCase;
 import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
@@ -39,7 +39,6 @@
 import java.util.Map;
 import java.util.Properties;
 
-import javax.jdo.JDOHelper;
 import javax.jdo.PersistenceManager;
 import javax.jdo.PersistenceManagerFactory;
 
@@ -140,28 +139,18 @@
 
     public void testExecutor() throws Exception
     {
-        RepositoryDAO repoDao = dao.getRepositoryDAO();
-
         File repoDir = new File( getBasedir(), "src/test/repositories/default-repository" );
 
         assertTrue( "Default Test Repository should exist.", repoDir.exists() && repoDir.isDirectory() );
 
-        String repoUri = "file://" + StringUtils.replace( repoDir.getAbsolutePath(), "\\", "/" );
+        ArchivaConfiguration archivaConfig = (ArchivaConfiguration) lookup( ArchivaConfiguration.class );
+        assertNotNull( archivaConfig );
         
         // Create it
-        ArchivaRepository repo =
-            repoDao.createRepository( "testRepo", "Test Repository", repoUri );
+        ManagedRepositoryConfiguration repo = createRepository( "testRepo", "Test Repository", repoDir );
         assertNotNull( repo );
-
-        // Set some mandatory values
-        repo.getModel().setCreationSource( "Test Case" );
-        repo.getModel().setLayoutName( "default" );
-
-        // Save it.
-        ArchivaRepository repoSaved = repoDao.saveRepository( repo );
-        assertNotNull( repoSaved );
-        assertNotNull( repoSaved.getModel() );
-        assertEquals( "testRepo", JDOHelper.getObjectId( repoSaved.getModel() ).toString() );
+        archivaConfig.getConfiguration().getManagedRepositories().clear();
+        archivaConfig.getConfiguration().addManagedRepository( repo );
 
         RepositoryTask repoTask = new RepositoryTask();
         
@@ -175,5 +164,14 @@
         
         assertNotNull( unprocessedResultList );
         assertEquals("Incorrect number of unprocessed artifacts detected.", 8, unprocessedResultList.size() );
+    }
+    
+    protected ManagedRepositoryConfiguration createRepository( String id, String name, File location )
+    {
+        ManagedRepositoryConfiguration repo = new ManagedRepositoryConfiguration();
+        repo.setId( id );
+        repo.setName( name );
+        repo.setLocation( location.getAbsolutePath() );
+        return repo;
     }
 }

Modified: maven/archiva/trunk/archiva-scheduled/src/test/resources/archiva-test.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-scheduled/src/test/resources/archiva-test.xml?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-scheduled/src/test/resources/archiva-test.xml (original)
+++ maven/archiva/trunk/archiva-scheduled/src/test/resources/archiva-test.xml Mon Oct  8 15:07:39 2007
@@ -19,18 +19,18 @@
   -->
 
 <configuration>
-  <repositories>
-    <repository>
+  <managedRepositories>
+    <managedRepository>
       <id>testRepo</id>
       <name>Archiva Test Repository</name>
-      <url>file://${basedir}/src/test/repositories/default-repository</url>
+      <location>${basedir}/src/test/repositories/default-repository</location>
       <layout>default</layout>
       <releases>true</releases>
       <snapshots>false</snapshots>
       <indexed>true</indexed>
       <refreshCronExpression>0 0 * * ?</refreshCronExpression>
-    </repository>
-  </repositories>
+    </managedRepository>
+  </managedRepositories>
 
   <proxyConnectors />
 

Modified: maven/archiva/trunk/archiva-scheduled/src/test/resources/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-scheduled/src/test/resources/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.xml?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-scheduled/src/test/resources/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.xml (original)
+++ maven/archiva/trunk/archiva-scheduled/src/test/resources/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.xml Mon Oct  8 15:07:39 2007
@@ -33,9 +33,8 @@
           <field-name>dao</field-name>
         </requirement>
         <requirement>
-          <role>org.apache.maven.archiva.database.RepositoryDAO</role>
-          <role-hint>jdo</role-hint>
-          <field-name>repositoryDAO</field-name>
+          <role>org.apache.maven.archiva.configuration.ArchivaConfiguration</role>
+          <field-name>archivaConfiguration</field-name>
         </requirement>
         <requirement>
           <role>org.apache.maven.archiva.repository.scanner.RepositoryScanner</role>

Modified: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java (original)
+++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java Mon Oct  8 15:07:39 2007
@@ -22,13 +22,11 @@
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.Configuration;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.maven.archiva.model.ArchivaRepository;
 import org.apache.maven.archiva.model.ArtifactReference;
 import org.apache.maven.archiva.model.ProjectReference;
 import org.apache.maven.archiva.model.VersionedReference;
 import org.apache.maven.archiva.proxy.ProxyException;
 import org.apache.maven.archiva.proxy.RepositoryProxyConnectors;
-import org.apache.maven.archiva.repository.ArchivaConfigurationAdaptor;
 import org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayout;
 import org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayoutFactory;
 import org.apache.maven.archiva.repository.layout.LayoutException;
@@ -38,21 +36,21 @@
 import org.apache.maven.model.Model;
 import org.apache.maven.model.Relocation;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
-import org.apache.maven.wagon.ResourceDoesNotExistException;
 import org.codehaus.plexus.webdav.AbstractDavServerComponent;
 import org.codehaus.plexus.webdav.DavServerComponent;
 import org.codehaus.plexus.webdav.DavServerException;
 import org.codehaus.plexus.webdav.servlet.DavServerRequest;
 import org.codehaus.plexus.webdav.util.WebdavMethodUtil;
 
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletResponse;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.IOException;
 
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletResponse;
+
 /**
  * ProxiedDavServer
  *
@@ -91,9 +89,7 @@
 
     private BidirectionalRepositoryLayout layout;
 
-    private ManagedRepositoryConfiguration repositoryConfiguration;
-
-    private ArchivaRepository managedRepository;
+    private ManagedRepositoryConfiguration managedRepository;
 
     public String getPrefix()
     {
@@ -122,14 +118,11 @@
 
         Configuration config = archivaConfiguration.getConfiguration();
 
-        repositoryConfiguration = config.findManagedRepositoryById( getPrefix() );
-
-        managedRepository =
-            ArchivaConfigurationAdaptor.toArchivaRepository( repositoryConfiguration );
+        managedRepository = config.findManagedRepositoryById( getPrefix() );
 
         try
         {
-            layout = layoutFactory.getLayout( managedRepository.getLayoutType() );
+            layout = layoutFactory.getLayout( managedRepository.getLayout() );
         }
         catch ( LayoutException e )
         {
@@ -332,6 +325,6 @@
 
     public ManagedRepositoryConfiguration getRepositoryConfiguration()
     {
-        return repositoryConfiguration;
+        return managedRepository;
     }
 }

Modified: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaStartup.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaStartup.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaStartup.java (original)
+++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ArchivaStartup.java Mon Oct  8 15:07:39 2007
@@ -42,7 +42,7 @@
     /**
      * @plexus.requirement role-hint="default"
      */
-    private ConfigurationSynchronization configSync;
+    private SecuritySynchronization securitySync;
 
     /**
      * @plexus.requirement role-hint="default"
@@ -61,7 +61,7 @@
 
         try
         {
-            configSync.startup();
+            securitySync.startup();
             resolverFactory.startup();
             taskScheduler.startup();
         }

Copied: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/SecuritySynchronization.java (from r582882, maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ConfigurationSynchronization.java)
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/SecuritySynchronization.java?p2=maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/SecuritySynchronization.java&p1=maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ConfigurationSynchronization.java&r1=582882&r2=582987&rev=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/ConfigurationSynchronization.java (original)
+++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/startup/SecuritySynchronization.java Mon Oct  8 15:07:39 2007
@@ -20,15 +20,9 @@
  */
 
 import org.apache.maven.archiva.common.ArchivaException;
-import org.apache.maven.archiva.common.utils.PathUtil;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.ConfigurationNames;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.maven.archiva.database.ArchivaDAO;
-import org.apache.maven.archiva.database.ArchivaDatabaseException;
-import org.apache.maven.archiva.database.ObjectNotFoundException;
-import org.apache.maven.archiva.model.ArchivaRepository;
-import org.apache.maven.archiva.repository.ArchivaConfigurationAdaptor;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.redback.role.RoleManager;
 import org.codehaus.plexus.redback.role.RoleManagerException;
@@ -42,20 +36,15 @@
  *
  * @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
  * @version $Id$
- * @plexus.component role="org.apache.maven.archiva.web.startup.ConfigurationSynchronization"
+ * 
+ * @plexus.component role="org.apache.maven.archiva.web.startup.SecuritySynchronization"
  * role-hint="default"
- * @todo consider whether we really need these in the database or not
  */
-public class ConfigurationSynchronization
+public class SecuritySynchronization
     extends AbstractLogEnabled
     implements RegistryListener
 {
     /**
-     * @plexus.requirement role-hint="jdo"
-     */
-    private ArchivaDAO dao;
-
-    /**
      * @plexus.requirement role-hint="default"
      */
     private RoleManager roleManager;
@@ -82,37 +71,6 @@
     {
         for ( ManagedRepositoryConfiguration repoConfig : repos )
         {
-            try
-            {
-                try
-                {
-                    ArchivaRepository repository = dao.getRepositoryDAO().getRepository( repoConfig.getId() );
-                    // Found repository.  Update it.
-
-                    repository.getModel().setName( repoConfig.getName() );
-                    repository.getModel().setUrl( PathUtil.toUrl( repoConfig.getLocation() ) );
-                    repository.getModel().setLayoutName( repoConfig.getLayout() );
-                    repository.getModel().setCreationSource( "configuration" );
-                    repository.getModel().setReleasePolicy( repoConfig.isReleases() );
-                    repository.getModel().setSnapshotPolicy( repoConfig.isSnapshots() );
-
-                    dao.getRepositoryDAO().saveRepository( repository );
-                }
-                catch ( ObjectNotFoundException e )
-                {
-                    // Add the repository to the database.
-                    getLogger().info( "Adding repository configuration to DB: " + repoConfig );
-                    ArchivaRepository drepo = ArchivaConfigurationAdaptor.toArchivaRepository( repoConfig );
-                    drepo.getModel().setCreationSource( "configuration" );
-                    dao.getRepositoryDAO().saveRepository( drepo );
-                }
-            }
-            catch ( ArchivaDatabaseException e )
-            {
-                // Log error.
-                getLogger().error( "Unable to add configured repositories to the database: " + e.getMessage(), e );
-            }
-
             // manage roles for repositories
             try
             {

Modified: maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifact.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifact.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifact.java (original)
+++ maven/archiva/trunk/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/tags/DownloadArtifact.java Mon Oct  8 15:07:39 2007
@@ -22,29 +22,32 @@
 import com.opensymphony.webwork.WebWorkException;
 import com.opensymphony.webwork.components.Component;
 import com.opensymphony.xwork.util.OgnlValueStack;
+
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.commons.lang.StringUtils;
+import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.database.ArchivaDAO;
 import org.apache.maven.archiva.database.ArchivaDatabaseException;
 import org.apache.maven.archiva.database.Constraint;
 import org.apache.maven.archiva.database.ObjectNotFoundException;
 import org.apache.maven.archiva.database.constraints.ArtifactsRelatedConstraint;
 import org.apache.maven.archiva.model.ArchivaArtifact;
-import org.apache.maven.archiva.model.ArchivaRepository;
 import org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayout;
 import org.apache.maven.archiva.repository.layout.BidirectionalRepositoryLayoutFactory;
 import org.apache.maven.archiva.repository.layout.LayoutException;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.jsp.PageContext;
 import java.io.IOException;
 import java.io.Writer;
 import java.text.DecimalFormat;
 import java.util.Iterator;
 import java.util.List;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.PageContext;
+
 /**
  * DownloadArtifact
  *
@@ -60,6 +63,11 @@
      * @plexus.requirement role-hint="jdo"
      */
     private ArchivaDAO dao;
+    
+    /**
+     * @plexus.requirement
+     */
+    private ArchivaConfiguration archivaConfiguration;
 
     /**
      * @plexus.requirement
@@ -110,8 +118,8 @@
             if ( relatedArtifacts != null )
             {
                 String repoId = ( (ArchivaArtifact) relatedArtifacts.get( 0 ) ).getModel().getRepositoryId();
-                ArchivaRepository repo = dao.getRepositoryDAO().getRepository( repoId );
-                BidirectionalRepositoryLayout layout = layoutFactory.getLayout( repo.getLayoutType() );
+                ManagedRepositoryConfiguration repo = findRepository( repoId );
+                BidirectionalRepositoryLayout layout = layoutFactory.getLayout( repo.getLayout() );
 
                 String prefix = req.getContextPath() + "/repository/" + repoId;
 
@@ -150,18 +158,23 @@
         return super.end( writer, body );
     }
 
+    private ManagedRepositoryConfiguration findRepository( String repoId )
+    {
+        return archivaConfiguration.getConfiguration().findManagedRepositoryById( repoId );
+    }
+
     private void appendError( StringBuffer sb, Exception e )
     {
         /* do nothing */
     }
 
-    private void appendMini( StringBuffer sb, String prefix, ArchivaRepository repo,
+    private void appendMini( StringBuffer sb, String prefix, ManagedRepositoryConfiguration repo,
                              BidirectionalRepositoryLayout layout, List relatedArtifacts )
     {
         /* do nothing */
     }
 
-    private void appendNormal( StringBuffer sb, String prefix, ArchivaRepository repo,
+    private void appendNormal( StringBuffer sb, String prefix, ManagedRepositoryConfiguration repo,
                                BidirectionalRepositoryLayout layout, List relatedArtifacts )
     {
         /*

Modified: maven/archiva/trunk/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/ArchivaDAOStub.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/ArchivaDAOStub.java?rev=582987&r1=582986&r2=582987&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/ArchivaDAOStub.java (original)
+++ maven/archiva/trunk/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/ArchivaDAOStub.java Mon Oct  8 15:07:39 2007
@@ -1,11 +1,9 @@
 package org.apache.maven.archiva.web.action.admin.repositories;
 
-import junit.framework.Assert;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.database.ArchivaDAO;
 import org.apache.maven.archiva.database.ArtifactDAO;
 import org.apache.maven.archiva.database.ProjectModelDAO;
-import org.apache.maven.archiva.database.RepositoryDAO;
 import org.apache.maven.archiva.database.RepositoryProblemDAO;
 import org.apache.maven.archiva.database.SimpleConstraint;
 import org.apache.maven.archiva.model.RepositoryContentStatistics;
@@ -14,6 +12,8 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import junit.framework.Assert;
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -68,11 +68,6 @@
     }
 
     public ProjectModelDAO getProjectModelDAO()
-    {
-        throw new UnsupportedOperationException( "query not implemented for stub" );
-    }
-
-    public RepositoryDAO getRepositoryDAO()
     {
         throw new UnsupportedOperationException( "query not implemented for stub" );
     }



Mime
View raw message