[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
This commit is contained in:
Olivier Lamy 2011-09-30 14:21:44 +00:00
parent 05191844ba
commit 3e0caade83
2 changed files with 43 additions and 0 deletions

View File

@ -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.FileType;
import org.apache.archiva.admin.model.beans.LegacyArtifactPath; 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.OrganisationInformation;
import org.apache.archiva.admin.model.beans.UiConfiguration; import org.apache.archiva.admin.model.beans.UiConfiguration;
import org.apache.archiva.security.common.ArchivaRoleConstants; import org.apache.archiva.security.common.ArchivaRoleConstants;
@ -190,5 +191,20 @@ public interface ArchivaAdministrationService
@RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION ) @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
void setUiConfiguration( UiConfiguration uiConfiguration ) void setUiConfiguration( UiConfiguration uiConfiguration )
throws ArchivaRestServiceException; 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;
} }

View File

@ -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.admin.ArchivaAdministration;
import org.apache.archiva.admin.model.beans.FileType; import org.apache.archiva.admin.model.beans.FileType;
import org.apache.archiva.admin.model.beans.LegacyArtifactPath; 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.OrganisationInformation;
import org.apache.archiva.admin.model.beans.UiConfiguration; import org.apache.archiva.admin.model.beans.UiConfiguration;
import org.apache.archiva.rest.api.services.ArchivaAdministrationService; import org.apache.archiva.rest.api.services.ArchivaAdministrationService;
@ -332,4 +333,30 @@ public class DefaultArchivaAdministrationService
throw new ArchivaRestServiceException( e.getMessage() ); 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() );
}
}
} }