This project has retired. For details please refer to its Attic page.
SearchRequest xref
View Javadoc
1   package org.apache.archiva.rest.api.model;
2   
3   import javax.xml.bind.annotation.XmlRootElement;
4   import java.io.Serializable;
5   import java.util.ArrayList;
6   import java.util.List;
7   
8   /*
9    * Licensed to the Apache Software Foundation (ASF) under one
10   * or more contributor license agreements.  See the NOTICE file
11   * distributed with this work for additional information
12   * regarding copyright ownership.  The ASF licenses this file
13   * to you under the Apache License, Version 2.0 (the
14   * "License"); you may not use this file except in compliance
15   * with the License.  You may obtain a copy of the License at
16   *
17   *  http://www.apache.org/licenses/LICENSE-2.0
18   *
19   * Unless required by applicable law or agreed to in writing,
20   * software distributed under the License is distributed on an
21   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
22   * KIND, either express or implied.  See the License for the
23   * specific language governing permissions and limitations
24   * under the License.
25   */
26  @XmlRootElement( name = "searchRequest" )
27  public class SearchRequest
28      implements Serializable
29  {
30  
31      /**
32       * @since 1.4-M3
33       *        to be able to search with a query on selected repositories
34       */
35      private String queryTerms;
36  
37      /**
38       * groupId
39       */
40      private String groupId;
41  
42      /**
43       * artifactId
44       */
45      private String artifactId;
46  
47      /**
48       * version
49       */
50      private String version;
51  
52      /**
53       * packaging (jar, war, pom, etc.)
54       */
55      private String packaging;
56  
57      /**
58       * class name or package name
59       */
60      private String className;
61  
62      /**
63       * repositories
64       */
65      private List<String> repositories = new ArrayList<>();
66  
67  
68      /**
69       * contains osgi metadata Bundle-Version if available
70       *
71       * @since 1.4-M1
72       */
73      private String bundleVersion;
74  
75      /**
76       * contains osgi metadata Bundle-SymbolicName if available
77       *
78       * @since 1.4-M1
79       */
80      private String bundleSymbolicName;
81  
82      /**
83       * contains osgi metadata Export-Package if available
84       *
85       * @since 1.4-M1
86       */
87      private String bundleExportPackage;
88  
89      /**
90       * contains osgi metadata Export-Service if available
91       *
92       * @since 1.4-M1
93       */
94      private String bundleExportService;
95  
96      /**
97       * contains osgi metadata Import-Package if available
98       *
99       * @since 1.4-M3
100      */
101     private String bundleImportPackage;
102 
103 
104     /**
105      * contains osgi metadata Require-Bundle if available
106      *
107      * @since 1.4-M3
108      */
109     private String bundleRequireBundle;
110 
111     private String classifier;
112 
113     /**
114      * not return artifact with file extension pom
115      *
116      * @since 1.4-M2
117      */
118     private boolean includePomArtifacts = false;
119 
120     /**
121      * @since 1.4-M4
122      */
123     private int pageSize = 30;
124 
125     /**
126      * @since 1.4-M4
127      */
128     private int selectedPage = 0;
129 
130 
131     public SearchRequest()
132     {
133         // no op
134     }
135 
136     public SearchRequest( String groupId, String artifactId, String version, String packaging, String className,
137                           List<String> repositories )
138     {
139         this.groupId = groupId;
140         this.artifactId = artifactId;
141         this.version = version;
142         this.packaging = packaging;
143         this.className = className;
144         this.repositories = repositories;
145     }
146 
147     public String getGroupId()
148     {
149         return groupId;
150     }
151 
152     public void setGroupId( String groupId )
153     {
154         this.groupId = groupId;
155     }
156 
157     public String getArtifactId()
158     {
159         return artifactId;
160     }
161 
162     public void setArtifactId( String artifactId )
163     {
164         this.artifactId = artifactId;
165     }
166 
167     public String getVersion()
168     {
169         return version;
170     }
171 
172     public void setVersion( String version )
173     {
174         this.version = version;
175     }
176 
177     public String getPackaging()
178     {
179         return packaging;
180     }
181 
182     public void setPackaging( String packaging )
183     {
184         this.packaging = packaging;
185     }
186 
187     public String getClassName()
188     {
189         return className;
190     }
191 
192     public void setClassName( String className )
193     {
194         this.className = className;
195     }
196 
197     public List<String> getRepositories()
198     {
199         return repositories;
200     }
201 
202     public void setRepositories( List<String> repositories )
203     {
204         this.repositories = repositories;
205     }
206 
207 
208     public String getBundleVersion()
209     {
210         return bundleVersion;
211     }
212 
213     public void setBundleVersion( String bundleVersion )
214     {
215         this.bundleVersion = bundleVersion;
216     }
217 
218     public String getBundleSymbolicName()
219     {
220         return bundleSymbolicName;
221     }
222 
223     public void setBundleSymbolicName( String bundleSymbolicName )
224     {
225         this.bundleSymbolicName = bundleSymbolicName;
226     }
227 
228     public String getBundleExportPackage()
229     {
230         return bundleExportPackage;
231     }
232 
233     public void setBundleExportPackage( String bundleExportPackage )
234     {
235         this.bundleExportPackage = bundleExportPackage;
236     }
237 
238     public String getBundleExportService()
239     {
240         return bundleExportService;
241     }
242 
243     public void setBundleExportService( String bundleExportService )
244     {
245         this.bundleExportService = bundleExportService;
246     }
247 
248     public String getClassifier()
249     {
250         return classifier;
251     }
252 
253     public void setClassifier( String classifier )
254     {
255         this.classifier = classifier;
256     }
257 
258     public boolean isIncludePomArtifacts()
259     {
260         return includePomArtifacts;
261     }
262 
263     public void setIncludePomArtifacts( boolean includePomArtifacts )
264     {
265         this.includePomArtifacts = includePomArtifacts;
266     }
267 
268     public String getQueryTerms()
269     {
270         return queryTerms;
271     }
272 
273     public void setQueryTerms( String queryTerms )
274     {
275         this.queryTerms = queryTerms;
276     }
277 
278     public String getBundleImportPackage()
279     {
280         return bundleImportPackage;
281     }
282 
283     public void setBundleImportPackage( String bundleImportPackage )
284     {
285         this.bundleImportPackage = bundleImportPackage;
286     }
287 
288     public String getBundleRequireBundle()
289     {
290         return bundleRequireBundle;
291     }
292 
293     public void setBundleRequireBundle( String bundleRequireBundle )
294     {
295         this.bundleRequireBundle = bundleRequireBundle;
296     }
297 
298     public int getPageSize()
299     {
300         return pageSize;
301     }
302 
303     public void setPageSize( int pageSize )
304     {
305         this.pageSize = pageSize;
306     }
307 
308     public int getSelectedPage()
309     {
310         return selectedPage;
311     }
312 
313     public void setSelectedPage( int selectedPage )
314     {
315         this.selectedPage = selectedPage;
316     }
317 
318     @Override
319     public String toString()
320     {
321         final StringBuilder sb = new StringBuilder();
322         sb.append( "SearchRequest" );
323         sb.append( "{queryTerms='" ).append( queryTerms ).append( '\'' );
324         sb.append( ", groupId='" ).append( groupId ).append( '\'' );
325         sb.append( ", artifactId='" ).append( artifactId ).append( '\'' );
326         sb.append( ", version='" ).append( version ).append( '\'' );
327         sb.append( ", packaging='" ).append( packaging ).append( '\'' );
328         sb.append( ", className='" ).append( className ).append( '\'' );
329         sb.append( ", repositories=" ).append( repositories );
330         sb.append( ", bundleVersion='" ).append( bundleVersion ).append( '\'' );
331         sb.append( ", bundleSymbolicName='" ).append( bundleSymbolicName ).append( '\'' );
332         sb.append( ", bundleExportPackage='" ).append( bundleExportPackage ).append( '\'' );
333         sb.append( ", bundleExportService='" ).append( bundleExportService ).append( '\'' );
334         sb.append( ", bundleImportPackage='" ).append( bundleImportPackage ).append( '\'' );
335         sb.append( ", bundleRequireBundle='" ).append( bundleRequireBundle ).append( '\'' );
336         sb.append( ", classifier='" ).append( classifier ).append( '\'' );
337         sb.append( ", includePomArtifacts=" ).append( includePomArtifacts );
338         sb.append( ", pageSize=" ).append( pageSize );
339         sb.append( ", selectedPage=" ).append( selectedPage );
340         sb.append( '}' );
341         return sb.toString();
342     }
343 }