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.Dependency;
25 import org.apache.archiva.rest.api.model.GroupIdList;
26 import org.apache.archiva.rest.api.model.SearchRequest;
27 import org.codehaus.plexus.redback.authorization.RedbackAuthorization;
29 import javax.ws.rs.GET;
30 import javax.ws.rs.POST;
31 import javax.ws.rs.Path;
32 import javax.ws.rs.Produces;
33 import javax.ws.rs.QueryParam;
34 import javax.ws.rs.core.MediaType;
35 import java.util.Collection;
36 import java.util.List;
38 @Path( "/searchService/" )
39 public interface SearchService
42 * quick/general text search which returns a list of artifacts
43 * query for an artifact based on a checksum
44 * query for all available versions of an artifact, sorted in version significance order
45 * query for an artifact's direct dependencies
46 * TODO query for an artifact's dependency tree (as with mvn dependency:tree - no duplicates should be included)
47 * TODO query for all artifacts that depend on a given artifact
50 @Path( "quickSearch" )
52 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
53 @RedbackAuthorization( noPermission = true, noRestriction = false )
55 * <b>search will be apply on all repositories the user used has karma</b>
57 List<Artifact> quickSearch( @QueryParam( "queryString" ) String queryString )
58 throws ArchivaRestServiceException;
60 @Path( "getArtifactVersions" )
62 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
63 @RedbackAuthorization( noPermission = true, noRestriction = false )
65 * <b>search will be apply on all repositories the user used has karma</b>
67 List<Artifact> getArtifactVersions( @QueryParam( "groupId" ) String groupId,
68 @QueryParam( "artifactId" ) String artifactId,
69 @QueryParam( "packaging" ) String packaging )
70 throws ArchivaRestServiceException;
72 @Path( "searchArtifacts" )
74 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
75 @RedbackAuthorization( noPermission = true, noRestriction = false )
77 * If searchRequest contains repositories, the search will be done only on those repositories.
78 * <b>if no repositories, the search will be apply on all repositories the user used has karma</b>
80 List<Artifact> searchArtifacts( SearchRequest searchRequest )
81 throws ArchivaRestServiceException;
83 @Path( "getAllGroupIds" )
85 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
86 @RedbackAuthorization( noPermission = true, noRestriction = false )
88 * <b>this method applies on Maven Indexer lucene index, so datas not yet indexed won't be available</b>
90 GroupIdList getAllGroupIds( @QueryParam( "selectedRepos" ) List<String> selectedRepos )
91 throws ArchivaRestServiceException;
94 @Path( "getDependencies" )
96 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
97 @RedbackAuthorization( noPermission = true, noRestriction = true )
98 List<Dependency> getDependencies( @QueryParam( "groupId" ) String groupId,
99 @QueryParam( "artifactId" ) String artifactId,
100 @QueryParam( "version" ) String version )
101 throws ArchivaRestServiceException;
104 @Path( "getArtifactByChecksum" )
106 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
107 @RedbackAuthorization( noPermission = true, noRestriction = true )
108 List<Artifact> getArtifactByChecksum( @QueryParam( "checksum" ) String checksum )
109 throws ArchivaRestServiceException;