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.redback.authorization.RedbackAuthorization;
27 import org.apache.archiva.rest.api.model.AdminRepositoryConsumer;
28 import org.apache.archiva.security.common.ArchivaRoleConstants;
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;
41 * @author Olivier Lamy
44 @Path( "/archivaAdministrationService/" )
45 public interface ArchivaAdministrationService
47 @Path( "getLegacyArtifactPaths" )
49 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
50 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
51 List<LegacyArtifactPath> getLegacyArtifactPaths()
52 throws ArchivaRestServiceException;
54 @Path( "deleteLegacyArtifactPath" )
56 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
57 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
58 Boolean deleteLegacyArtifactPath( @QueryParam( "path" ) String path )
59 throws ArchivaRestServiceException;
61 @Path( "addFileTypePattern" )
63 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
64 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
65 Boolean addFileTypePattern( @QueryParam( "fileTypeId" ) String fileTypeId, @QueryParam( "pattern" ) String pattern )
66 throws ArchivaRestServiceException;
68 @Path( "removeFileTypePattern" )
70 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
71 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
72 Boolean removeFileTypePattern( @QueryParam( "fileTypeId" ) String fileTypeId,
73 @QueryParam( "pattern" ) String pattern )
74 throws ArchivaRestServiceException;
76 @Path( "getFileType" )
78 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
79 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
80 FileType getFileType( @QueryParam( "fileTypeId" ) String fileTypeId )
81 throws ArchivaRestServiceException;
83 @Path( "addFileType" )
85 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
86 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
87 void addFileType( FileType fileType )
88 throws ArchivaRestServiceException;
90 @Path( "removeFileType" )
92 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
93 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
94 Boolean removeFileType( @QueryParam( "fileTypeId" ) String fileTypeId )
95 throws ArchivaRestServiceException;
97 @Path( "enabledKnownContentConsumer/{knownContentConsumer}" )
99 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
100 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
101 Boolean enabledKnownContentConsumer( @PathParam( "knownContentConsumer" ) String knownContentConsumer )
102 throws ArchivaRestServiceException;
104 @Path( "enabledKnownContentConsumers" )
106 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
107 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
108 void enabledKnownContentConsumers( List<String> knownContentConsumers )
109 throws ArchivaRestServiceException;
112 @Path( "disabledKnownContentConsumer/{knownContentConsumer}" )
114 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
115 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
116 Boolean disabledKnownContentConsumer( @PathParam( "knownContentConsumer" ) String knownContentConsumer )
117 throws ArchivaRestServiceException;
119 @Path( "enabledInvalidContentConsumer/{invalidContentConsumer}" )
121 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
122 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
123 Boolean enabledInvalidContentConsumer( @PathParam( "invalidContentConsumer" ) String invalidContentConsumer )
124 throws ArchivaRestServiceException;
126 @Path( "enabledInvalidContentConsumers" )
128 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
129 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
130 void enabledInvalidContentConsumers( List<String> invalidContentConsumers )
131 throws ArchivaRestServiceException;
133 @Path( "disabledInvalidContentConsumer/{invalidContentConsumer}" )
135 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
136 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
137 Boolean disabledInvalidContentConsumer( @PathParam( "invalidContentConsumer" ) String invalidContentConsumer )
138 throws ArchivaRestServiceException;
140 @Path( "getFileTypes" )
142 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
143 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
144 List<FileType> getFileTypes()
145 throws ArchivaRestServiceException;
147 @Path( "getKnownContentConsumers" )
149 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
150 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
151 List<String> getKnownContentConsumers()
152 throws ArchivaRestServiceException;
157 @Path( "getKnownContentAdminRepositoryConsumers" )
159 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
160 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
161 List<AdminRepositoryConsumer> getKnownContentAdminRepositoryConsumers()
162 throws ArchivaRestServiceException;
167 @Path( "getInvalidContentAdminRepositoryConsumers" )
169 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
170 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
171 List<AdminRepositoryConsumer> getInvalidContentAdminRepositoryConsumers()
172 throws ArchivaRestServiceException;
174 @Path( "getInvalidContentConsumers" )
176 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
177 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
178 List<String> getInvalidContentConsumers()
179 throws ArchivaRestServiceException;
181 @Path( "getOrganisationInformation" )
183 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
184 @RedbackAuthorization( noPermission = true, noRestriction = true )
185 OrganisationInformation getOrganisationInformation()
186 throws ArchivaRestServiceException;
188 @Path( "setOrganisationInformation" )
190 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
191 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
192 void setOrganisationInformation( OrganisationInformation organisationInformation )
193 throws ArchivaRestServiceException;
195 @Path( "getUiConfiguration" )
197 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
198 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
199 UiConfiguration getUiConfiguration()
200 throws ArchivaRestServiceException;
202 @Path( "registrationDisabled" )
204 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
205 @RedbackAuthorization( noRestriction = true, noPermission = true )
206 Boolean registrationDisabled()
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;
219 @Path( "applicationUrl" )
221 @Produces( MediaType.TEXT_PLAIN )
222 @RedbackAuthorization( noRestriction = true, noPermission = true )
223 String getApplicationUrl()
224 throws ArchivaRestServiceException;
227 @Path( "getNetworkConfiguration" )
229 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
230 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
231 NetworkConfiguration getNetworkConfiguration()
232 throws ArchivaRestServiceException;
234 @Path( "setNetworkConfiguration" )
236 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
237 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
238 void setNetworkConfiguration( NetworkConfiguration networkConfiguration )
239 throws ArchivaRestServiceException;