1 package org.apache.archiva.rest.api.services;
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
21 import io.swagger.v3.oas.annotations.tags.Tag;
22 import org.apache.archiva.admin.model.beans.ProxyConnector;
23 import org.apache.archiva.redback.authorization.RedbackAuthorization;
24 import org.apache.archiva.rest.api.model.PolicyInformation;
25 import org.apache.archiva.security.common.ArchivaRoleConstants;
27 import javax.ws.rs.Consumes;
28 import javax.ws.rs.GET;
29 import javax.ws.rs.POST;
30 import javax.ws.rs.Path;
31 import javax.ws.rs.Produces;
32 import javax.ws.rs.QueryParam;
33 import javax.ws.rs.core.MediaType;
34 import java.util.List;
37 * <b>No update method for changing source and target here as id is : sourceRepoId and targetRepoId, use delete then add.</b>
39 * @author Olivier Lamy
42 @Path( "/proxyConnectorService/" )
43 @Tag(name="Proxy-Repository")
44 public interface ProxyConnectorService
46 @Path( "getProxyConnectors" )
48 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
49 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
50 List<ProxyConnector> getProxyConnectors()
51 throws ArchivaRestServiceException;
53 @Path( "getProxyConnector" )
55 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
56 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
57 ProxyConnector getProxyConnector( @QueryParam( "sourceRepoId" ) String sourceRepoId,
58 @QueryParam( "targetRepoId" ) String targetRepoId )
59 throws ArchivaRestServiceException;
61 @Path( "addProxyConnector" )
63 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
64 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
65 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
66 Boolean addProxyConnector( ProxyConnector proxyConnector )
67 throws ArchivaRestServiceException;
69 @Path( "deleteProxyConnector" )
71 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
72 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
73 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
74 Boolean deleteProxyConnector( ProxyConnector proxyConnector )
75 throws ArchivaRestServiceException;
80 @Path( "removeProxyConnector" )
82 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
83 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
84 Boolean removeProxyConnector( @QueryParam( "sourceRepoId" ) String sourceRepoId,
85 @QueryParam( "targetRepoId" ) String targetRepoId )
86 throws ArchivaRestServiceException;
89 * <b>only for enabled/disable or changing bean values except target/source</b>
91 * @param proxyConnector
94 @Path( "updateProxyConnector" )
96 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
97 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
98 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
99 Boolean updateProxyConnector( ProxyConnector proxyConnector )
100 throws ArchivaRestServiceException;
102 @Path( "allPolicies" )
104 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
105 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
106 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
107 List<PolicyInformation> getAllPolicyInformations()
108 throws ArchivaRestServiceException;