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.maven2.model.Artifact;
24 import org.apache.archiva.rest.api.model.GroupIdList;
25 import org.apache.archiva.rest.api.model.SearchRequest;
26 import org.apache.archiva.rest.api.model.StringList;
27 import org.apache.archiva.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.List;
37 @Path( "/searchService/" )
38 public interface SearchService
41 * quick/general text search which returns a list of artifacts
42 * query for an artifact based on a checksum
43 * query for all available versions of an artifact, sorted in version significance order
44 * query for an artifact's direct dependencies
45 * <b>search will be apply on all repositories the current user has karma</b>
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
49 @Path( "quickSearch" )
51 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
52 @RedbackAuthorization( noPermission = true, noRestriction = true )
53 List<Artifact> quickSearch( @QueryParam( "queryString" ) String queryString )
54 throws ArchivaRestServiceException;
57 * <b>if not repositories in SearchRequest: search will be apply on all repositories the current user has karma</b>
59 @Path( "quickSearchWithRepositories" )
61 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
62 @RedbackAuthorization( noPermission = true, noRestriction = true )
64 List<Artifact> quickSearchWithRepositories( SearchRequest searchRequest )
65 throws ArchivaRestServiceException;
68 * If searchRequest contains repositories, the search will be done only on those repositories.
69 * <b>if no repositories, the search will be apply on all repositories the current user has karma</b>
71 @Path( "searchArtifacts" )
73 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
74 @RedbackAuthorization( noPermission = true, noRestriction = true )
75 List<Artifact> searchArtifacts( SearchRequest searchRequest )
76 throws ArchivaRestServiceException;
79 * <b>search will be apply on all repositories the current user has karma</b>
81 @Path( "getArtifactVersions" )
83 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
84 @RedbackAuthorization( noPermission = true, noRestriction = true )
85 List<Artifact> getArtifactVersions( @QueryParam( "groupId" ) String groupId,
86 @QueryParam( "artifactId" ) String artifactId,
87 @QueryParam( "packaging" ) String packaging )
88 throws ArchivaRestServiceException;
92 * <b>this method applies on Maven Indexer lucene index, so datas not yet indexed won't be available</b>
94 @Path( "getAllGroupIds" )
96 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
97 @RedbackAuthorization( noPermission = true, noRestriction = false )
98 GroupIdList getAllGroupIds( @QueryParam( "selectedRepos" ) List<String> selectedRepos )
99 throws ArchivaRestServiceException;
104 @Path( "observableRepoIds" )
106 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
107 @RedbackAuthorization( noPermission = true, noRestriction = true )
108 StringList getObservablesRepoIds()
109 throws ArchivaRestServiceException;
112 @Path( "getDependencies" )
114 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
115 @RedbackAuthorization( noPermission = true, noRestriction = true )
116 List<Dependency> getDependencies( @QueryParam( "groupId" ) String groupId,
117 @QueryParam( "artifactId" ) String artifactId,
118 @QueryParam( "version" ) String version )
119 throws ArchivaRestServiceException;
122 @Path( "getArtifactByChecksum" )
124 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
125 @RedbackAuthorization( noPermission = true, noRestriction = true )
126 List<Artifact> getArtifactByChecksum( @QueryParam( "checksum" ) String checksum )
127 throws ArchivaRestServiceException;