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( "addLegacyArtifactPath" )
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;
62 @Path( "deleteLegacyArtifactPath" )
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;
69 @Path( "addFileTypePattern" )
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;
76 @Path( "removeFileTypePattern" )
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;
84 @Path( "getFileType" )
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;
91 @Path( "addFileType" )
93 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
94 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
95 void addFileType( FileType fileType )
96 throws ArchivaRestServiceException;
98 @Path( "removeFileType" )
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;
105 @Path( "enabledKnownContentConsumer/{knownContentConsumer}" )
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;
112 @Path( "enabledKnownContentConsumers" )
114 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
115 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
116 void enabledKnownContentConsumers( List<String> knownContentConsumers )
117 throws ArchivaRestServiceException;
120 @Path( "disabledKnownContentConsumer/{knownContentConsumer}" )
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;
127 @Path( "enabledInvalidContentConsumer/{invalidContentConsumer}" )
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;
134 @Path( "enabledInvalidContentConsumers" )
136 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
137 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
138 void enabledInvalidContentConsumers( List<String> invalidContentConsumers )
139 throws ArchivaRestServiceException;
141 @Path( "disabledInvalidContentConsumer/{invalidContentConsumer}" )
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;
148 @Path( "getFileTypes" )
150 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
151 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
152 List<FileType> getFileTypes()
153 throws ArchivaRestServiceException;
155 @Path( "getKnownContentConsumers" )
157 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
158 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
159 List<String> getKnownContentConsumers()
160 throws ArchivaRestServiceException;
165 @Path( "getKnownContentAdminRepositoryConsumers" )
167 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
168 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
169 List<AdminRepositoryConsumer> getKnownContentAdminRepositoryConsumers()
170 throws ArchivaRestServiceException;
175 @Path( "getInvalidContentAdminRepositoryConsumers" )
177 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
178 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
179 List<AdminRepositoryConsumer> getInvalidContentAdminRepositoryConsumers()
180 throws ArchivaRestServiceException;
182 @Path( "getInvalidContentConsumers" )
184 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
185 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
186 List<String> getInvalidContentConsumers()
187 throws ArchivaRestServiceException;
189 @Path( "getOrganisationInformation" )
191 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
192 @RedbackAuthorization( noPermission = true, noRestriction = true )
193 OrganisationInformation getOrganisationInformation()
194 throws ArchivaRestServiceException;
196 @Path( "setOrganisationInformation" )
198 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
199 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
200 void setOrganisationInformation( OrganisationInformation organisationInformation )
201 throws ArchivaRestServiceException;
203 @Path( "getUiConfiguration" )
205 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
206 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
207 UiConfiguration getUiConfiguration()
208 throws ArchivaRestServiceException;
210 @Path( "registrationDisabled" )
212 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
213 @RedbackAuthorization( noRestriction = true, noPermission = true )
214 Boolean registrationDisabled()
215 throws ArchivaRestServiceException;
217 @Path( "setUiConfiguration" )
219 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
220 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
221 void setUiConfiguration( UiConfiguration uiConfiguration )
222 throws ArchivaRestServiceException;
227 @Path( "applicationUrl" )
229 @Produces( MediaType.TEXT_PLAIN )
230 @RedbackAuthorization( noRestriction = true, noPermission = true )
231 String getApplicationUrl()
232 throws ArchivaRestServiceException;
235 @Path( "getNetworkConfiguration" )
237 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
238 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
239 NetworkConfiguration getNetworkConfiguration()
240 throws ArchivaRestServiceException;
242 @Path( "setNetworkConfiguration" )
244 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
245 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
246 void setNetworkConfiguration( NetworkConfiguration networkConfiguration )
247 throws ArchivaRestServiceException;