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.DELETE;
30 import javax.ws.rs.GET;
31 import javax.ws.rs.PUT;
32 import javax.ws.rs.Path;
33 import javax.ws.rs.PathParam;
34 import javax.ws.rs.Produces;
35 import javax.ws.rs.QueryParam;
36 import javax.ws.rs.core.MediaType;
37 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 )
92 List<ManagedRepository> getUserRepositories()
93 throws ArchivaRestServiceException;
95 @Path( "treeEntries/{g}/{a}/{v}" )
97 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
98 @RedbackAuthorization( noPermission = true, noRestriction = true )
99 List<TreeEntry> getTreeEntries( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
100 @PathParam( "v" ) String version,
101 @QueryParam( "repositoryId" ) String repositoryId )
102 throws ArchivaRestServiceException;
104 @Path( "dependees/{g}/{a}/{v}" )
106 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
107 @RedbackAuthorization( noPermission = true, noRestriction = true )
108 List<Artifact> getDependees( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
109 @PathParam( "v" ) String version, @QueryParam( "repositoryId" ) String repositoryId )
110 throws ArchivaRestServiceException;
112 @Path( "metadatas/{g}/{a}/{v}" )
114 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
115 @RedbackAuthorization( noPermission = true, noRestriction = true )
116 Map<String, String> getMetadatas( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
117 @PathParam( "v" ) String version,
118 @QueryParam( "repositoryId" ) String repositoryId )
119 throws ArchivaRestServiceException;
121 @Path( "metadata/{g}/{a}/{v}/{key}/{value}" )
123 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
124 @RedbackAuthorization( noPermission = false, noRestriction = false, permissions = "archiva-add-metadata" )
125 Boolean addMetadata( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
126 @PathParam( "v" ) String version, @PathParam( "key" ) String key,
127 @PathParam( "value" ) String value, @QueryParam( "repositoryId" ) String repositoryId )
128 throws ArchivaRestServiceException;
130 @Path( "metadata/{g}/{a}/{v}/{key}" )
132 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
133 @RedbackAuthorization( noPermission = false, noRestriction = false, permissions = "archiva-add-metadata" )
134 Boolean deleteMetadata( @PathParam( "g" ) String groupId, @PathParam( "a" ) String artifactId,
135 @PathParam( "v" ) String version, @PathParam( "key" ) String key,
136 @QueryParam( "repositoryId" ) String repositoryId )
137 throws ArchivaRestServiceException;