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 )
54 List<Artifact> quickSearch( @QueryParam( "queryString" ) String queryString )
55 throws ArchivaRestServiceException;
57 @Path( "getArtifactVersions" )
59 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
60 @RedbackAuthorization( noPermission = true, noRestriction = false )
61 List<Artifact> getArtifactVersions( @QueryParam( "groupId" ) String groupId,
62 @QueryParam( "artifactId" ) String artifactId,
63 @QueryParam( "packaging" ) String packaging )
64 throws ArchivaRestServiceException;
66 @Path( "searchArtifacts" )
68 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
69 @RedbackAuthorization( noPermission = true, noRestriction = false )
70 List<Artifact> searchArtifacts( SearchRequest searchRequest )
71 throws ArchivaRestServiceException;
73 @Path( "getAllGroupIds" )
75 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
76 @RedbackAuthorization( noPermission = true, noRestriction = false )
77 GroupIdList getAllGroupIds( @QueryParam( "selectedRepos" ) List<String> selectedRepos )
78 throws ArchivaRestServiceException;
80 @Path( "getDependencies" )
82 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
83 @RedbackAuthorization( noPermission = true, noRestriction = true )
84 List<Dependency> getDependencies( @QueryParam( "groupId" ) String groupId,
85 @QueryParam( "artifactId" ) String artifactId,
86 @QueryParam( "version" ) String version )
87 throws ArchivaRestServiceException;
90 @Path( "getArtifactByChecksum" )
92 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } )
93 @RedbackAuthorization( noPermission = true, noRestriction = true )
94 List<Artifact> getArtifactByChecksum( @QueryParam( "checksum" ) String checksum )
95 throws ArchivaRestServiceException;