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 io.swagger.v3.oas.annotations.Operation;
22 import io.swagger.v3.oas.annotations.Parameter;
23 import io.swagger.v3.oas.annotations.tags.Tag;
24 import org.apache.archiva.admin.model.beans.FileType;
25 import org.apache.archiva.admin.model.beans.LegacyArtifactPath;
26 import org.apache.archiva.admin.model.beans.NetworkConfiguration;
27 import org.apache.archiva.admin.model.beans.OrganisationInformation;
28 import org.apache.archiva.admin.model.beans.UiConfiguration;
29 import org.apache.archiva.redback.authorization.RedbackAuthorization;
30 import org.apache.archiva.rest.api.model.AdminRepositoryConsumer;
31 import org.apache.archiva.security.common.ArchivaRoleConstants;
33 import javax.ws.rs.Consumes;
34 import javax.ws.rs.GET;
35 import javax.ws.rs.POST;
36 import javax.ws.rs.Path;
37 import javax.ws.rs.PathParam;
38 import javax.ws.rs.Produces;
39 import javax.ws.rs.QueryParam;
40 import javax.ws.rs.core.MediaType;
41 import java.util.List;
44 * @author Olivier Lamy
47 @Path( "/archivaAdministrationService/" )
48 @Tag( name = "Administration", description = "Admin Service" )
49 public interface ArchivaAdministrationService
51 @Path( "getLegacyArtifactPaths" )
53 @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
54 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
55 List<LegacyArtifactPath> getLegacyArtifactPaths( )
56 throws ArchivaRestServiceException;
58 @Path( "deleteLegacyArtifactPath" )
60 @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
61 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
62 Boolean deleteLegacyArtifactPath( @QueryParam( "path" ) String path )
63 throws ArchivaRestServiceException;
65 @Path( "addFileTypePattern" )
67 @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
68 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
69 Boolean addFileTypePattern( @QueryParam( "fileTypeId" ) String fileTypeId, @QueryParam( "pattern" ) String pattern )
70 throws ArchivaRestServiceException;
72 @Path( "removeFileTypePattern" )
74 @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
75 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
76 Boolean removeFileTypePattern( @QueryParam( "fileTypeId" ) String fileTypeId,
77 @QueryParam( "pattern" ) String pattern )
78 throws ArchivaRestServiceException;
80 @Path( "getFileType" )
82 @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
83 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
85 summary = "Return the file type and its patterns",
86 description = "Returns a object that contains the file type and the configured patterns for this type"
90 @Parameter( name = "fileTypeId", description = "The identifier of the file type",
91 allowEmptyValue = false, required = true )
92 @QueryParam( "fileTypeId" ) String fileTypeId )
93 throws ArchivaRestServiceException;
95 @Path( "addFileType" )
97 @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
98 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
99 void addFileType( FileType fileType )
100 throws ArchivaRestServiceException;
102 @Path( "removeFileType" )
104 @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
105 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
106 Boolean removeFileType( @QueryParam( "fileTypeId" ) String fileTypeId )
107 throws ArchivaRestServiceException;
109 @Path( "enabledKnownContentConsumer/{knownContentConsumer}" )
111 @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
112 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
113 Boolean enabledKnownContentConsumer( @PathParam( "knownContentConsumer" ) String knownContentConsumer )
114 throws ArchivaRestServiceException;
116 @Path( "enabledKnownContentConsumers" )
118 @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
119 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
120 void enabledKnownContentConsumers( List<String> knownContentConsumers )
121 throws ArchivaRestServiceException;
124 @Path( "disabledKnownContentConsumer/{knownContentConsumer}" )
126 @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
127 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
128 Boolean disabledKnownContentConsumer( @PathParam( "knownContentConsumer" ) String knownContentConsumer )
129 throws ArchivaRestServiceException;
131 @Path( "enabledInvalidContentConsumer/{invalidContentConsumer}" )
133 @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
134 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
135 Boolean enabledInvalidContentConsumer( @PathParam( "invalidContentConsumer" ) String invalidContentConsumer )
136 throws ArchivaRestServiceException;
138 @Path( "enabledInvalidContentConsumers" )
140 @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
141 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
142 void enabledInvalidContentConsumers( List<String> invalidContentConsumers )
143 throws ArchivaRestServiceException;
145 @Path( "disabledInvalidContentConsumer/{invalidContentConsumer}" )
147 @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
148 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
149 Boolean disabledInvalidContentConsumer( @PathParam( "invalidContentConsumer" ) String invalidContentConsumer )
150 throws ArchivaRestServiceException;
152 @Path( "getFileTypes" )
154 @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
155 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
156 List<FileType> getFileTypes( )
157 throws ArchivaRestServiceException;
159 @Path( "getKnownContentConsumers" )
161 @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
162 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
163 List<String> getKnownContentConsumers( )
164 throws ArchivaRestServiceException;
169 @Path( "getKnownContentAdminRepositoryConsumers" )
171 @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
172 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
173 List<AdminRepositoryConsumer> getKnownContentAdminRepositoryConsumers( )
174 throws ArchivaRestServiceException;
179 @Path( "getInvalidContentAdminRepositoryConsumers" )
181 @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
182 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
183 List<AdminRepositoryConsumer> getInvalidContentAdminRepositoryConsumers( )
184 throws ArchivaRestServiceException;
186 @Path( "getInvalidContentConsumers" )
188 @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
189 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
190 List<String> getInvalidContentConsumers( )
191 throws ArchivaRestServiceException;
193 @Path( "getOrganisationInformation" )
195 @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN} )
196 @RedbackAuthorization( noPermission = true, noRestriction = true )
197 OrganisationInformation getOrganisationInformation( )
198 throws ArchivaRestServiceException;
200 @Path( "setOrganisationInformation" )
202 @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
203 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
204 void setOrganisationInformation( OrganisationInformation organisationInformation )
205 throws ArchivaRestServiceException;
207 @Path( "getUiConfiguration" )
209 @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
210 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
211 UiConfiguration getUiConfiguration( )
212 throws ArchivaRestServiceException;
214 @Path( "registrationDisabled" )
216 @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
217 @RedbackAuthorization( noRestriction = true, noPermission = true )
218 Boolean registrationDisabled( )
219 throws ArchivaRestServiceException;
221 @Path( "setUiConfiguration" )
223 @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
224 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
225 void setUiConfiguration( UiConfiguration uiConfiguration )
226 throws ArchivaRestServiceException;
231 @Path( "applicationUrl" )
233 @Produces( MediaType.TEXT_PLAIN )
234 @RedbackAuthorization( noRestriction = true, noPermission = true )
235 String getApplicationUrl( )
236 throws ArchivaRestServiceException;
239 @Path( "getNetworkConfiguration" )
241 @Produces( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
242 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
243 NetworkConfiguration getNetworkConfiguration( )
244 throws ArchivaRestServiceException;
246 @Path( "setNetworkConfiguration" )
248 @Consumes( {MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML} )
249 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
250 void setNetworkConfiguration( NetworkConfiguration networkConfiguration )
251 throws ArchivaRestServiceException;