1 package org.apache.archiva.rest.api.services;
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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
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;
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;
38 * @author Olivier Lamy
41 @Path( "/browseService/" )
42 public interface BrowseService
46 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
47 @RedbackAuthorization( noPermission = true, noRestriction = true )
48 BrowseResult getRootGroups( @QueryParam( "repositoryId" ) String repositoryId )
49 throws ArchivaRestServiceException;
51 @Path( "browseGroupId/{groupId}" )
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;
59 @Path( "versionsList/{g}/{a}" )
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;
67 @Path( "projectVersionMetadata/{g}/{a}" )
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;
76 @Path( "projectVersionMetadata/{g}/{a}/{v}" )
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;
85 @Path( "userRepositories" )
87 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
88 @RedbackAuthorization( noPermission = true, noRestriction = true )
89 List<ManagedRepository> getUserRepositories()
90 throws ArchivaRestServiceException;
92 @Path( "treeEntries/{g}/{a}/{v}" )
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;
101 @Path( "dependees/{g}/{a}/{v}" )
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;