From 3e0caade83f9627e72b749844d6eec7baecd0990 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 30 Sep 2011 14:21:44 +0000 Subject: [PATCH] [MRM-1526] configure http connection pool values for wagon http : add REST services git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1177675 13f79535-47bb-0310-9956-ffa450edef68 --- .../ArchivaAdministrationService.java | 16 +++++++++++ .../DefaultArchivaAdministrationService.java | 27 +++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaAdministrationService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaAdministrationService.java index e10f67fb0..e1210dfcf 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaAdministrationService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ArchivaAdministrationService.java @@ -20,6 +20,7 @@ package org.apache.archiva.rest.api.services; import org.apache.archiva.admin.model.beans.FileType; import org.apache.archiva.admin.model.beans.LegacyArtifactPath; +import org.apache.archiva.admin.model.beans.NetworkConfiguration; import org.apache.archiva.admin.model.beans.OrganisationInformation; import org.apache.archiva.admin.model.beans.UiConfiguration; import org.apache.archiva.security.common.ArchivaRoleConstants; @@ -190,5 +191,20 @@ public interface ArchivaAdministrationService @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION ) void setUiConfiguration( UiConfiguration uiConfiguration ) throws ArchivaRestServiceException; + + + @Path( "getNetworkConfiguration" ) + @GET + @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } ) + @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION ) + NetworkConfiguration getNetworkConfiguration() + throws ArchivaRestServiceException; + + @Path( "setNetworkConfiguration" ) + @POST + @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } ) + @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION ) + void setNetworkConfiguration( NetworkConfiguration networkConfiguration ) + throws ArchivaRestServiceException; } diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaAdministrationService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaAdministrationService.java index f90c4a362..82db3f003 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaAdministrationService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultArchivaAdministrationService.java @@ -22,6 +22,7 @@ import org.apache.archiva.admin.model.RepositoryAdminException; import org.apache.archiva.admin.model.admin.ArchivaAdministration; import org.apache.archiva.admin.model.beans.FileType; import org.apache.archiva.admin.model.beans.LegacyArtifactPath; +import org.apache.archiva.admin.model.beans.NetworkConfiguration; import org.apache.archiva.admin.model.beans.OrganisationInformation; import org.apache.archiva.admin.model.beans.UiConfiguration; import org.apache.archiva.rest.api.services.ArchivaAdministrationService; @@ -332,4 +333,30 @@ public class DefaultArchivaAdministrationService throw new ArchivaRestServiceException( e.getMessage() ); } } + + public NetworkConfiguration getNetworkConfiguration() + throws ArchivaRestServiceException + { + try + { + return archivaAdministration.getNetworkConfiguration(); + } + catch ( RepositoryAdminException e ) + { + throw new ArchivaRestServiceException( e.getMessage() ); + } + } + + public void setNetworkConfiguration( NetworkConfiguration networkConfiguration ) + throws ArchivaRestServiceException + { + try + { + archivaAdministration.setNetworkConfiguration( networkConfiguration ); + } + catch ( RepositoryAdminException e ) + { + throw new ArchivaRestServiceException( e.getMessage() ); + } + } }