]> source.dussan.org Git - archiva.git/blob
a8f7f11658569d4f2abf02ac13ec263e314ebdcf
[archiva.git] /
1 package org.apache.archiva.rest.api.services;
2 /*
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
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
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
18  * under the License.
19  */
20
21 import org.apache.archiva.admin.model.beans.FileType;
22 import org.apache.archiva.admin.model.beans.LegacyArtifactPath;
23 import org.apache.archiva.admin.model.beans.NetworkConfiguration;
24 import org.apache.archiva.admin.model.beans.OrganisationInformation;
25 import org.apache.archiva.admin.model.beans.UiConfiguration;
26 import org.apache.archiva.rest.api.model.AdminRepositoryConsumer;
27 import org.apache.archiva.security.common.ArchivaRoleConstants;
28 import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
29
30 import javax.ws.rs.Consumes;
31 import javax.ws.rs.GET;
32 import javax.ws.rs.POST;
33 import javax.ws.rs.Path;
34 import javax.ws.rs.Produces;
35 import javax.ws.rs.QueryParam;
36 import javax.ws.rs.core.MediaType;
37 import java.util.List;
38
39 /**
40  * @author Olivier Lamy
41  * @since 1.4-M1
42  */
43 @Path( "/archivaAdministrationService/" )
44 public interface ArchivaAdministrationService
45 {
46     @Path( "getLegacyArtifactPaths" )
47     @GET
48     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
49     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
50     List<LegacyArtifactPath> getLegacyArtifactPaths()
51         throws ArchivaRestServiceException;
52
53     @Path( "addLegacyArtifactPath" )
54     @POST
55     @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
56     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
57     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
58     void addLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath )
59         throws ArchivaRestServiceException;
60
61     @Path( "deleteLegacyArtifactPath" )
62     @GET
63     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
64     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
65     Boolean deleteLegacyArtifactPath( @QueryParam( "path" ) String path )
66         throws ArchivaRestServiceException;
67
68     @Path( "addFileTypePattern" )
69     @GET
70     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
71     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
72     Boolean addFileTypePattern( @QueryParam( "fileTypeId" ) String fileTypeId, @QueryParam( "pattern" ) String pattern )
73         throws ArchivaRestServiceException;
74
75     @Path( "removeFileTypePattern" )
76     @GET
77     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
78     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
79     Boolean removeFileTypePattern( @QueryParam( "fileTypeId" ) String fileTypeId,
80                                    @QueryParam( "pattern" ) String pattern )
81         throws ArchivaRestServiceException;
82
83     @Path( "getFileType" )
84     @GET
85     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
86     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
87     FileType getFileType( @QueryParam( "fileTypeId" ) String fileTypeId )
88         throws ArchivaRestServiceException;
89
90     @Path( "addFileType" )
91     @POST
92     @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
93     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
94     void addFileType( FileType fileType )
95         throws ArchivaRestServiceException;
96
97     @Path( "removeFileType" )
98     @GET
99     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
100     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
101     Boolean removeFileType( @QueryParam( "fileTypeId" ) String fileTypeId )
102         throws ArchivaRestServiceException;
103
104     @Path( "addKnownContentConsumer" )
105     @GET
106     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
107     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
108     Boolean addKnownContentConsumer( @QueryParam( "knownContentConsumer" ) String knownContentConsumer )
109         throws ArchivaRestServiceException;
110
111     @Path( "setKnownContentConsumers" )
112     @POST
113     @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
114     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
115     void setKnownContentConsumers( List<String> knownContentConsumers )
116         throws ArchivaRestServiceException;
117
118
119     @Path( "removeKnownContentConsumer" )
120     @GET
121     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
122     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
123     Boolean removeKnownContentConsumer( @QueryParam( "knownContentConsumer" ) String knownContentConsumer )
124         throws ArchivaRestServiceException;
125
126     @Path( "addInvalidContentConsumer" )
127     @GET
128     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
129     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
130     Boolean addInvalidContentConsumer( @QueryParam( "invalidContentConsumer" ) String invalidContentConsumer )
131         throws ArchivaRestServiceException;
132
133     @Path( "setInvalidContentConsumers" )
134     @POST
135     @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
136     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
137     void setInvalidContentConsumers( List<String> invalidContentConsumers )
138         throws ArchivaRestServiceException;
139
140     @Path( "removeInvalidContentConsumer" )
141     @GET
142     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
143     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
144     Boolean removeInvalidContentConsumer( @QueryParam( "invalidContentConsumer" ) String invalidContentConsumer )
145         throws ArchivaRestServiceException;
146
147     @Path( "getFileTypes" )
148     @GET
149     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
150     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
151     List<FileType> getFileTypes()
152         throws ArchivaRestServiceException;
153
154     @Path( "getKnownContentConsumers" )
155     @GET
156     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
157     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
158     List<String> getKnownContentConsumers()
159         throws ArchivaRestServiceException;
160
161     @Path( "getKnownContentAdminRepositoryConsumers" )
162     @GET
163     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
164     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
165     /**
166      * @since 1.4-M3
167      */
168     List<AdminRepositoryConsumer> getKnownContentAdminRepositoryConsumers()
169         throws ArchivaRestServiceException;
170
171     @Path( "getInvalidContentAdminRepositoryConsumers" )
172     @GET
173     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
174     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
175     /**
176      * @since 1.4-M3
177      */
178     List<AdminRepositoryConsumer> getInvalidContentAdminRepositoryConsumers()
179         throws ArchivaRestServiceException;
180
181     @Path( "getInvalidContentConsumers" )
182     @GET
183     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
184     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
185     List<String> getInvalidContentConsumers()
186         throws ArchivaRestServiceException;
187
188     @Path( "getOrganisationInformation" )
189     @GET
190     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
191     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
192     OrganisationInformation getOrganisationInformation()
193         throws ArchivaRestServiceException;
194
195     @Path( "setOrganisationInformation" )
196     @POST
197     @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
198     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
199     void setOrganisationInformation( OrganisationInformation organisationInformation )
200         throws ArchivaRestServiceException;
201
202     @Path( "getUiConfiguration" )
203     @GET
204     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
205     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
206     UiConfiguration getUiConfiguration()
207         throws ArchivaRestServiceException;
208
209     @Path( "setUiConfiguration" )
210     @POST
211     @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
212     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
213     void setUiConfiguration( UiConfiguration uiConfiguration )
214         throws ArchivaRestServiceException;
215
216
217     @Path( "getNetworkConfiguration" )
218     @GET
219     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
220     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
221     NetworkConfiguration getNetworkConfiguration()
222         throws ArchivaRestServiceException;
223
224     @Path( "setNetworkConfiguration" )
225     @POST
226     @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
227     @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
228     void setNetworkConfiguration( NetworkConfiguration networkConfiguration )
229         throws ArchivaRestServiceException;
230 }
231