]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1490] REST services : proxyconnector service
authorOlivier Lamy <olamy@apache.org>
Wed, 7 Sep 2011 21:48:21 +0000 (21:48 +0000)
committerOlivier Lamy <olamy@apache.org>
Wed, 7 Sep 2011 21:48:21 +0000 (21:48 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1166426 13f79535-47bb-0310-9956-ffa450edef68

12 files changed:
archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/proxyconnector/DefaultProxyConnectorAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnector.java
archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnectorAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/proxyconnector/ProxyConnectorAdminTest.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ManagedRepository.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ProxyConnector.java [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/RemoteRepository.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ProxyConnectorService.java [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SearchService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultProxyConnectorService.java [new file with mode: 0644]
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/resources/META-INF/spring-context.xml

index c83a57766a07a42530a45b86a1f5ab54c0a70a06..7b77cfd3c70377f863e5273e2a717180c80b4b35 100644 (file)
@@ -64,17 +64,7 @@ public class DefaultProxyConnectorAdmin
         List<ProxyConnector> proxyConnectors = new ArrayList<ProxyConnector>( proxyConnectorConfigurations.size() );
         for ( ProxyConnectorConfiguration configuration : proxyConnectorConfigurations )
         {
-            ProxyConnector proxyConnector = new ProxyConnector();
-            proxyConnectors.add( proxyConnector );
-            proxyConnector.setOrder( configuration.getOrder() );
-            proxyConnector.setBlackListPatterns( new ArrayList<String>( configuration.getBlackListPatterns() ) );
-            proxyConnector.setWhiteListPatterns( new ArrayList<String>( configuration.getWhiteListPatterns() ) );
-            proxyConnector.setDisabled( configuration.isDisabled() );
-            proxyConnector.setPolicies( new HashMap<String, String>( configuration.getPolicies() ) );
-            proxyConnector.setProperties( new HashMap<String, String>( configuration.getProperties() ) );
-            proxyConnector.setProxyId( configuration.getProxyId() );
-            proxyConnector.setSourceRepoId( configuration.getSourceRepoId() );
-            proxyConnector.setTargetRepoId( configuration.getTargetRepoId() );
+            proxyConnectors.add( getProxyConnector( configuration ) );
         }
 
         return proxyConnectors;
@@ -193,13 +183,6 @@ public class DefaultProxyConnectorAdmin
         return proxyConnectorMap;
     }
 
-    public ProxyConnector findProxyConnector( String sourceId, String targetId )
-        throws RepositoryAdminException
-    {
-        return getProxyConnector(
-            findProxyConnector( sourceId, targetId, getArchivaConfiguration().getConfiguration() ) );
-    }
-
     private ProxyConnectorConfiguration findProxyConnector( String sourceId, String targetId,
                                                             Configuration configuration )
     {
index 5c811963b11d404fa47c73a6e3581230d7d2e019..67a7672161fdc6a9063d5ef1f4dd3722eda6611f 100644 (file)
@@ -77,7 +77,7 @@ public class ProxyConnector
      */
     public static final String POLICY_CACHE_FAILURES = "cache-failures";
 
-/**
+    /**
      *
      * The order of the proxy connectors. (0 means no order specified)
      *           .
index 0228f9b7300576fe84d3f94c8319f0911516243c..cfb549b2ab8dff27519cee2f0ed6368410545848 100644 (file)
@@ -58,8 +58,4 @@ public interface ProxyConnectorAdmin
     Map<String, List<ProxyConnector>> getProxyConnectorAsMap()
         throws RepositoryAdminException;
 
-    ProxyConnector findProxyConnector( String sourceId, String targetId )
-        throws RepositoryAdminException;
-
-
 }
index af35ff36c3bb9cbe18f3e416f555ddc1a65aead9..4240f2fd98803358798d12be0a0eec3c4821f371 100644 (file)
@@ -132,30 +132,29 @@ public class ProxyConnectorAdminTest
     public void findProxyConnector()
         throws Exception
     {
-        ProxyConnector proxyConnector = proxyConnectorAdmin.findProxyConnector( "internal", "central" );
+        ProxyConnector proxyConnector = proxyConnectorAdmin.getProxyConnector( "internal", "central" );
         assertNotNull( proxyConnector );
     }
 
-        @Test
+    @Test
     public void updateProxyConnector()
         throws Exception
     {
-        ProxyConnector proxyConnector = proxyConnectorAdmin.findProxyConnector( "internal", "central" );
+        ProxyConnector proxyConnector = proxyConnectorAdmin.getProxyConnector( "internal", "central" );
         assertNotNull( proxyConnector );
         proxyConnector.setDisabled( false );
         proxyConnectorAdmin.updateProxyConnector( proxyConnector, getFakeAuditInformation() );
-        proxyConnector = proxyConnectorAdmin.findProxyConnector( "internal", "central" );
+        proxyConnector = proxyConnectorAdmin.getProxyConnector( "internal", "central" );
         assertFalse( proxyConnector.isDisabled() );
 
-
         proxyConnector.setDisabled( true );
         proxyConnectorAdmin.updateProxyConnector( proxyConnector, getFakeAuditInformation() );
-        proxyConnector = proxyConnectorAdmin.findProxyConnector( "internal", "central" );
+        proxyConnector = proxyConnectorAdmin.getProxyConnector( "internal", "central" );
         assertTrue( proxyConnector.isDisabled() );
 
         proxyConnector.setOrder( 4 );
         proxyConnectorAdmin.updateProxyConnector( proxyConnector, getFakeAuditInformation() );
-        proxyConnector = proxyConnectorAdmin.findProxyConnector( "internal", "central" );
+        proxyConnector = proxyConnectorAdmin.getProxyConnector( "internal", "central" );
         assertEquals( 4, proxyConnector.getOrder() );
 
     }
index eecc75938e8802059d1d53206051f293af31120e..57a9917cc107fb2765efd6d25b84bba6ea4d358e 100644 (file)
@@ -33,10 +33,10 @@ public class ManagedRepository
 
     private String name;
 
-    private String location;
-
     private String layout;
 
+    private String location;
+
     private boolean snapshots = false;
 
     private boolean releases = false;
@@ -54,8 +54,9 @@ public class ManagedRepository
         // no op
     }
 
-    public ManagedRepository( String id, String name, String location, String layout, boolean snapshots, boolean releases,
-                              boolean blockRedeployments, boolean stageRepoNeeded, String cronExpression )
+    public ManagedRepository( String id, String name, String location, String layout, boolean snapshots,
+                              boolean releases, boolean blockRedeployments, boolean stageRepoNeeded,
+                              String cronExpression )
     {
         this.id = id;
         this.name = name;
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ProxyConnector.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/ProxyConnector.java
new file mode 100644 (file)
index 0000000..79ba844
--- /dev/null
@@ -0,0 +1,180 @@
+package org.apache.archiva.rest.api.model;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+@XmlRootElement( name = "proxyConnector" )
+public class ProxyConnector
+    implements Serializable
+{
+    /**
+     * The order of the proxy connectors. (0 means no order specified)
+     * .
+     */
+    private int order = 0;
+
+    /**
+     * The Repository Source for this connector.
+     */
+    private String sourceRepoId;
+
+    /**
+     * The Repository Target for this connector.
+     */
+    private String targetRepoId;
+
+    /**
+     * The network proxy ID to use for this connector.
+     */
+    private String proxyId;
+
+    /**
+     * Field blackListPatterns.
+     */
+    private List<String> blackListPatterns;
+
+    /**
+     * Field whiteListPatterns.
+     */
+    private List<String> whiteListPatterns;
+
+    /**
+     * Field policies.
+     */
+    private Map<String, String> policies;
+
+    /**
+     * Field properties.
+     */
+    private Map<String, String> properties;
+
+    /**
+     * If the the repository proxy connector is disabled or not
+     */
+    private boolean disabled = false;
+
+    /**
+     * Get the order of the proxy connectors. (0 means no order specified)
+     *
+     * @return int
+     */
+    public int getOrder()
+    {
+        return this.order;
+    }
+
+
+    /**
+     * Set the order of the proxy connectors. (0 means no order specified)
+     *
+     * @param order
+     */
+    public void setOrder( int order )
+    {
+        this.order = order;
+    }
+
+    public String getSourceRepoId()
+    {
+        return sourceRepoId;
+    }
+
+    public void setSourceRepoId( String sourceRepoId )
+    {
+        this.sourceRepoId = sourceRepoId;
+    }
+
+    public String getTargetRepoId()
+    {
+        return targetRepoId;
+    }
+
+    public void setTargetRepoId( String targetRepoId )
+    {
+        this.targetRepoId = targetRepoId;
+    }
+
+    public String getProxyId()
+    {
+        return proxyId;
+    }
+
+    public void setProxyId( String proxyId )
+    {
+        this.proxyId = proxyId;
+    }
+
+    public List<String> getBlackListPatterns()
+    {
+        return blackListPatterns;
+    }
+
+    public void setBlackListPatterns( List<String> blackListPatterns )
+    {
+        this.blackListPatterns = blackListPatterns;
+    }
+
+    public List<String> getWhiteListPatterns()
+    {
+        return whiteListPatterns;
+    }
+
+    public void setWhiteListPatterns( List<String> whiteListPatterns )
+    {
+        this.whiteListPatterns = whiteListPatterns;
+    }
+
+    public Map<String, String> getPolicies()
+    {
+        return policies;
+    }
+
+    public void setPolicies( Map<String, String> policies )
+    {
+        this.policies = policies;
+    }
+
+    public Map<String, String> getProperties()
+    {
+        return properties;
+    }
+
+    public void setProperties( Map<String, String> properties )
+    {
+        this.properties = properties;
+    }
+
+    public boolean isDisabled()
+    {
+        return disabled;
+    }
+
+    public void setDisabled( boolean disabled )
+    {
+        this.disabled = disabled;
+    }
+}
index 2117788ef45ca4f5d9e43a56286c5d455cc19d2a..43d99a77a663aa9d38edd7023c4c6b9bf1face4f 100644 (file)
@@ -31,10 +31,10 @@ public class RemoteRepository
 
     private String name;
 
-    private String url;
-
     private String layout;
 
+    private String url;
+
     private String userName;
 
     private String password;
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ProxyConnectorService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ProxyConnectorService.java
new file mode 100644 (file)
index 0000000..f53ebc9
--- /dev/null
@@ -0,0 +1,99 @@
+package org.apache.archiva.rest.api.services;
+/*
+ * 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.archiva.admin.repository.RepositoryAdminException;
+import org.apache.archiva.rest.api.model.ProxyConnector;
+import org.apache.archiva.security.common.ArchivaRoleConstants;
+import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <b>No update method for changing source and target here as id is : sourceRepoId and targetRepoId, use delete then add.</b>
+ *
+ * @author Olivier Lamy
+ * @since 1.4
+ */
+@Path( "/proxyConnectorService/" )
+public interface ProxyConnectorService
+{
+    @Path( "getProxyConnectors" )
+    @GET
+    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+    @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
+    List<ProxyConnector> getProxyConnectors()
+        throws RepositoryAdminException;
+
+    @Path( "getProxyConnector" )
+    @GET
+    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+    @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
+    ProxyConnector getProxyConnector( @QueryParam( "sourceRepoId" ) String sourceRepoId, @QueryParam( "targetRepoId" ) String targetRepoId )
+        throws RepositoryAdminException;
+
+    @Path( "addProxyConnector" )
+    @POST
+    @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+    @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
+    Boolean addProxyConnector( ProxyConnector proxyConnector )
+        throws RepositoryAdminException;
+
+    @Path( "deleteProxyConnector" )
+    @POST
+    @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+    @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
+    Boolean deleteProxyConnector( ProxyConnector proxyConnector )
+        throws RepositoryAdminException;
+
+    /**
+     * <b>only for enabled/disable or changing bean values except target/source</b>
+     *
+     * @param proxyConnector
+     * @return
+     * @throws org.apache.archiva.admin.repository.RepositoryAdminException
+     *
+     */
+    @Path( "updateProxyConnector" )
+    @POST
+    @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+    @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
+    Boolean updateProxyConnector( ProxyConnector proxyConnector )
+        throws RepositoryAdminException;
+
+
+    @Path( "getProxyConnectorAsMap" )
+    @GET
+    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
+    @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
+    Map<String, List<ProxyConnector>> getProxyConnectorAsMap()
+        throws RepositoryAdminException;
+
+}
index 93285952d02997fa2a182e4895862f1c5ed066d6..baf1d26f01a6f4f9ab91a02d713138ffecc5f755 100644 (file)
@@ -23,11 +23,12 @@ package org.apache.archiva.rest.api.services;
 import org.apache.archiva.rest.api.model.Artifact;
 import org.apache.archiva.rest.api.model.Dependency;
 
+import javax.ws.rs.Path;
 import javax.xml.bind.annotation.XmlRootElement;
 import java.util.Date;
 import java.util.List;
 
-@XmlRootElement( name = "searchRequest" )
+@Path( "/searchService/" )
 public interface SearchService
 {
     /*
index 9b1e9e8f675a7089678c8a5ee6ed4c90b6c43ffb..ed21917924f65370f5c853a8be975c33b69f6065 100644 (file)
       <artifactId>jsr311-api</artifactId>
     </dependency>
 
+    <dependency>
+      <groupId>net.sf.beanlib</groupId>
+      <artifactId>beanlib</artifactId>
+        <exclusions>
+          <exclusion>
+            <groupId>cglib</groupId>
+            <artifactId>cglib</artifactId>
+          </exclusion>
+          <exclusion>
+            <groupId>aopalliance</groupId>
+            <artifactId>aopalliance</artifactId>
+          </exclusion>
+        </exclusions>
+    </dependency>
+
     <!-- normally not needed but here for wadl feature currently in cxf -->
     <dependency>
       <groupId>org.apache.cxf</groupId>
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultProxyConnectorService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultProxyConnectorService.java
new file mode 100644 (file)
index 0000000..ef2699f
--- /dev/null
@@ -0,0 +1,137 @@
+package org.apache.archiva.rest.services;
+/*
+ * 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 net.sf.beanlib.provider.replicator.BeanReplicator;
+import org.apache.archiva.admin.repository.RepositoryAdminException;
+import org.apache.archiva.admin.repository.proxyconnector.ProxyConnectorAdmin;
+import org.apache.archiva.rest.api.model.ProxyConnector;
+import org.apache.archiva.rest.api.services.ProxyConnectorService;
+import org.springframework.stereotype.Service;
+
+import javax.inject.Inject;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Olivier Lamy
+ */
+@Service( "proxyConnectorService#rest" )
+public class DefaultProxyConnectorService
+    extends AbstractRestService
+    implements ProxyConnectorService
+{
+    @Inject
+    private ProxyConnectorAdmin proxyConnectorAdmin;
+
+    public List<ProxyConnector> getProxyConnectors()
+        throws RepositoryAdminException
+    {
+        List<ProxyConnector> proxyConnectors = new ArrayList<ProxyConnector>();
+        for ( org.apache.archiva.admin.repository.proxyconnector.ProxyConnector proxyConnector : proxyConnectorAdmin.getProxyConnectors() )
+        {
+            proxyConnectors.add( new BeanReplicator().replicateBean( proxyConnector, ProxyConnector.class ) );
+        }
+        return proxyConnectors;
+    }
+
+    public ProxyConnector getProxyConnector( String sourceRepoId, String targetRepoId )
+        throws RepositoryAdminException
+    {
+        org.apache.archiva.admin.repository.proxyconnector.ProxyConnector proxyConnector =
+            proxyConnectorAdmin.getProxyConnector( sourceRepoId, targetRepoId );
+        return proxyConnector == null
+            ? null
+            : new BeanReplicator().replicateBean( proxyConnector, ProxyConnector.class );
+    }
+
+    public Boolean addProxyConnector( ProxyConnector proxyConnector )
+        throws RepositoryAdminException
+    {
+        if ( proxyConnector == null )
+        {
+            return Boolean.FALSE;
+        }
+        return proxyConnectorAdmin.addProxyConnector( new BeanReplicator().replicateBean( proxyConnector,
+                                                                                          org.apache.archiva.admin.repository.proxyconnector.ProxyConnector.class ),
+                                                      getAuditInformation() );
+    }
+
+    public Boolean deleteProxyConnector( ProxyConnector proxyConnector )
+        throws RepositoryAdminException
+    {
+        if ( proxyConnector == null )
+        {
+            return Boolean.FALSE;
+        }
+        return proxyConnectorAdmin.deleteProxyConnector( new BeanReplicator().replicateBean( proxyConnector,
+                                                                                             org.apache.archiva.admin.repository.proxyconnector.ProxyConnector.class ),
+                                                         getAuditInformation() );
+    }
+
+    public Boolean updateProxyConnector( ProxyConnector proxyConnector )
+        throws RepositoryAdminException
+    {
+        if ( proxyConnector == null )
+        {
+            return Boolean.FALSE;
+        }
+        return proxyConnectorAdmin.updateProxyConnector( new BeanReplicator().replicateBean( proxyConnector,
+                                                                                             org.apache.archiva.admin.repository.proxyconnector.ProxyConnector.class ),
+                                                         getAuditInformation() );
+    }
+
+    public Map<String, List<ProxyConnector>> getProxyConnectorAsMap()
+        throws RepositoryAdminException
+    {
+        Map<String, List<org.apache.archiva.admin.repository.proxyconnector.ProxyConnector>> modelMap =
+            proxyConnectorAdmin.getProxyConnectorAsMap();
+        if ( modelMap == null || modelMap.isEmpty() )
+        {
+            return Collections.emptyMap();
+        }
+        Map<String, List<ProxyConnector>> map = new HashMap<String, List<ProxyConnector>>( modelMap.size() );
+        for ( Map.Entry<String, List<org.apache.archiva.admin.repository.proxyconnector.ProxyConnector>> entry : modelMap.entrySet() )
+        {
+            List<ProxyConnector> proxyConnectors = new ArrayList<ProxyConnector>( entry.getValue().size() );
+            for ( org.apache.archiva.admin.repository.proxyconnector.ProxyConnector proxyConnector : entry.getValue() )
+            {
+                proxyConnectors.add( new BeanReplicator().replicateBean( proxyConnector, ProxyConnector.class ) );
+            }
+            map.put( entry.getKey(), proxyConnectors );
+        }
+        return map;
+    }
+
+
+    public ProxyConnectorAdmin getProxyConnectorAdmin()
+    {
+        return proxyConnectorAdmin;
+    }
+
+    public void setProxyConnectorAdmin( ProxyConnectorAdmin proxyConnectorAdmin )
+    {
+        this.proxyConnectorAdmin = proxyConnectorAdmin;
+    }
+}
+
+
index fc358920eaab078dc6d4c5ce5d849ac16488a49d..e5ad02ac9f75d1df6e63ddd2aae0c7051ddcf787 100644 (file)
@@ -53,6 +53,7 @@
       <ref bean="managedRepositoriesService#rest"/>
       <ref bean="remoteRepositoriesService#rest"/>
       <ref bean="repositoryGroupService#rest"/>
+      <ref bean="proxyConnectorService#rest"/>
     </jaxrs:serviceBeans>
 
     <jaxrs:outInterceptors>