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.Entry;
26 import org.apache.archiva.rest.api.model.TreeEntry;
27 import org.apache.archiva.rest.api.model.VersionsList;
28 import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
30 import javax.ws.rs.DELETE;
31 import javax.ws.rs.GET;
32 import javax.ws.rs.PUT;
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;
41 * @author Olivier Lamy
44 @Path( "/browseService/" )
45 public interface BrowseService
49 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
50 @RedbackAuthorization( noPermission = true, noRestriction = true )
51 BrowseResult getRootGroups( @QueryParam( "repositoryId" ) String repositoryId )
52 throws ArchivaRestServiceException;
54 @Path( "browseGroupId/{groupId}" )
56 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
57 @RedbackAuthorization( noPermission = true, noRestriction = true )
58 BrowseResult browseGroupId( @PathParam( "groupId" ) String groupId,
59 @QueryParam( "repositoryId" ) String repositoryId )
60 throws ArchivaRestServiceException;
62 @Path( "versionsList/{g}/{a}" )
64 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
65 @RedbackAuthorization( noPermission = true, noRestriction = true )
66 VersionsList getVersionsList( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
67 @QueryParam( "repositoryId" ) String repositoryId )
68 throws ArchivaRestServiceException;
70 @Path( "projectVersionMetadata/{g}/{a}" )
72 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
73 @RedbackAuthorization( noPermission = true, noRestriction = true )
74 ProjectVersionMetadata getProjectVersionMetadata( @PathParam( "g" ) String groupId,
75 @PathParam( "a" ) String artifactId,
76 @QueryParam( "repositoryId" ) String repositoryId )
77 throws ArchivaRestServiceException;
79 @Path( "projectVersionMetadata/{g}/{a}/{v}" )
81 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
82 @RedbackAuthorization( noPermission = true, noRestriction = true )
83 ProjectVersionMetadata getProjectMetadata( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
84 @PathParam( "v" ) String version,
85 @QueryParam( "repositoryId" ) String repositoryId )
86 throws ArchivaRestServiceException;
88 @Path( "userRepositories" )
90 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
91 @RedbackAuthorization( noPermission = true, noRestriction = true )
93 * @return List of managed repositories current user can read
95 List<ManagedRepository> getUserRepositories()
96 throws ArchivaRestServiceException;
98 @Path( "treeEntries/{g}/{a}/{v}" )
100 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
101 @RedbackAuthorization( noPermission = true, noRestriction = true )
103 * return the dependency Tree for an artifacts
104 * <b>the List result has only one entry</b>
106 List<TreeEntry> getTreeEntries( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
107 @PathParam( "v" ) String version,
108 @QueryParam( "repositoryId" ) String repositoryId )
109 throws ArchivaRestServiceException;
111 @Path( "dependees/{g}/{a}/{v}" )
113 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
114 @RedbackAuthorization( noPermission = true, noRestriction = true )
116 * List of artifacts using the artifact passed in parameter.
118 List<Artifact> getDependees( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
119 @PathParam( "v" ) String version, @QueryParam( "repositoryId" ) String repositoryId )
120 throws ArchivaRestServiceException;
122 @Path( "metadatas/{g}/{a}/{v}" )
124 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
125 @RedbackAuthorization( noPermission = true, noRestriction = true )
126 List<Entry> getMetadatas( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
127 @PathParam( "v" ) String version, @QueryParam( "repositoryId" ) String repositoryId )
128 throws ArchivaRestServiceException;
130 @Path( "metadata/{g}/{a}/{v}/{key}/{value}" )
132 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
133 @RedbackAuthorization( noPermission = false, noRestriction = false, permissions = "archiva-add-metadata" )
134 Boolean addMetadata( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
135 @PathParam( "v" ) String version, @PathParam( "key" ) String key,
136 @PathParam( "value" ) String value, @QueryParam( "repositoryId" ) String repositoryId )
137 throws ArchivaRestServiceException;
139 @Path( "metadata/{g}/{a}/{v}/{key}" )
141 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
142 @RedbackAuthorization( noPermission = false, noRestriction = false, permissions = "archiva-add-metadata" )
143 Boolean deleteMetadata( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
144 @PathParam( "v" ) String version, @PathParam( "key" ) String key,
145 @QueryParam( "repositoryId" ) String repositoryId )
146 throws ArchivaRestServiceException;