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.DefaultValue;
31 import javax.ws.rs.GET;
32 import javax.ws.rs.POST;
33 import javax.ws.rs.Path;
34 import javax.ws.rs.Produces;
35 import javax.ws.rs.QueryParam;
36 import javax.ws.rs.core.MediaType;
37 import javax.ws.rs.core.Response;
38 import java.util.List;
39
40 @Path( "/searchService/" )
41 public interface SearchService
42 {
43
44
45
46
47
48
49
50
51
52 @Path( "quickSearch" )
53 @GET
54 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
55 @RedbackAuthorization( noPermission = true, noRestriction = true )
56 List<Artifact> quickSearch( @QueryParam( "queryString" ) String queryString )
57 throws ArchivaRestServiceException;
58
59
60
61
62 @Path( "quickSearchWithRepositories" )
63 @POST
64 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
65 @RedbackAuthorization( noPermission = true, noRestriction = true )
66 List<Artifact> quickSearchWithRepositories( SearchRequest searchRequest )
67 throws ArchivaRestServiceException;
68
69
70
71
72
73 @Path( "searchArtifacts" )
74 @POST
75 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
76 @RedbackAuthorization( noPermission = true, noRestriction = true )
77 List<Artifact> searchArtifacts( SearchRequest searchRequest )
78 throws ArchivaRestServiceException;
79
80
81
82
83 @Path( "getArtifactVersions" )
84 @GET
85 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
86 @RedbackAuthorization( noPermission = true, noRestriction = true )
87 List<Artifact> getArtifactVersions( @QueryParam( "groupId" ) String groupId,
88 @QueryParam( "artifactId" ) String artifactId,
89 @QueryParam( "packaging" ) String packaging )
90 throws ArchivaRestServiceException;
91
92
93
94
95
96 @Path( "getAllGroupIds" )
97 @GET
98 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
99 @RedbackAuthorization( noPermission = true, noRestriction = false )
100 GroupIdList getAllGroupIds( @QueryParam( "selectedRepos" ) List<String> selectedRepos )
101 throws ArchivaRestServiceException;
102
103
104
105
106 @Path( "observableRepoIds" )
107 @GET
108 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
109 @RedbackAuthorization( noPermission = true, noRestriction = true )
110 StringList getObservablesRepoIds()
111 throws ArchivaRestServiceException;
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139 @GET
140 @Path( "/artifact" )
141 @Produces( "text/html" )
142 @RedbackAuthorization( noPermission = true, noRestriction = true )
143 Response redirectToArtifactFile( @QueryParam( "r" ) String repositoryId,
144 @QueryParam( "g" ) String groupId,
145 @QueryParam( "a" ) String artifactId,
146 @QueryParam( "v" ) String version,
147 @QueryParam( "p" ) String packaging,
148 @QueryParam( "c" ) String classifier,
149 @DefaultValue( "false" )
150 @QueryParam( "literalVersion" ) Boolean literalVersion)
151 throws ArchivaRestServiceException;
152
153
154
155
156
157
158 @Path( "artifactsByChecksum" )
159 @POST
160 @Produces( { MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML } )
161 @RedbackAuthorization( noPermission = true, noRestriction = true )
162 List<Artifact> getArtifactByChecksum( ChecksumSearch checksumSearch )
163 throws ArchivaRestServiceException;
164
165
166 }