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.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.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( "getArtifactVersions" )
61 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
62 @RedbackAuthorization( noPermission = true, noRestriction = true )
64 * <b>search will be apply on all repositories the current user has karma</b>
66 List<Artifact> getArtifactVersions( @QueryParam( "groupId" ) String groupId,
67 @QueryParam( "artifactId" ) String artifactId,
68 @QueryParam( "packaging" ) String packaging )
69 throws ArchivaRestServiceException;
71 @Path( "searchArtifacts" )
73 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
74 @RedbackAuthorization( noPermission = true, noRestriction = true )
76 * If searchRequest contains repositories, the search will be done only on those repositories.
77 * <b>if no repositories, the search will be apply on all repositories the current user has karma</b>
79 List<Artifact> searchArtifacts( SearchRequest searchRequest )
80 throws ArchivaRestServiceException;
82 @Path( "getAllGroupIds" )
84 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
85 @RedbackAuthorization( noPermission = true, noRestriction = false )
87 * <b>this method applies on Maven Indexer lucene index, so datas not yet indexed won't be available</b>
89 GroupIdList getAllGroupIds( @QueryParam( "selectedRepos" ) List<String> selectedRepos )
90 throws ArchivaRestServiceException;
92 @Path( "observableRepoIds" )
94 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
95 @RedbackAuthorization( noPermission = true, noRestriction = true )
96 StringList getObservablesRepoIds()
97 throws ArchivaRestServiceException;
100 @Path( "getDependencies" )
102 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
103 @RedbackAuthorization( noPermission = true, noRestriction = true )
104 List<Dependency> getDependencies( @QueryParam( "groupId" ) String groupId,
105 @QueryParam( "artifactId" ) String artifactId,
106 @QueryParam( "version" ) String version )
107 throws ArchivaRestServiceException;
110 @Path( "getArtifactByChecksum" )
112 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
113 @RedbackAuthorization( noPermission = true, noRestriction = true )
114 List<Artifact> getArtifactByChecksum( @QueryParam( "checksum" ) String checksum )
115 throws ArchivaRestServiceException;