summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-web/archiva-rest
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-02-09 23:07:37 +0000
committerOlivier Lamy <olamy@apache.org>2012-02-09 23:07:37 +0000
commita269e32a92195bf4ff20899a692d0bad3ded227b (patch)
treedc8c92ca867569d2b60b2af5d8fc7767424b4ab6 /archiva-modules/archiva-web/archiva-rest
parentb7e02ed3e29f8d843641cfeda6e76d5f1f27eef4 (diff)
downloadarchiva-a269e32a92195bf4ff20899a692d0bad3ded227b.tar.gz
archiva-a269e32a92195bf4ff20899a692d0bad3ded227b.zip
more easy REST method to delete a ProxyConnector
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1242594 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web/archiva-rest')
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ProxyConnectorService.java11
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultProxyConnectorService.java13
2 files changed, 24 insertions, 0 deletions
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
index 818529b02..d37c422f3 100644
--- 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
@@ -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>
*
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
index 72aa44241..2573c7aa7 100644
--- 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
@@ -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
{