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.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 * TODO query for an artifact's dependency tree (as with mvn dependency:tree - no duplicates should be included)
46 * 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 )
54 * <b>search will be apply on all repositories the current user has karma</b>
56 List<Artifact> quickSearch( @QueryParam( "queryString" ) String queryString )
57 throws ArchivaRestServiceException;
59 @Path( "quickSearchWithRepositories" )
61 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
62 @RedbackAuthorization( noPermission = true, noRestriction = true )
64 * <b>if not repositories in SearchRequest: search will be apply on all repositories the current user has karma</b>
66 List<Artifact> quickSearchWithRepositories( SearchRequest searchRequest )
67 throws ArchivaRestServiceException;
69 @Path( "searchArtifacts" )
71 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
72 @RedbackAuthorization( noPermission = true, noRestriction = true )
74 * If searchRequest contains repositories, the search will be done only on those repositories.
75 * <b>if no repositories, the search will be apply on all repositories the current user has karma</b>
77 List<Artifact> searchArtifacts( SearchRequest searchRequest )
78 throws ArchivaRestServiceException;
80 @Path( "getArtifactVersions" )
82 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
83 @RedbackAuthorization( noPermission = true, noRestriction = true )
85 * <b>search will be apply on all repositories the current user has karma</b>
87 List<Artifact> getArtifactVersions( @QueryParam( "groupId" ) String groupId,
88 @QueryParam( "artifactId" ) String artifactId,
89 @QueryParam( "packaging" ) String packaging )
90 throws ArchivaRestServiceException;
93 @Path( "getAllGroupIds" )
95 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
96 @RedbackAuthorization( noPermission = true, noRestriction = false )
98 * <b>this method applies on Maven Indexer lucene index, so datas not yet indexed won't be available</b>
100 GroupIdList getAllGroupIds( @QueryParam( "selectedRepos" ) List<String> selectedRepos )
101 throws ArchivaRestServiceException;
103 @Path( "observableRepoIds" )
105 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
106 @RedbackAuthorization( noPermission = true, noRestriction = true )
110 StringList getObservablesRepoIds()
111 throws ArchivaRestServiceException;
114 @Path( "getDependencies" )
116 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
117 @RedbackAuthorization( noPermission = true, noRestriction = true )
118 List<Dependency> getDependencies( @QueryParam( "groupId" ) String groupId,
119 @QueryParam( "artifactId" ) String artifactId,
120 @QueryParam( "version" ) String version )
121 throws ArchivaRestServiceException;
124 @Path( "getArtifactByChecksum" )
126 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
127 @RedbackAuthorization( noPermission = true, noRestriction = true )
128 List<Artifact> getArtifactByChecksum( @QueryParam( "checksum" ) String checksum )
129 throws ArchivaRestServiceException;