]> source.dussan.org Git - archiva.git/commitdiff
more easy REST method to delete a ProxyConnector
authorOlivier Lamy <olamy@apache.org>
Thu, 9 Feb 2012 23:07:37 +0000 (23:07 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 9 Feb 2012 23:07:37 +0000 (23:07 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1242594 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ProxyConnectorService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultProxyConnectorService.java

index 818529b022e023f9b20315813b6526f3203ca55a..d37c422f3b20317537191ca04f559bb37387e41b 100644 (file)
@@ -72,6 +72,17 @@ public interface ProxyConnectorService
     Boolean deleteProxyConnector( ProxyConnector proxyConnector )
         throws ArchivaRestServiceException;
 
+    @Path( "removeProxyConnector" )
+    @GET
+    @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
+    @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
+    /**
+     * @since 1.4-M3
+     */
+    Boolean removeProxyConnector( @QueryParam( "sourceRepoId" ) String sourceRepoId,
+                                  @QueryParam( "targetRepoId" ) String targetRepoId )
+        throws ArchivaRestServiceException;
+
     /**
      * <b>only for enabled/disable or changing bean values except target/source</b>
      *
index 72aa4424131b04285135ac5983a724f769f1bc38..2573c7aa72a87d0c2d20e6911738d9e939579f7c 100644 (file)
@@ -113,6 +113,19 @@ public class DefaultProxyConnectorService
         }
     }
 
+    public Boolean removeProxyConnector( String sourceRepoId, String targetRepoId )
+        throws ArchivaRestServiceException
+    {
+        ProxyConnector proxyConnector = getProxyConnector( sourceRepoId, targetRepoId );
+        if ( proxyConnector == null )
+        {
+            throw new ArchivaRestServiceException(
+                "proxyConnector with sourceRepoId:" + sourceRepoId + " and targetRepoId:" + targetRepoId
+                    + " not exists" );
+        }
+        return deleteProxyConnector( proxyConnector );
+    }
+
     public Boolean updateProxyConnector( ProxyConnector proxyConnector )
         throws ArchivaRestServiceException
     {