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 org.apache.archiva.rest.api.model.Artifact;
23 import org.apache.archiva.rest.api.model.ArtifactTransferRequest;
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.PathParam;
32 import javax.ws.rs.Produces;
33 import javax.ws.rs.QueryParam;
34 import javax.ws.rs.core.MediaType;
37 * @author Olivier Lamy
40 @Path( "/repositoriesService/" )
41 public interface RepositoriesService
44 @Path( "scanRepository" )
46 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
47 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_RUN_INDEXER )
48 Boolean scanRepository( @QueryParam( "repositoryId" ) String repositoryId,
49 @QueryParam( "fullScan" ) boolean fullScan )
50 throws ArchivaRestServiceException;
53 @Path( "alreadyScanning/{repositoryId}" )
55 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
56 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_RUN_INDEXER )
57 Boolean alreadyScanning( @PathParam( "repositoryId" ) String repositoryId )
58 throws ArchivaRestServiceException;
60 @Path( "removeScanningTaskFromQueue/{repositoryId}" )
62 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
63 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_RUN_INDEXER )
64 Boolean removeScanningTaskFromQueue( @PathParam( "repositoryId" ) String repositoryId )
65 throws ArchivaRestServiceException;
67 @Path( "scanRepositoryNow" )
69 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
70 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_RUN_INDEXER )
71 Boolean scanRepositoryNow( @QueryParam( "repositoryId" ) String repositoryId,
72 @QueryParam( "fullScan" ) boolean fullScan )
73 throws ArchivaRestServiceException;
75 @Path( "copyArtifact" )
77 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
78 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
79 @RedbackAuthorization( noPermission = true )
81 * permission are checked in impl
82 * will copy an artifact from the source repository to the target repository
84 Boolean copyArtifact( ArtifactTransferRequest artifactTransferRequest )
85 throws ArchivaRestServiceException;
87 @Path( "scheduleDownloadRemoteIndex" )
89 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
90 @RedbackAuthorization( permission = ArchivaRoleConstants.OPERATION_RUN_INDEXER )
91 Boolean scheduleDownloadRemoteIndex( @QueryParam( "repositoryId" ) String repositoryId,
92 @QueryParam( "now" ) boolean now,
93 @QueryParam( "fullDownload" ) boolean fullDownload )
94 throws ArchivaRestServiceException;
97 @Path( "deleteArtifact" )
99 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
100 @RedbackAuthorization( noPermission = true )
102 * permission are checked in impl
104 Boolean deleteArtifact( @QueryParam( "" ) Artifact artifact, @QueryParam( "repositoryId" ) String repositoryId )
105 throws ArchivaRestServiceException;