1 package org.apache.archiva.rest.api.services;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
23 import org.apache.archiva.rest.api.model.Artifact;
24 import org.apache.archiva.rest.api.model.GroupIdList;
25 import org.apache.archiva.rest.api.model.SearchRequest;
26 import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
28 import javax.ws.rs.GET;
29 import javax.ws.rs.POST;
30 import javax.ws.rs.Path;
31 import javax.ws.rs.Produces;
32 import javax.ws.rs.QueryParam;
33 import javax.ws.rs.core.MediaType;
34 import java.util.List;
36 @Path( "/searchService/" )
37 public interface SearchService
40 * quick/general text search which returns a list of artifacts
41 * query for an artifact based on a checksum
42 * query for all available versions of an artifact, sorted in version significance order
43 * query for an artifact's direct dependencies
44 * TODO query for an artifact's dependency tree (as with mvn dependency:tree - no duplicates should be included)
45 * TODO query for all artifacts that depend on a given artifact
48 @Path( "quickSearch" )
50 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
51 @RedbackAuthorization( noPermission = true, noRestriction = false )
53 * <b>search will be apply on all repositories the current user has karma</b>
55 List<Artifact> quickSearch( @QueryParam( "queryString" ) String queryString )
56 throws ArchivaRestServiceException;
58 @Path( "getArtifactVersions" )
60 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
61 @RedbackAuthorization( noPermission = true, noRestriction = false )
63 * <b>search will be apply on all repositories the current user has karma</b>
65 List<Artifact> getArtifactVersions( @QueryParam( "groupId" ) String groupId,
66 @QueryParam( "artifactId" ) String artifactId,
67 @QueryParam( "packaging" ) String packaging )
68 throws ArchivaRestServiceException;
70 @Path( "searchArtifacts" )
72 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
73 @RedbackAuthorization( noPermission = true, noRestriction = false )
75 * If searchRequest contains repositories, the search will be done only on those repositories.
76 * <b>if no repositories, the search will be apply on all repositories the current user has karma</b>
78 List<Artifact> searchArtifacts( SearchRequest searchRequest )
79 throws ArchivaRestServiceException;
81 @Path( "getAllGroupIds" )
83 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
84 @RedbackAuthorization( noPermission = true, noRestriction = false )
86 * <b>this method applies on Maven Indexer lucene index, so datas not yet indexed won't be available</b>
88 GroupIdList getAllGroupIds( @QueryParam( "selectedRepos" ) List<String> selectedRepos )
89 throws ArchivaRestServiceException;
92 @Path( "getDependencies" )
94 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
95 @RedbackAuthorization( noPermission = true, noRestriction = true )
96 List<Dependency> getDependencies( @QueryParam( "groupId" ) String groupId,
97 @QueryParam( "artifactId" ) String artifactId,
98 @QueryParam( "version" ) String version )
99 throws ArchivaRestServiceException;
102 @Path( "getArtifactByChecksum" )
104 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
105 @RedbackAuthorization( noPermission = true, noRestriction = true )
106 List<Artifact> getArtifactByChecksum( @QueryParam( "checksum" ) String checksum )
107 throws ArchivaRestServiceException;