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.rest.api.model.StringList;
27 import org.apache.archiva.security.common.ArchivaRoleConstants;
29 import javax.ws.rs.Consumes;
30 import javax.ws.rs.DELETE;
31 import javax.ws.rs.GET;
32 import javax.ws.rs.POST;
33 import javax.ws.rs.Path;
34 import javax.ws.rs.PathParam;
35 import javax.ws.rs.Produces;
36 import javax.ws.rs.QueryParam;
37 import javax.ws.rs.core.MediaType;
40 * @author Olivier Lamy
43 @Path ("/repositoriesService/")
44 public interface RepositoriesService
50 @Path ("scanRepository")
52 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
53 @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
54 Boolean scanRepository( @QueryParam ("repositoryId") String repositoryId,
55 @QueryParam ("fullScan") boolean fullScan )
56 throws ArchivaRestServiceException;
63 @Path ("scanRepositoryDirectoriesNow/{repositoryId}")
65 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
66 @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
67 RepositoryScanStatistics scanRepositoryDirectoriesNow( @PathParam ("repositoryId") String repositoryId )
68 throws ArchivaRestServiceException;
71 @Path ("alreadyScanning/{repositoryId}")
73 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
74 @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
75 Boolean alreadyScanning( @PathParam ("repositoryId") String repositoryId )
76 throws ArchivaRestServiceException;
78 @Path ("removeScanningTaskFromQueue/{repositoryId}")
80 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
81 @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
82 Boolean removeScanningTaskFromQueue( @PathParam ("repositoryId") String repositoryId )
83 throws ArchivaRestServiceException;
85 @Path ("scanRepositoryNow")
87 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
88 @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
89 Boolean scanRepositoryNow( @QueryParam ("repositoryId") String repositoryId,
90 @QueryParam ("fullScan") boolean fullScan )
91 throws ArchivaRestServiceException;
94 * permissions are checked in impl
95 * will copy an artifact from the source repository to the target repository
97 @Path ("copyArtifact")
99 @Consumes ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
100 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
101 @RedbackAuthorization (noPermission = true)
102 Boolean copyArtifact( ArtifactTransferRequest artifactTransferRequest )
103 throws ArchivaRestServiceException;
105 @Path ("scheduleDownloadRemoteIndex")
107 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
108 @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
109 Boolean scheduleDownloadRemoteIndex( @QueryParam ("repositoryId") String repositoryId,
110 @QueryParam ("now") boolean now,
111 @QueryParam ("fullDownload") boolean fullDownload )
112 throws ArchivaRestServiceException;
116 * <b>permissions are checked in impl</b>
119 @Path ("deleteArtifact")
121 @Consumes ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
122 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
123 @RedbackAuthorization (noPermission = true)
124 Boolean deleteArtifact( Artifact artifact )
125 throws ArchivaRestServiceException;
128 * <b>permissions are checked in impl</b>
131 @Path ("projectVersion/{repositoryId}/{namespace}/{projectId}/{version}")
133 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
134 @RedbackAuthorization (noPermission = true)
135 Boolean removeProjectVersion( @PathParam ( "repositoryId" ) String repositoryId,
136 @PathParam ( "namespace" ) String namespace, @PathParam ( "projectId" ) String projectId,
137 @PathParam ( "version" ) String version )
138 throws ArchivaRestServiceException;
140 @Path ("isAuthorizedToDeleteArtifacts/{repositoryId}")
142 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
143 @RedbackAuthorization (noPermission = true, noRestriction = true)
144 Boolean isAuthorizedToDeleteArtifacts( @PathParam ("repositoryId") String repoId )
145 throws ArchivaRestServiceException;
148 * <b>permissions are checked in impl</b>
151 @Path ("deleteGroupId")
153 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
154 @RedbackAuthorization (noPermission = true)
155 Boolean deleteGroupId( @QueryParam ("groupId") String groupId, @QueryParam ("repositoryId") String repositoryId )
156 throws ArchivaRestServiceException;
159 * <b>permissions are checked in impl</b>
162 @Path ("project/{repositoryId}/{groupId}/{projectId}")
164 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
165 @RedbackAuthorization (noPermission = true)
166 Boolean deleteProject( @PathParam ("groupId") String groupId, @PathParam ("projectId") String projectId,
167 @PathParam ("repositoryId") String repositoryId )
168 throws ArchivaRestServiceException;
173 @Path ("runningRemoteDownloadIds")
175 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
176 @RedbackAuthorization (noPermission = true)
177 StringList getRunningRemoteDownloadIds();