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