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.rest.api.model.FileType;
22 import org.apache.archiva.rest.api.model.LegacyArtifactPath;
23 import org.apache.archiva.rest.api.model.RepositoryScanning;
24 import org.apache.archiva.security.common.ArchivaRoleConstants;
25 import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
27 import javax.ws.rs.Consumes;
28 import javax.ws.rs.GET;
29 import javax.ws.rs.POST;
30 import javax.ws.rs.Path;
31 import javax.ws.rs.Produces;
32 import javax.ws.rs.QueryParam;
33 import javax.ws.rs.core.MediaType;
34 import java.util.List;
37 * @author Olivier Lamy
40 @Path( "/archivaAdministrationService/" )
41 public interface ArchivaAdministrationService
43 @Path( "getLegacyArtifactPaths" )
45 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
46 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
47 List<LegacyArtifactPath> getLegacyArtifactPaths()
48 throws ArchivaRestServiceException;
50 @Path( "addLegacyArtifactPath" )
52 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
53 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
54 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
55 void addLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath )
56 throws ArchivaRestServiceException;
58 @Path( "deleteLegacyArtifactPath" )
60 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
61 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
62 Boolean deleteLegacyArtifactPath( @QueryParam( "path" ) String path )
63 throws ArchivaRestServiceException;
65 @Path( "getRepositoryScanning" )
67 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
68 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
69 RepositoryScanning getRepositoryScanning()
70 throws ArchivaRestServiceException;
72 @Path( "updateRepositoryScanning" )
74 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
75 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
76 void updateRepositoryScanning( RepositoryScanning repositoryScanning )
77 throws ArchivaRestServiceException;
79 @Path( "addFileTypePattern" )
81 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
82 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
83 Boolean addFileTypePattern( @QueryParam( "fileTypeId" ) String fileTypeId, @QueryParam( "pattern" ) String pattern )
84 throws ArchivaRestServiceException;
86 @Path( "removeFileTypePattern" )
88 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
89 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
90 Boolean removeFileTypePattern( @QueryParam( "fileTypeId" ) String fileTypeId,
91 @QueryParam( "pattern" ) String pattern )
92 throws ArchivaRestServiceException;
94 @Path( "getFileType" )
96 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
97 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
98 FileType getFileType( String fileTypeId )
99 throws ArchivaRestServiceException;
101 @Path( "addFileType" )
103 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
104 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
105 void addFileType( FileType fileType )
106 throws ArchivaRestServiceException;
108 @Path( "removeFileType" )
110 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
111 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
112 Boolean removeFileType( @QueryParam( "fileTypeId" ) String fileTypeId )
113 throws ArchivaRestServiceException;
115 @Path( "addKnownContentConsumer" )
117 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
118 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
119 Boolean addKnownContentConsumer( @QueryParam( "knownContentConsumer" ) String knownContentConsumer )
120 throws ArchivaRestServiceException;
122 @Path( "setKnownContentConsumers" )
124 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
125 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
126 void setKnownContentConsumers( List<String> knownContentConsumers )
127 throws ArchivaRestServiceException;
130 @Path( "removeKnownContentConsumer" )
132 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
133 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
134 Boolean removeKnownContentConsumer( @QueryParam( "knownContentConsumer" ) String knownContentConsumer )
135 throws ArchivaRestServiceException;
137 @Path( "addInvalidContentConsumer" )
139 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
140 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
141 Boolean addInvalidContentConsumer(@QueryParam( "invalidContentConsumer" ) String invalidContentConsumer )
142 throws ArchivaRestServiceException;
144 @Path( "setInvalidContentConsumers" )
146 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
147 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
148 void setInvalidContentConsumers( List<String> invalidContentConsumers )
149 throws ArchivaRestServiceException;
151 @Path( "removeInvalidContentConsumer" )
153 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
154 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
155 Boolean removeInvalidContentConsumer(@QueryParam( "invalidContentConsumer" ) String invalidContentConsumer )
156 throws ArchivaRestServiceException;