1 package org.apache.archiva.rest.api.services;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 import org.apache.archiva.maven2.model.Artifact;
24 import org.apache.archiva.redback.authorization.RedbackAuthorization;
25 import org.apache.archiva.rest.api.model.ChecksumSearch;
26 import org.apache.archiva.rest.api.model.GroupIdList;
27 import org.apache.archiva.rest.api.model.SearchRequest;
28 import org.apache.archiva.rest.api.model.StringList;
29
30 import javax.ws.rs.GET;
31 import javax.ws.rs.POST;
32 import javax.ws.rs.Path;
33 import javax.ws.rs.Produces;
34 import javax.ws.rs.QueryParam;
35 import javax.ws.rs.core.MediaType;
36 import javax.ws.rs.core.Response;
37 import java.util.List;
38
39 @Path( "/searchService/" )
40 public interface SearchService
41 {
42
43
44
45
46
47
48
49
50
51 @Path( "quickSearch" )
52 @GET
53 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
54 @RedbackAuthorization( noPermission = true, noRestriction = true )
55 List<Artifact> quickSearch( @QueryParam( "queryString" ) String queryString )
56 throws ArchivaRestServiceException;
57
58
59
60
61 @Path( "quickSearchWithRepositories" )
62 @POST
63 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
64 @RedbackAuthorization( noPermission = true, noRestriction = true )
65 List<Artifact> quickSearchWithRepositories( SearchRequest searchRequest )
66 throws ArchivaRestServiceException;
67
68
69
70
71
72 @Path( "searchArtifacts" )
73 @POST
74 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
75 @RedbackAuthorization( noPermission = true, noRestriction = true )
76 List<Artifact> searchArtifacts( SearchRequest searchRequest )
77 throws ArchivaRestServiceException;
78
79
80
81
82 @Path( "getArtifactVersions" )
83 @GET
84 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
85 @RedbackAuthorization( noPermission = true, noRestriction = true )
86 List<Artifact> getArtifactVersions( @QueryParam( "groupId" ) String groupId,
87 @QueryParam( "artifactId" ) String artifactId,
88 @QueryParam( "packaging" ) String packaging )
89 throws ArchivaRestServiceException;
90
91
92
93
94
95 @Path( "getAllGroupIds" )
96 @GET
97 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
98 @RedbackAuthorization( noPermission = true, noRestriction = false )
99 GroupIdList getAllGroupIds( @QueryParam( "selectedRepos" ) List<String> selectedRepos )
100 throws ArchivaRestServiceException;
101
102
103
104
105 @Path( "observableRepoIds" )
106 @GET
107 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
108 @RedbackAuthorization( noPermission = true, noRestriction = true )
109 StringList getObservablesRepoIds()
110 throws ArchivaRestServiceException;
111
112
113
114
115
116
117
118
119
120
121
122
123
124 @GET
125 @Path( "/artifact" )
126 @Produces( "text/html" )
127 @RedbackAuthorization( noPermission = true, noRestriction = true )
128 Response redirectToArtifactFile( @QueryParam( "r" ) String repositoryId,
129 @QueryParam( "g" ) String groupId,
130 @QueryParam( "a" ) String artifactId,
131 @QueryParam( "v" ) String version,
132 @QueryParam( "p" ) String packaging,
133 @QueryParam( "c" ) String classifier )
134 throws ArchivaRestServiceException;
135
136
137
138
139
140
141 @Path( "artifactsByChecksum" )
142 @POST
143 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
144 @RedbackAuthorization( noPermission = true, noRestriction = true )
145 List<Artifact> getArtifactByChecksum( ChecksumSearch checksumSearch )
146 throws ArchivaRestServiceException;
147
148
149 }