001package org.apache.archiva.rest.api.services; 002/* 003 * Licensed to the Apache Software Foundation (ASF) under one 004 * or more contributor license agreements. See the NOTICE file 005 * distributed with this work for additional information 006 * regarding copyright ownership. The ASF licenses this file 007 * to you under the Apache License, Version 2.0 (the 008 * "License"); you may not use this file except in compliance 009 * with the License. You may obtain a copy of the License at 010 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, 014 * software distributed under the License is distributed on an 015 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 016 * KIND, either express or implied. See the License for the 017 * specific language governing permissions and limitations 018 * under the License. 019 */ 020 021import org.apache.archiva.admin.model.beans.ProxyConnector; 022import org.apache.archiva.redback.authorization.RedbackAuthorization; 023import org.apache.archiva.rest.api.model.PolicyInformation; 024import org.apache.archiva.security.common.ArchivaRoleConstants; 025 026import javax.ws.rs.Consumes; 027import javax.ws.rs.GET; 028import javax.ws.rs.POST; 029import javax.ws.rs.Path; 030import javax.ws.rs.Produces; 031import javax.ws.rs.QueryParam; 032import javax.ws.rs.core.MediaType; 033import java.util.List; 034 035/** 036 * <b>No update method for changing source and target here as id is : sourceRepoId and targetRepoId, use delete then add.</b> 037 * 038 * @author Olivier Lamy 039 * @since 1.4-M1 040 */ 041@Path( "/proxyConnectorService/" ) 042public interface ProxyConnectorService 043{ 044 @Path( "getProxyConnectors" ) 045 @GET 046 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } ) 047 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION ) 048 List<ProxyConnector> getProxyConnectors() 049 throws ArchivaRestServiceException; 050 051 @Path( "getProxyConnector" ) 052 @GET 053 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } ) 054 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION ) 055 ProxyConnector getProxyConnector( @QueryParam( "sourceRepoId" ) String sourceRepoId, 056 @QueryParam( "targetRepoId" ) String targetRepoId ) 057 throws ArchivaRestServiceException; 058 059 @Path( "addProxyConnector" ) 060 @POST 061 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } ) 062 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } ) 063 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION ) 064 Boolean addProxyConnector( ProxyConnector proxyConnector ) 065 throws ArchivaRestServiceException; 066 067 @Path( "deleteProxyConnector" ) 068 @POST 069 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } ) 070 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } ) 071 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION ) 072 Boolean deleteProxyConnector( ProxyConnector proxyConnector ) 073 throws ArchivaRestServiceException; 074 075 /** 076 * @since 1.4-M3 077 */ 078 @Path( "removeProxyConnector" ) 079 @GET 080 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } ) 081 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION ) 082 Boolean removeProxyConnector( @QueryParam( "sourceRepoId" ) String sourceRepoId, 083 @QueryParam( "targetRepoId" ) String targetRepoId ) 084 throws ArchivaRestServiceException; 085 086 /** 087 * <b>only for enabled/disable or changing bean values except target/source</b> 088 * 089 * @param proxyConnector 090 * @return 091 */ 092 @Path( "updateProxyConnector" ) 093 @POST 094 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } ) 095 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } ) 096 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION ) 097 Boolean updateProxyConnector( ProxyConnector proxyConnector ) 098 throws ArchivaRestServiceException; 099 100 @Path( "allPolicies" ) 101 @GET 102 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } ) 103 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } ) 104 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION ) 105 List<PolicyInformation> getAllPolicyInformations() 106 throws ArchivaRestServiceException; 107 108 109}