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