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  import java.util.List;
39  
40  /**
41   * @author Olivier Lamy
42   * @since 1.4-M1
43   */
44  @Path ("/repositoriesService/")
45  public interface RepositoriesService
46  {
47  
48      /**
49       * index repository
50       */
51      @Path ("scanRepository")
52      @GET
53      @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
54      @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
55      Boolean scanRepository( @QueryParam ("repositoryId") String repositoryId,
56                              @QueryParam ("fullScan") boolean fullScan )
57          throws ArchivaRestServiceException;
58  
59  
60      /**
61       * scan directories
62       * @since 1.4-M3
63       */
64      @Path ("scanRepositoryDirectoriesNow/{repositoryId}")
65      @GET
66      @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
67      @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
68      RepositoryScanStatistics scanRepositoryDirectoriesNow( @PathParam ("repositoryId") String repositoryId )
69          throws ArchivaRestServiceException;
70  
71  
72      @Path ("alreadyScanning/{repositoryId}")
73      @GET
74      @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
75      @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
76      Boolean alreadyScanning( @PathParam ("repositoryId") String repositoryId )
77          throws ArchivaRestServiceException;
78  
79      @Path ("removeScanningTaskFromQueue/{repositoryId}")
80      @GET
81      @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
82      @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
83      Boolean removeScanningTaskFromQueue( @PathParam ("repositoryId") String repositoryId )
84          throws ArchivaRestServiceException;
85  
86      @Path ("scanRepositoryNow")
87      @GET
88      @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
89      @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
90      Boolean scanRepositoryNow( @QueryParam ("repositoryId") String repositoryId,
91                                 @QueryParam ("fullScan") boolean fullScan )
92          throws ArchivaRestServiceException;
93  
94      /**
95       * permissions are checked in impl
96       * will copy an artifact from the source repository to the target repository
97       */
98      @Path ("copyArtifact")
99      @POST
100     @Consumes ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
101     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
102     @RedbackAuthorization (noPermission = true)
103     Boolean copyArtifact( ArtifactTransferRequest artifactTransferRequest )
104         throws ArchivaRestServiceException;
105 
106     @Path ("scheduleDownloadRemoteIndex")
107     @GET
108     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
109     @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
110     Boolean scheduleDownloadRemoteIndex( @QueryParam ("repositoryId") String repositoryId,
111                                          @QueryParam ("now") boolean now,
112                                          @QueryParam ("fullDownload") boolean fullDownload )
113         throws ArchivaRestServiceException;
114 
115 
116     /**
117      * <b>permissions are checked in impl</b>
118      * @since 1.4-M2
119      */
120     @Path ("deleteArtifact")
121     @POST
122     @Consumes ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
123     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
124     @RedbackAuthorization (noPermission = true)
125     Boolean deleteArtifact( Artifact artifact )
126         throws ArchivaRestServiceException;
127 
128     /**
129      * <b>permissions are checked in impl</b>
130      * @since 1.4-M4
131      */
132     @Path ("projectVersion/{repositoryId}/{namespace}/{projectId}/{version}")
133     @DELETE
134     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
135     @RedbackAuthorization (noPermission = true)
136     Boolean removeProjectVersion( @PathParam ( "repositoryId" ) String repositoryId,
137                                   @PathParam ( "namespace" ) String namespace, @PathParam ( "projectId" ) String projectId,
138                                   @PathParam ( "version" ) String version )
139         throws ArchivaRestServiceException;
140 
141     @Path ("isAuthorizedToDeleteArtifacts/{repositoryId}")
142     @GET
143     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
144     @RedbackAuthorization (noPermission = true, noRestriction = true)
145     Boolean isAuthorizedToDeleteArtifacts( @PathParam ("repositoryId") String repoId )
146         throws ArchivaRestServiceException;
147 
148     /**
149      * <b>permissions are checked in impl</b>
150      * @since 1.4-M3
151      */
152     @Path ("deleteGroupId")
153     @GET
154     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
155     @RedbackAuthorization (noPermission = true)
156     Boolean deleteGroupId( @QueryParam ("groupId") String groupId, @QueryParam ("repositoryId") String repositoryId )
157         throws ArchivaRestServiceException;
158 
159     /**
160      * <b>permissions are checked in impl</b>
161      * @since 1.4-M4
162      */
163     @Path ("project/{repositoryId}/{groupId}/{projectId}")
164     @DELETE
165     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
166     @RedbackAuthorization (noPermission = true)
167     Boolean deleteProject( @PathParam ("groupId") String groupId, @PathParam ("projectId") String projectId,
168                            @PathParam ("repositoryId") String repositoryId )
169         throws ArchivaRestServiceException;
170 
171     /**
172      * @since 2.0
173      */
174     @Path ("runningRemoteDownloadIds")
175     @GET
176     @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
177     @RedbackAuthorization (noPermission = true)
178     StringList getRunningRemoteDownloadIds();
179 
180 }