]> source.dussan.org Git - archiva.git/blob
d4a38e4073797aa484e0242ae4cba5c4ac2bc9e5
[archiva.git] /
1 package org.apache.archiva.rest.api.services;
2 /*
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  */
20
21 import org.apache.archiva.admin.model.beans.ManagedRepository;
22 import org.apache.archiva.metadata.model.ProjectVersionMetadata;
23 import org.apache.archiva.rest.api.model.Artifact;
24 import org.apache.archiva.rest.api.model.BrowseResult;
25 import org.apache.archiva.rest.api.model.TreeEntry;
26 import org.apache.archiva.rest.api.model.VersionsList;
27 import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
28
29 import javax.ws.rs.GET;
30 import javax.ws.rs.Path;
31 import javax.ws.rs.PathParam;
32 import javax.ws.rs.Produces;
33 import javax.ws.rs.QueryParam;
34 import javax.ws.rs.core.MediaType;
35 import java.util.List;
36
37 /**
38  * @author Olivier Lamy
39  * @since 1.4-M3
40  */
41 @Path( "/browseService/" )
42 public interface BrowseService
43 {
44     @Path( "rootGroups" )
45     @GET
46     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
47     @RedbackAuthorization( noPermission = true, noRestriction = true )
48     BrowseResult getRootGroups( @QueryParam( "repositoryId" ) String repositoryId )
49         throws ArchivaRestServiceException;
50
51     @Path( "browseGroupId/{groupId}" )
52     @GET
53     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
54     @RedbackAuthorization( noPermission = true, noRestriction = true )
55     BrowseResult browseGroupId( @PathParam( "groupId" ) String groupId,
56                                 @QueryParam( "repositoryId" ) String repositoryId )
57         throws ArchivaRestServiceException;
58
59     @Path( "versionsList/{g}/{a}" )
60     @GET
61     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
62     @RedbackAuthorization( noPermission = true, noRestriction = true )
63     VersionsList getVersionsList( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
64                                   @QueryParam( "repositoryId" ) String repositoryId )
65         throws ArchivaRestServiceException;
66
67     @Path( "projectVersionMetadata/{g}/{a}" )
68     @GET
69     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
70     @RedbackAuthorization( noPermission = true, noRestriction = true )
71     ProjectVersionMetadata getProjectVersionMetadata( @PathParam( "g" ) String groupId,
72                                                       @PathParam( "a" ) String artifactId,
73                                                       @QueryParam( "repositoryId" ) String repositoryId )
74         throws ArchivaRestServiceException;
75
76     @Path( "projectVersionMetadata/{g}/{a}/{v}" )
77     @GET
78     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
79     @RedbackAuthorization( noPermission = true, noRestriction = true )
80     ProjectVersionMetadata getProjectMetadata( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
81                                                @PathParam( "v" ) String version,
82                                                @QueryParam( "repositoryId" ) String repositoryId )
83         throws ArchivaRestServiceException;
84
85     @Path( "userRepositories" )
86     @GET
87     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
88     @RedbackAuthorization( noPermission = true, noRestriction = true )
89     List<ManagedRepository> getUserRepositories()
90         throws ArchivaRestServiceException;
91
92     @Path( "treeEntries/{g}/{a}/{v}" )
93     @GET
94     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
95     @RedbackAuthorization( noPermission = true, noRestriction = true )
96     List<TreeEntry> getTreeEntries( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
97                                     @PathParam( "v" ) String version,
98                                     @QueryParam( "repositoryId" ) String repositoryId )
99         throws ArchivaRestServiceException;
100
101     @Path( "dependees/{g}/{a}/{v}" )
102     @GET
103     @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
104     @RedbackAuthorization( noPermission = true, noRestriction = true )
105     List<Artifact> getDependees( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
106                               @PathParam( "v" ) String version, @QueryParam( "repositoryId" ) String repositoryId )
107         throws ArchivaRestServiceException;
108 }