]> source.dussan.org Git - archiva.git/blob
208f24f09eddb9157c01016facdc4dba788b4da1
[archiva.git] /
1 package org.apache.archiva.rest.api.services;
2
3 /*
4  * Licensed to the Apache Software Foundation (ASF) under one
5  * or more contributor license agreements.  See the NOTICE file
6  * distributed with this work for additional information
7  * regarding copyright ownership.  The ASF licenses this file
8  * to you under the Apache License, Version 2.0 (the
9  * "License"); you may not use this file except in compliance
10  * with the License.  You may obtain a copy of the License at
11  *
12  *   http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  * KIND, either express or implied.  See the License for the
18  * specific language governing permissions and limitations
19  * under the License.
20  */
21
22 import io.swagger.v3.oas.annotations.tags.Tag;
23 import io.swagger.v3.oas.annotations.tags.Tags;
24 import org.apache.archiva.admin.model.beans.ManagedRepository;
25 import org.apache.archiva.redback.authorization.RedbackAuthorization;
26 import org.apache.archiva.rest.api.model.ActionStatus;
27 import org.apache.archiva.rest.api.model.ArchivaRepositoryStatistics;
28 import org.apache.archiva.rest.api.model.FileStatus;
29 import org.apache.archiva.security.common.ArchivaRoleConstants;
30
31 import javax.ws.rs.Consumes;
32 import javax.ws.rs.GET;
33 import javax.ws.rs.POST;
34 import javax.ws.rs.Path;
35 import javax.ws.rs.PathParam;
36 import javax.ws.rs.Produces;
37 import javax.ws.rs.QueryParam;
38 import javax.ws.rs.core.MediaType;
39 import java.util.List;
40
41 /**
42  * @author Olivier Lamy
43  * @since 1.4-M1
44  */
45 @Path( "/managedRepositoriesService/" )
46 @Tags( {
47     @Tag( name = "ManagedRepositories", description = "Administration for managed repositories" ),
48     @Tag( name = "Repositories" )
49 })
50 public interface ManagedRepositoriesService
51 {
52     @Path( "getManagedRepositories" )
53     @GET
54     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
55     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
56     List<ManagedRepository> getManagedRepositories()
57         throws ArchivaRestServiceException;
58
59     @Path( "getManagedRepository/{repositoryId}" )
60     @GET
61     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
62     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
63     ManagedRepository getManagedRepository( @PathParam( "repositoryId" ) String repositoryId )
64         throws ArchivaRestServiceException;
65
66     @Path( "deleteManagedRepository" )
67     @GET
68     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
69     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
70     ActionStatus deleteManagedRepository( @QueryParam( "repositoryId" ) String repositoryId,
71                                           @QueryParam( "deleteContent" ) boolean deleteContent )
72         throws ArchivaRestServiceException;
73
74
75     @Path( "addManagedRepository" )
76     @POST
77     @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
78     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
79     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
80     ManagedRepository addManagedRepository( ManagedRepository managedRepository )
81         throws ArchivaRestServiceException;
82
83
84     @Path( "updateManagedRepository" )
85     @POST
86     @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
87     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
88     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
89     ActionStatus updateManagedRepository( ManagedRepository managedRepository )
90         throws ArchivaRestServiceException;
91
92     /**
93      * @since 3.0
94      */
95     @Path( "fileLocationExists" )
96     @GET
97     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
98     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
99     FileStatus getFileStatus( @QueryParam( "fileLocation" ) String fileLocation )
100         throws ArchivaRestServiceException;
101
102     /**
103      * @since 1.4-M3
104      */
105     @Path( "getManagedRepositoryStatistics/{repositoryId}/{lang}" )
106     @GET
107     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
108     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
109     ArchivaRepositoryStatistics getManagedRepositoryStatistics( @PathParam( "repositoryId" ) String repositoryId,
110                                                                 @PathParam( "lang" ) String lang )
111         throws ArchivaRestServiceException;
112
113     /**
114      * return a pom snippet to use this repository with entities escaped (&lt; &gt;)
115      * @since 1.4-M3
116      */
117     @Path( "getPomSnippet/{repositoryId}" )
118     @GET
119     @Produces( { MediaType.TEXT_PLAIN } )
120     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
121     String getPomSnippet( @PathParam( "repositoryId" ) String repositoryId )
122         throws ArchivaRestServiceException;
123
124
125 }