1 package org.apache.archiva.rest.api.services;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import io.swagger.v3.oas.annotations.tags.Tag;
23 import io.swagger.v3.oas.annotations.tags.Tags;
24 import org.apache.archiva.admin.model.beans.ManagedRepository;
25 import org.apache.archiva.redback.authorization.RedbackAuthorization;
26 import org.apache.archiva.rest.api.model.ActionStatus;
27 import org.apache.archiva.rest.api.model.ArchivaRepositoryStatistics;
28 import org.apache.archiva.rest.api.model.FileStatus;
29 import org.apache.archiva.security.common.ArchivaRoleConstants;
31 import javax.ws.rs.Consumes;
32 import javax.ws.rs.GET;
33 import javax.ws.rs.POST;
34 import javax.ws.rs.Path;
35 import javax.ws.rs.PathParam;
36 import javax.ws.rs.Produces;
37 import javax.ws.rs.QueryParam;
38 import javax.ws.rs.core.MediaType;
39 import java.util.List;
42 * @author Olivier Lamy
45 @Path( "/managedRepositoriesService/" )
47 @Tag( name = "ManagedRepositories", description = "Administration for managed repositories" ),
48 @Tag( name = "Repositories" )
50 public interface ManagedRepositoriesService
52 @Path( "getManagedRepositories" )
54 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
55 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
56 List<ManagedRepository> getManagedRepositories()
57 throws ArchivaRestServiceException;
59 @Path( "getManagedRepository/{repositoryId}" )
61 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
62 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
63 ManagedRepository getManagedRepository( @PathParam( "repositoryId" ) String repositoryId )
64 throws ArchivaRestServiceException;
66 @Path( "deleteManagedRepository" )
68 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
69 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
70 ActionStatus deleteManagedRepository( @QueryParam( "repositoryId" ) String repositoryId,
71 @QueryParam( "deleteContent" ) boolean deleteContent )
72 throws ArchivaRestServiceException;
75 @Path( "addManagedRepository" )
77 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
78 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
79 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
80 ManagedRepository addManagedRepository( ManagedRepository managedRepository )
81 throws ArchivaRestServiceException;
84 @Path( "updateManagedRepository" )
86 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
87 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
88 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
89 ActionStatus updateManagedRepository( ManagedRepository managedRepository )
90 throws ArchivaRestServiceException;
95 @Path( "fileLocationExists" )
97 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
98 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
99 FileStatus getFileStatus( @QueryParam( "fileLocation" ) String fileLocation )
100 throws ArchivaRestServiceException;
105 @Path( "getManagedRepositoryStatistics/{repositoryId}/{lang}" )
107 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
108 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
109 ArchivaRepositoryStatistics getManagedRepositoryStatistics( @PathParam( "repositoryId" ) String repositoryId,
110 @PathParam( "lang" ) String lang )
111 throws ArchivaRestServiceException;
114 * return a pom snippet to use this repository with entities escaped (< >)
117 @Path( "getPomSnippet/{repositoryId}" )
119 @Produces( { MediaType.TEXT_PLAIN } )
120 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION )
121 String getPomSnippet( @PathParam( "repositoryId" ) String repositoryId )
122 throws ArchivaRestServiceException;