diff options
author | Olivier Lamy <olamy@apache.org> | 2011-09-13 12:03:08 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2011-09-13 12:03:08 +0000 |
commit | 5c067f2a4deaa775213a3b5c2ca44ce62f4ba914 (patch) | |
tree | 79e137c9e2de547899bc00d6e5ff0e3ce111748c | |
parent | 659bd9fa433fc8f6b7fed3ca2616062c04c66e8f (diff) | |
download | archiva-5c067f2a4deaa775213a3b5c2ca44ce62f4ba914.tar.gz archiva-5c067f2a4deaa775213a3b5c2ca44ce62f4ba914.zip |
[MRM-1490] REST services : fix design of search service
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1170133 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SearchService.java | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SearchService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SearchService.java index 0100906b0..12537b35d 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SearchService.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/SearchService.java @@ -22,8 +22,13 @@ package org.apache.archiva.rest.api.services; import org.apache.archiva.rest.api.model.Artifact; import org.apache.archiva.rest.api.model.Dependency; +import org.codehaus.plexus.redback.authorization.RedbackAuthorization; +import javax.ws.rs.GET; import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; import java.util.List; @Path( "/searchService/" ) @@ -38,16 +43,35 @@ public interface SearchService * TODO query for all artifacts that depend on a given artifact */ - List<Artifact> quickSearch( String queryString ) - throws Exception; + @Path( "quickSearch" ) + @GET + @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } ) + @RedbackAuthorization( noPermission = true, noRestriction = true ) + List<Artifact> quickSearch( @QueryParam( "queryString" ) String queryString ) + throws ArchivaRestServiceException; - List<Artifact> getArtifactByChecksum( String checksum ) - throws Exception; + @Path( "getArtifactByChecksum" ) + @GET + @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } ) + @RedbackAuthorization( noPermission = true, noRestriction = true ) + List<Artifact> getArtifactByChecksum( @QueryParam( "checksum" ) String checksum ) + throws ArchivaRestServiceException; - List<Artifact> getArtifactVersions( String groupId, String artifactId ) - throws Exception; + @Path( "getArtifactVersions" ) + @GET + @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } ) + @RedbackAuthorization( noPermission = true, noRestriction = true ) + List<Artifact> getArtifactVersions( @QueryParam( "groupId" ) String groupId, + @QueryParam( "artifactId" ) String artifactId ) + throws ArchivaRestServiceException; - List<Dependency> getDependencies( String groupId, String artifactId, String version ) - throws Exception; + @Path( "getDependencies" ) + @GET + @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN } ) + @RedbackAuthorization( noPermission = true, noRestriction = true ) + List<Dependency> getDependencies( @QueryParam( "groupId" ) String groupId, + @QueryParam( "artifactId" ) String artifactId, + @QueryParam( "version" ) String version ) + throws ArchivaRestServiceException; } |