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.security.common.ArchivaRoleConstants;
27 import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
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;
39 * @author Olivier Lamy
42 @Path( "/archivaAdministrationService/" )
43 public interface ArchivaAdministrationService
45 @Path( "getLegacyArtifactPaths" )
47 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
48 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
49 List<LegacyArtifactPath> getLegacyArtifactPaths()
50 throws ArchivaRestServiceException;
52 @Path( "addLegacyArtifactPath" )
54 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
55 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
56 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
57 void addLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath )
58 throws ArchivaRestServiceException;
60 @Path( "deleteLegacyArtifactPath" )
62 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
63 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
64 Boolean deleteLegacyArtifactPath( @QueryParam( "path" ) String path )
65 throws ArchivaRestServiceException;
67 @Path( "addFileTypePattern" )
69 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
70 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
71 Boolean addFileTypePattern( @QueryParam( "fileTypeId" ) String fileTypeId, @QueryParam( "pattern" ) String pattern )
72 throws ArchivaRestServiceException;
74 @Path( "removeFileTypePattern" )
76 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
77 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
78 Boolean removeFileTypePattern( @QueryParam( "fileTypeId" ) String fileTypeId,
79 @QueryParam( "pattern" ) String pattern )
80 throws ArchivaRestServiceException;
82 @Path( "getFileType" )
84 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
85 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
86 FileType getFileType( @QueryParam( "fileTypeId" ) String fileTypeId )
87 throws ArchivaRestServiceException;
89 @Path( "addFileType" )
91 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
92 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
93 void addFileType( FileType fileType )
94 throws ArchivaRestServiceException;
96 @Path( "removeFileType" )
98 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
99 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
100 Boolean removeFileType( @QueryParam( "fileTypeId" ) String fileTypeId )
101 throws ArchivaRestServiceException;
103 @Path( "addKnownContentConsumer" )
105 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
106 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
107 Boolean addKnownContentConsumer( @QueryParam( "knownContentConsumer" ) String knownContentConsumer )
108 throws ArchivaRestServiceException;
110 @Path( "setKnownContentConsumers" )
112 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
113 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
114 void setKnownContentConsumers( List<String> knownContentConsumers )
115 throws ArchivaRestServiceException;
118 @Path( "removeKnownContentConsumer" )
120 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
121 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
122 Boolean removeKnownContentConsumer( @QueryParam( "knownContentConsumer" ) String knownContentConsumer )
123 throws ArchivaRestServiceException;
125 @Path( "addInvalidContentConsumer" )
127 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
128 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
129 Boolean addInvalidContentConsumer( @QueryParam( "invalidContentConsumer" ) String invalidContentConsumer )
130 throws ArchivaRestServiceException;
132 @Path( "setInvalidContentConsumers" )
134 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
135 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
136 void setInvalidContentConsumers( List<String> invalidContentConsumers )
137 throws ArchivaRestServiceException;
139 @Path( "removeInvalidContentConsumer" )
141 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
142 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
143 Boolean removeInvalidContentConsumer( @QueryParam( "invalidContentConsumer" ) String invalidContentConsumer )
144 throws ArchivaRestServiceException;
146 @Path( "getFileTypes" )
148 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
149 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
150 List<FileType> getFileTypes()
151 throws ArchivaRestServiceException;
153 @Path( "getKnownContentConsumers" )
155 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
156 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
157 List<String> getKnownContentConsumers()
158 throws ArchivaRestServiceException;
160 @Path( "getInvalidContentConsumers" )
162 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
163 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
164 List<String> getInvalidContentConsumers()
165 throws ArchivaRestServiceException;
167 @Path( "getOrganisationInformation" )
169 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
170 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
171 OrganisationInformation getOrganisationInformation()
172 throws ArchivaRestServiceException;
174 @Path( "setOrganisationInformation" )
176 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
177 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
178 void setOrganisationInformation( OrganisationInformation organisationInformation )
179 throws ArchivaRestServiceException;
181 @Path( "getUiConfiguration" )
183 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
184 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
185 UiConfiguration getUiConfiguration()
186 throws ArchivaRestServiceException;
188 @Path( "setUiConfiguration" )
190 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
191 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
192 void setUiConfiguration( UiConfiguration uiConfiguration )
193 throws ArchivaRestServiceException;
196 @Path( "getNetworkConfiguration" )
198 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
199 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
200 NetworkConfiguration getNetworkConfiguration()
201 throws ArchivaRestServiceException;
203 @Path( "setNetworkConfiguration" )
205 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
206 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
207 void setNetworkConfiguration( NetworkConfiguration networkConfiguration )
208 throws ArchivaRestServiceException;