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.ArtifactContentEntry;
25 import org.apache.archiva.rest.api.model.BrowseResult;
26 import org.apache.archiva.rest.api.model.Entry;
27 import org.apache.archiva.rest.api.model.TreeEntry;
28 import org.apache.archiva.rest.api.model.VersionsList;
29 import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
31 import javax.ws.rs.DELETE;
32 import javax.ws.rs.GET;
33 import javax.ws.rs.PUT;
34 import javax.ws.rs.Path;
35 import javax.ws.rs.PathParam;
36 import javax.ws.rs.Produces;
37 import javax.ws.rs.QueryParam;
38 import javax.ws.rs.core.MediaType;
39 import java.util.List;
42 * @author Olivier Lamy
45 @Path( "/browseService/" )
46 public interface BrowseService
50 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
51 @RedbackAuthorization( noPermission = true, noRestriction = true )
52 BrowseResult getRootGroups( @QueryParam( "repositoryId" ) String repositoryId )
53 throws ArchivaRestServiceException;
55 @Path( "browseGroupId/{groupId}" )
57 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
58 @RedbackAuthorization( noPermission = true, noRestriction = true )
59 BrowseResult browseGroupId( @PathParam( "groupId" ) String groupId,
60 @QueryParam( "repositoryId" ) String repositoryId )
61 throws ArchivaRestServiceException;
63 @Path( "versionsList/{g}/{a}" )
65 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
66 @RedbackAuthorization( noPermission = true, noRestriction = true )
67 VersionsList getVersionsList( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
68 @QueryParam( "repositoryId" ) String repositoryId )
69 throws ArchivaRestServiceException;
71 @Path( "projectVersionMetadata/{g}/{a}" )
73 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
74 @RedbackAuthorization( noPermission = true, noRestriction = true )
75 ProjectVersionMetadata getProjectVersionMetadata( @PathParam( "g" ) String groupId,
76 @PathParam( "a" ) String artifactId,
77 @QueryParam( "repositoryId" ) String repositoryId )
78 throws ArchivaRestServiceException;
80 @Path( "projectVersionMetadata/{g}/{a}/{v}" )
82 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
83 @RedbackAuthorization( noPermission = true, noRestriction = true )
84 ProjectVersionMetadata getProjectMetadata( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
85 @PathParam( "v" ) String version,
86 @QueryParam( "repositoryId" ) String repositoryId )
87 throws ArchivaRestServiceException;
89 @Path( "userRepositories" )
91 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
92 @RedbackAuthorization( noPermission = true, noRestriction = true )
94 * @return List of managed repositories current user can read
96 List<ManagedRepository> getUserRepositories()
97 throws ArchivaRestServiceException;
99 @Path( "treeEntries/{g}/{a}/{v}" )
101 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
102 @RedbackAuthorization( noPermission = true, noRestriction = true )
104 * return the dependency Tree for an artifacts
105 * <b>the List result has only one entry</b>
107 List<TreeEntry> getTreeEntries( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
108 @PathParam( "v" ) String version,
109 @QueryParam( "repositoryId" ) String repositoryId )
110 throws ArchivaRestServiceException;
112 @Path( "dependees/{g}/{a}/{v}" )
114 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
115 @RedbackAuthorization( noPermission = true, noRestriction = true )
117 * List of artifacts using the artifact passed in parameter.
119 List<Artifact> getDependees( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
120 @PathParam( "v" ) String version, @QueryParam( "repositoryId" ) String repositoryId )
121 throws ArchivaRestServiceException;
123 @Path( "metadatas/{g}/{a}/{v}" )
125 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
126 @RedbackAuthorization( noPermission = true, noRestriction = true )
127 List<Entry> getMetadatas( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
128 @PathParam( "v" ) String version, @QueryParam( "repositoryId" ) String repositoryId )
129 throws ArchivaRestServiceException;
131 @Path( "metadata/{g}/{a}/{v}/{key}/{value}" )
133 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
134 @RedbackAuthorization( noPermission = false, noRestriction = false, permissions = "archiva-add-metadata" )
135 Boolean addMetadata( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
136 @PathParam( "v" ) String version, @PathParam( "key" ) String key,
137 @PathParam( "value" ) String value, @QueryParam( "repositoryId" ) String repositoryId )
138 throws ArchivaRestServiceException;
140 @Path( "metadata/{g}/{a}/{v}/{key}" )
142 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
143 @RedbackAuthorization( noPermission = false, noRestriction = false, permissions = "archiva-add-metadata" )
144 Boolean deleteMetadata( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
145 @PathParam( "v" ) String version, @PathParam( "key" ) String key,
146 @QueryParam( "repositoryId" ) String repositoryId )
147 throws ArchivaRestServiceException;
149 List<ArtifactContentEntry> getArtifactContentEntries( @PathParam( "g" ) String groupId,
150 @PathParam( "a" ) String artifactId,
151 @PathParam( "v" ) String version,
152 @PathParam( "" ) String path,
153 @QueryParam( "repositoryId" ) String repositoryId )
154 throws ArchivaRestServiceException;