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 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;
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;
40 * @author Olivier Lamy
43 @Path( "/archivaAdministrationService/" )
44 public interface ArchivaAdministrationService
46 @Path( "getLegacyArtifactPaths" )
48 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
49 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
50 List<LegacyArtifactPath> getLegacyArtifactPaths()
51 throws ArchivaRestServiceException;
53 @Path( "addLegacyArtifactPath" )
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;
61 @Path( "deleteLegacyArtifactPath" )
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;
68 @Path( "addFileTypePattern" )
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;
75 @Path( "removeFileTypePattern" )
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;
83 @Path( "getFileType" )
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;
90 @Path( "addFileType" )
92 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
93 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
94 void addFileType( FileType fileType )
95 throws ArchivaRestServiceException;
97 @Path( "removeFileType" )
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;
104 @Path( "addKnownContentConsumer" )
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;
111 @Path( "setKnownContentConsumers" )
113 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
114 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
115 void setKnownContentConsumers( List<String> knownContentConsumers )
116 throws ArchivaRestServiceException;
119 @Path( "removeKnownContentConsumer" )
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;
126 @Path( "addInvalidContentConsumer" )
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;
133 @Path( "setInvalidContentConsumers" )
135 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
136 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
137 void setInvalidContentConsumers( List<String> invalidContentConsumers )
138 throws ArchivaRestServiceException;
140 @Path( "removeInvalidContentConsumer" )
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;
147 @Path( "getFileTypes" )
149 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
150 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
151 List<FileType> getFileTypes()
152 throws ArchivaRestServiceException;
154 @Path( "getKnownContentConsumers" )
156 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
157 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
158 List<String> getKnownContentConsumers()
159 throws ArchivaRestServiceException;
161 @Path( "getKnownContentAdminRepositoryConsumers" )
163 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
164 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
168 List<AdminRepositoryConsumer> getKnownContentAdminRepositoryConsumers()
169 throws ArchivaRestServiceException;
171 @Path( "getInvalidContentAdminRepositoryConsumers" )
173 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
174 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
178 List<AdminRepositoryConsumer> getInvalidContentAdminRepositoryConsumers()
179 throws ArchivaRestServiceException;
181 @Path( "getInvalidContentConsumers" )
183 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
184 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
185 List<String> getInvalidContentConsumers()
186 throws ArchivaRestServiceException;
188 @Path( "getOrganisationInformation" )
190 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
191 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
192 OrganisationInformation getOrganisationInformation()
193 throws ArchivaRestServiceException;
195 @Path( "setOrganisationInformation" )
197 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
198 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
199 void setOrganisationInformation( OrganisationInformation organisationInformation )
200 throws ArchivaRestServiceException;
202 @Path( "getUiConfiguration" )
204 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
205 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
206 UiConfiguration getUiConfiguration()
207 throws ArchivaRestServiceException;
209 @Path( "setUiConfiguration" )
211 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
212 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
213 void setUiConfiguration( UiConfiguration uiConfiguration )
214 throws ArchivaRestServiceException;
217 @Path( "getNetworkConfiguration" )
219 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
220 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
221 NetworkConfiguration getNetworkConfiguration()
222 throws ArchivaRestServiceException;
224 @Path( "setNetworkConfiguration" )
226 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
227 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
228 void setNetworkConfiguration( NetworkConfiguration networkConfiguration )
229 throws ArchivaRestServiceException;