]> source.dussan.org Git - archiva.git/commitdiff
MRM-1507 : api to configure ProxyConnector
authorOlivier Lamy <olamy@apache.org>
Wed, 7 Sep 2011 11:41:15 +0000 (11:41 +0000)
committerOlivier Lamy <olamy@apache.org>
Wed, 7 Sep 2011 11:41:15 +0000 (11:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1166130 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/AbstractRepositoryAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/AbstractRepositoryAdminTest.java
archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/remote/RemoteRepositoryAdminTest.java
archiva-modules/archiva-web/archiva-webapp/pom.xml
archiva-modules/archiva-web/archiva-webdav/pom.xml
archiva-modules/plugins/audit/src/main/java/org/apache/archiva/audit/AuditEvent.java

index 40fe9baab307a029230db82f9bd72740316e01ce..c5bcc3bdce554e1e559d4df464df722b582ef96b 100644 (file)
@@ -87,12 +87,6 @@ public abstract class AbstractRepositoryAdmin
         }
     }
 
-    protected List<ProxyConnectorConfiguration> getProxyConnectors()
-    {
-        return new ArrayList<ProxyConnectorConfiguration>(
-            archivaConfiguration.getConfiguration().getProxyConnectors() );
-    }
-
     public List<AuditListener> getAuditListeners()
     {
         return auditListeners;
index 6d1084887ac24094c5f7b4ee9a4f8be388ffbda6..99d80cf5041378aa7c7618a19a506afcc7df3741 100644 (file)
@@ -113,8 +113,9 @@ public class DefaultRemoteRepositoryAdmin
 
         configuration.removeRemoteRepository( remoteRepositoryConfiguration );
 
+        // TODO use ProxyConnectorAdmin interface ?
         // [MRM-520] Proxy Connectors are not deleted with the deletion of a Repository.
-        List<ProxyConnectorConfiguration> proxyConnectors = getProxyConnectors();
+        List<ProxyConnectorConfiguration> proxyConnectors = configuration.getProxyConnectors();
         for ( ProxyConnectorConfiguration proxyConnector : proxyConnectors )
         {
             if ( StringUtils.equals( proxyConnector.getTargetRepoId(), repositoryId ) )
index 27da863ed33dff358062d95f40457dc90d456a41..0533faa371388b8962189a60ec5de1f1c387b516 100644 (file)
@@ -23,6 +23,8 @@ import org.apache.archiva.admin.AuditInformation;
 import org.apache.archiva.admin.mock.MockAuditListener;
 import org.apache.archiva.admin.repository.managed.ManagedRepository;
 import org.apache.archiva.admin.repository.managed.ManagedRepositoryAdmin;
+import org.apache.archiva.admin.repository.proxyconnector.ProxyConnectorAdmin;
+import org.apache.archiva.admin.repository.remote.RemoteRepository;
 import org.apache.archiva.admin.repository.remote.RemoteRepositoryAdmin;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.StringUtils;
@@ -63,6 +65,9 @@ public abstract class AbstractRepositoryAdminTest
     @Inject
     protected ManagedRepositoryAdmin managedRepositoryAdmin;
 
+    @Inject
+    protected ProxyConnectorAdmin proxyConnectorAdmin;
+
     protected AuditInformation getFakeAuditInformation()
     {
         AuditInformation auditInformation = new AuditInformation( getFakeUser(), "archiva-localhost" );
@@ -115,4 +120,21 @@ public abstract class AbstractRepositoryAdminTest
         }
         return null;
     }
+
+    protected RemoteRepository getRemoteRepository()
+    {
+        return getRemoteRepository( "foo" );
+    }
+
+    protected RemoteRepository getRemoteRepository(String id)
+    {
+        RemoteRepository remoteRepository = new RemoteRepository();
+        remoteRepository.setUrl( "http://foo.com/maven-it-rocks" );
+        remoteRepository.setTimeout( 10 );
+        remoteRepository.setName( "maven foo" );
+        remoteRepository.setUserName( "foo-name" );
+        remoteRepository.setPassword( "toto" );
+        remoteRepository.setId( id );
+        return remoteRepository;
+    }
 }
index 44c5c12fe0b50a0d6ce0619c6dac115ff73cb666..85f8ef723b07dcb73e6c06036444db21ac5cdde4 100644 (file)
@@ -149,15 +149,5 @@ public class RemoteRepositoryAdminTest
     }
 
 
-    private RemoteRepository getRemoteRepository()
-    {
-        RemoteRepository remoteRepository = new RemoteRepository();
-        remoteRepository.setUrl( "http://foo.com/maven-it-rocks" );
-        remoteRepository.setTimeout( 10 );
-        remoteRepository.setName( "maven foo" );
-        remoteRepository.setUserName( "foo-name" );
-        remoteRepository.setPassword( "toto" );
-        remoteRepository.setId( "foo" );
-        return remoteRepository;
-    }
+
 }
index b680142cdbad6604e2283f8ac4c27f31b97e942b..32f8abf9ffc86c7b65fa7c77318af9627b831711 100644 (file)
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-core-consumers</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.archiva</groupId>
+      <artifactId>archiva-configuration</artifactId>
+      <!-- TODO uncomment when repository admin will be finished
+      <scope>runtime</scope>
+      -->
+    </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-metadata-consumer</artifactId>
                 </goals>
                 <configuration>
                   <tasks>
-                    <copy overwrite="true" file="${basedir}/src/test/resources/log4j.xml" todir="${project.build.directory}/classes" />
+                    <copy overwrite="true" file="${basedir}/src/test/tomcat/log4j.xml" todir="${project.build.directory}/classes" />
                     <delete dir="${basedir}/src/main/webapp/WEB-INF/lib" />
                   </tasks>
                 </configuration>
index c0b2cb46ec940e8bcee4b322f886adcf9adb5de3..b7bf7e78f2af7edbbc3c6a903c1616725a0529ef 100644 (file)
@@ -42,6 +42,9 @@
     <dependency>
       <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-configuration</artifactId>
+      <!-- TODO uncomment when repository admin will be finished
+      <scope>runtime</scope>
+      -->
     </dependency>
     <dependency>
       <groupId>org.apache.archiva</groupId>
index 779194927756d80641f20ce78beb141fd786c996..99129dcfb6c1124923250b632e6c3fc2fab4f5a0 100644 (file)
@@ -104,6 +104,12 @@ public class AuditEvent
     public static final String REMOVE_PATTERN = "Removed File Type Pattern";
 
     public static final String MERGE_REPO_REMOTE = "Merged Staging Repository Triggered Remotely";
+
+    public static final String ADD_PROXY_CONNECTOR = "Added Proxy Connector";
+
+    public static final String DELETE_PROXY_CONNECTOR = "Deleted Proxy Connector";
+
+    public static final String MODIFY_PROXY_CONNECTOR = "Updated Proxy Connector";
     
     private String repositoryId;