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.repository.scanner.RepositoryScanStatistics;
23 import org.apache.archiva.rest.api.model.Artifact;
24 import org.apache.archiva.rest.api.model.ArtifactTransferRequest;
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.PathParam;
33 import javax.ws.rs.Produces;
34 import javax.ws.rs.QueryParam;
35 import javax.ws.rs.core.MediaType;
38 * @author Olivier Lamy
41 @Path( "/repositoriesService/" )
42 public interface RepositoriesService
45 @Path( "scanRepository" )
47 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
48 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER )
52 Boolean scanRepository( @QueryParam( "repositoryId" ) String repositoryId,
53 @QueryParam( "fullScan" ) boolean fullScan )
54 throws ArchivaRestServiceException;
57 @Path( "scanRepositoryDirectoriesNow/{repositoryId}" )
59 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
60 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER )
65 RepositoryScanStatistics scanRepositoryDirectoriesNow( @PathParam( "repositoryId" ) String repositoryId )
66 throws ArchivaRestServiceException;
69 @Path( "alreadyScanning/{repositoryId}" )
71 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
72 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER )
73 Boolean alreadyScanning( @PathParam( "repositoryId" ) String repositoryId )
74 throws ArchivaRestServiceException;
76 @Path( "removeScanningTaskFromQueue/{repositoryId}" )
78 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
79 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER )
80 Boolean removeScanningTaskFromQueue( @PathParam( "repositoryId" ) String repositoryId )
81 throws ArchivaRestServiceException;
83 @Path( "scanRepositoryNow" )
85 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
86 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER )
87 Boolean scanRepositoryNow( @QueryParam( "repositoryId" ) String repositoryId,
88 @QueryParam( "fullScan" ) boolean fullScan )
89 throws ArchivaRestServiceException;
91 @Path( "copyArtifact" )
93 @Consumes( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
94 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
95 @RedbackAuthorization( noPermission = true )
97 * permissions are checked in impl
98 * will copy an artifact from the source repository to the target repository
100 Boolean copyArtifact( ArtifactTransferRequest artifactTransferRequest )
101 throws ArchivaRestServiceException;
103 @Path( "scheduleDownloadRemoteIndex" )
105 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
106 @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER )
107 Boolean scheduleDownloadRemoteIndex( @QueryParam( "repositoryId" ) String repositoryId,
108 @QueryParam( "now" ) boolean now,
109 @QueryParam( "fullDownload" ) boolean fullDownload )
110 throws ArchivaRestServiceException;
113 @Path( "deleteArtifact" )
115 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
116 @RedbackAuthorization( noPermission = true )
118 * <b>permissions are checked in impl</b>
121 Boolean deleteArtifact( @QueryParam( "" ) Artifact artifact, @QueryParam( "repositoryId" ) String repositoryId )
122 throws ArchivaRestServiceException;
124 @Path( "isAuthorizedToDeleteArtifacts/{repositoryId}" )
126 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
127 @RedbackAuthorization( noPermission = true, noRestriction = true)
128 Boolean isAuthorizedToDeleteArtifacts( @PathParam( "repositoryId" ) String repoId )
129 throws ArchivaRestServiceException;