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.maven2.model.Artifact;
23 import org.apache.archiva.redback.authorization.RedbackAuthorization;
24 import org.apache.archiva.repository.scanner.RepositoryScanStatistics;
25 import org.apache.archiva.rest.api.model.ArtifactTransferRequest;
26 import org.apache.archiva.security.common.ArchivaRoleConstants;
28 import javax.ws.rs.Consumes;
29 import javax.ws.rs.DELETE;
30 import javax.ws.rs.GET;
31 import javax.ws.rs.POST;
32 import javax.ws.rs.Path;
33 import javax.ws.rs.PathParam;
34 import javax.ws.rs.Produces;
35 import javax.ws.rs.QueryParam;
36 import javax.ws.rs.core.MediaType;
39 * @author Olivier Lamy
42 @Path ("/repositoriesService/")
43 public interface RepositoriesService
49 @Path ("scanRepository")
51 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
52 @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
53 Boolean scanRepository( @QueryParam ("repositoryId") String repositoryId,
54 @QueryParam ("fullScan") boolean fullScan )
55 throws ArchivaRestServiceException;
62 @Path ("scanRepositoryDirectoriesNow/{repositoryId}")
64 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
65 @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
66 RepositoryScanStatistics scanRepositoryDirectoriesNow( @PathParam ("repositoryId") String repositoryId )
67 throws ArchivaRestServiceException;
70 @Path ("alreadyScanning/{repositoryId}")
72 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
73 @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
74 Boolean alreadyScanning( @PathParam ("repositoryId") String repositoryId )
75 throws ArchivaRestServiceException;
77 @Path ("removeScanningTaskFromQueue/{repositoryId}")
79 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
80 @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
81 Boolean removeScanningTaskFromQueue( @PathParam ("repositoryId") String repositoryId )
82 throws ArchivaRestServiceException;
84 @Path ("scanRepositoryNow")
86 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
87 @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
88 Boolean scanRepositoryNow( @QueryParam ("repositoryId") String repositoryId,
89 @QueryParam ("fullScan") boolean fullScan )
90 throws ArchivaRestServiceException;
93 * permissions are checked in impl
94 * will copy an artifact from the source repository to the target repository
96 @Path ("copyArtifact")
98 @Consumes ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
99 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
100 @RedbackAuthorization (noPermission = true)
101 Boolean copyArtifact( ArtifactTransferRequest artifactTransferRequest )
102 throws ArchivaRestServiceException;
104 @Path ("scheduleDownloadRemoteIndex")
106 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
107 @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
108 Boolean scheduleDownloadRemoteIndex( @QueryParam ("repositoryId") String repositoryId,
109 @QueryParam ("now") boolean now,
110 @QueryParam ("fullDownload") boolean fullDownload )
111 throws ArchivaRestServiceException;
115 * <b>permissions are checked in impl</b>
118 @Path ("deleteArtifact")
120 @Consumes ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
121 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
122 @RedbackAuthorization (noPermission = true)
123 Boolean deleteArtifact( Artifact artifact )
124 throws ArchivaRestServiceException;
127 * <b>permissions are checked in impl</b>
130 @Path ("projectVersion/{repositoryId}/{namespace}/{projectId}/{version}")
132 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
133 @RedbackAuthorization (noPermission = true)
134 Boolean removeProjectVersion( @PathParam ( "repositoryId" ) String repositoryId,
135 @PathParam ( "namespace" ) String namespace, @PathParam ( "projectId" ) String projectId,
136 @PathParam ( "version" ) String version )
137 throws ArchivaRestServiceException;
139 @Path ("isAuthorizedToDeleteArtifacts/{repositoryId}")
141 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
142 @RedbackAuthorization (noPermission = true, noRestriction = true)
143 Boolean isAuthorizedToDeleteArtifacts( @PathParam ("repositoryId") String repoId )
144 throws ArchivaRestServiceException;
147 * <b>permissions are checked in impl</b>
150 @Path ("deleteGroupId")
152 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
153 @RedbackAuthorization (noPermission = true)
154 Boolean deleteGroupId( @QueryParam ("groupId") String groupId, @QueryParam ("repositoryId") String repositoryId )
155 throws ArchivaRestServiceException;
158 * <b>permissions are checked in impl</b>
161 @Path ("project/{repositoryId}/{groupId}/{projectId}")
163 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
164 @RedbackAuthorization (noPermission = true)
165 Boolean deleteProject( @PathParam ("groupId") String groupId, @PathParam ("projectId") String projectId,
166 @PathParam ("repositoryId") String repositoryId )
167 throws ArchivaRestServiceException;