This project has retired. For details please refer to its Attic page.
RepositoriesService xref
View Javadoc
1   package org.apache.archiva.rest.api.services;
2   
3   /*
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
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
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
19   * under the License.
20   */
21  
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;
28  
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;
38  
39  /**
40   * @author Olivier Lamy
41   * @since 1.4-M1
42   */
43  @Path ("/repositoriesService/")
44  public interface RepositoriesService
45  {
46  
47      /**
48       * index repository
49       */
50      @Path ("scanRepository")
51      @GET
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;
57  
58  
59      /**
60       * scan directories
61       * @since 1.4-M3
62       */
63      @Path ("scanRepositoryDirectoriesNow/{repositoryId}")
64      @GET
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;
69  
70  
71      @Path ("alreadyScanning/{repositoryId}")
72      @GET
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;
77  
78      @Path ("removeScanningTaskFromQueue/{repositoryId}")
79      @GET
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;
84  
85      @Path ("scanRepositoryNow")
86      @GET
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;
92  
93      /**
94       * permissions are checked in impl
95       * will copy an artifact from the source repository to the target repository
96       */
97      @Path ("copyArtifact")
98      @POST
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;
104 
105     @Path ("scheduleDownloadRemoteIndex")
106     @GET
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;
113 
114 
115     /**
116      * <b>permissions are checked in impl</b>
117      * @since 1.4-M2
118      */
119     @Path ("deleteArtifact")
120     @POST
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;
126 
127     /**
128      * <b>permissions are checked in impl</b>
129      * @since 1.4-M4
130      */
131     @Path ("projectVersion/{repositoryId}/{namespace}/{projectId}/{version}")
132     @DELETE
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;
139 
140     @Path ("isAuthorizedToDeleteArtifacts/{repositoryId}")
141     @GET
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;
146 
147     /**
148      * <b>permissions are checked in impl</b>
149      * @since 1.4-M3
150      */
151     @Path ("deleteGroupId")
152     @GET
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;
157 
158     /**
159      * <b>permissions are checked in impl</b>
160      * @since 1.4-M4
161      */
162     @Path ("project/{repositoryId}/{groupId}/{projectId}")
163     @DELETE
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;
169 
170     /**
171      * @since 2.0
172      */
173     @Path ("runningRemoteDownloadIds")
174     @GET
175     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
176     @RedbackAuthorization (noPermission = true)
177     StringList getRunningRemoteDownloadIds();
178 
179 }