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.repository.RepositoryAdminException;
22 import org.apache.archiva.rest.api.model.FileType;
23 import org.apache.archiva.rest.api.model.LegacyArtifactPath;
24 import org.apache.archiva.rest.api.model.RepositoryScanning;
25 import org.apache.archiva.security.common.ArchivaRoleConstants;
26 import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
28 import javax.ws.rs.Consumes;
29 import javax.ws.rs.GET;
30 import javax.ws.rs.POST;
31 import javax.ws.rs.Path;
32 import javax.ws.rs.Produces;
33 import javax.ws.rs.QueryParam;
34 import javax.ws.rs.core.MediaType;
35 import java.util.List;
38 * @author Olivier Lamy
41 @Path( "/archivaAdministrationService/" )
42 public interface ArchivaAdministrationService
44 @Path( "getLegacyArtifactPaths" )
46 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
47 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
48 List<LegacyArtifactPath> getLegacyArtifactPaths()
49 throws RepositoryAdminException;
51 @Path( "addLegacyArtifactPath" )
53 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
54 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
55 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
56 void addLegacyArtifactPath( LegacyArtifactPath legacyArtifactPath )
57 throws RepositoryAdminException;
59 @Path( "deleteLegacyArtifactPath" )
61 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
62 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
63 Boolean deleteLegacyArtifactPath( @QueryParam( "path" ) String path )
64 throws RepositoryAdminException;
66 @Path( "getRepositoryScanning" )
68 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
69 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
70 RepositoryScanning getRepositoryScanning()
71 throws RepositoryAdminException;
73 @Path( "updateRepositoryScanning" )
75 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
76 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
77 void updateRepositoryScanning( RepositoryScanning repositoryScanning )
78 throws RepositoryAdminException;
80 @Path( "addFileTypePattern" )
82 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
83 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
84 Boolean addFileTypePattern( @QueryParam( "fileTypeId" ) String fileTypeId, @QueryParam( "pattern" ) String pattern )
85 throws RepositoryAdminException;
87 @Path( "removeFileTypePattern" )
89 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
90 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
91 Boolean removeFileTypePattern( @QueryParam( "fileTypeId" ) String fileTypeId,
92 @QueryParam( "pattern" ) String pattern )
93 throws RepositoryAdminException;
95 @Path( "getFileType" )
97 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
98 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
99 FileType getFileType( String fileTypeId )
100 throws RepositoryAdminException;
102 @Path( "addFileType" )
104 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
105 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
106 void addFileType( FileType fileType )
107 throws RepositoryAdminException;
109 @Path( "removeFileType" )
111 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
112 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
113 Boolean removeFileType( @QueryParam( "fileTypeId" ) String fileTypeId )
114 throws RepositoryAdminException;
116 @Path( "addKnownContentConsumer" )
118 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
119 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
120 Boolean addKnownContentConsumer( @QueryParam( "knownContentConsumer" ) String knownContentConsumer )
121 throws RepositoryAdminException;
123 @Path( "setKnownContentConsumers" )
125 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
126 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
127 void setKnownContentConsumers( List<String> knownContentConsumers )
128 throws RepositoryAdminException;
131 @Path( "removeKnownContentConsumer" )
133 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
134 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
135 Boolean removeKnownContentConsumer( @QueryParam( "knownContentConsumer" ) String knownContentConsumer )
136 throws RepositoryAdminException;
138 @Path( "addInvalidContentConsumer" )
140 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
141 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
142 Boolean addInvalidContentConsumer(@QueryParam( "invalidContentConsumer" ) String invalidContentConsumer )
143 throws RepositoryAdminException;
145 @Path( "setInvalidContentConsumers" )
147 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
148 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
149 void setInvalidContentConsumers( List<String> invalidContentConsumers )
150 throws RepositoryAdminException;
152 @Path( "removeInvalidContentConsumer" )
154 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
155 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
156 Boolean removeInvalidContentConsumer(@QueryParam( "invalidContentConsumer" ) String invalidContentConsumer )
157 throws RepositoryAdminException;