1 package org.apache.archiva.rest.api.model;
3 import javax.xml.bind.annotation.XmlRootElement;
4 import java.io.Serializable;
5 import java.util.ArrayList;
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
17 * http://www.apache.org/licenses/LICENSE-2.0
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
26 @XmlRootElement( name = "searchRequest" )
27 public class SearchRequest
28 implements Serializable
33 * to be able to search with a query on selected repositories
35 private String queryTerms;
40 private String groupId;
45 private String artifactId;
50 private String version;
53 * packaging (jar, war, pom, etc.)
55 private String packaging;
58 * class name or package name
60 private String className;
65 private List<String> repositories = new ArrayList<>();
69 * contains osgi metadata Bundle-Version if available
73 private String bundleVersion;
76 * contains osgi metadata Bundle-SymbolicName if available
80 private String bundleSymbolicName;
83 * contains osgi metadata Export-Package if available
87 private String bundleExportPackage;
90 * contains osgi metadata Export-Service if available
94 private String bundleExportService;
97 * contains osgi metadata Import-Package if available
101 private String bundleImportPackage;
105 * contains osgi metadata Require-Bundle if available
109 private String bundleRequireBundle;
111 private String classifier;
114 * not return artifact with file extension pom
118 private boolean includePomArtifacts = false;
123 private int pageSize = 30;
128 private int selectedPage = 0;
131 public SearchRequest()
136 public SearchRequest( String groupId, String artifactId, String version, String packaging, String className,
137 List<String> repositories )
139 this.groupId = groupId;
140 this.artifactId = artifactId;
141 this.version = version;
142 this.packaging = packaging;
143 this.className = className;
144 this.repositories = repositories;
147 public String getGroupId()
152 public void setGroupId( String groupId )
154 this.groupId = groupId;
157 public String getArtifactId()
162 public void setArtifactId( String artifactId )
164 this.artifactId = artifactId;
167 public String getVersion()
172 public void setVersion( String version )
174 this.version = version;
177 public String getPackaging()
182 public void setPackaging( String packaging )
184 this.packaging = packaging;
187 public String getClassName()
192 public void setClassName( String className )
194 this.className = className;
197 public List<String> getRepositories()
202 public void setRepositories( List<String> repositories )
204 this.repositories = repositories;
208 public String getBundleVersion()
210 return bundleVersion;
213 public void setBundleVersion( String bundleVersion )
215 this.bundleVersion = bundleVersion;
218 public String getBundleSymbolicName()
220 return bundleSymbolicName;
223 public void setBundleSymbolicName( String bundleSymbolicName )
225 this.bundleSymbolicName = bundleSymbolicName;
228 public String getBundleExportPackage()
230 return bundleExportPackage;
233 public void setBundleExportPackage( String bundleExportPackage )
235 this.bundleExportPackage = bundleExportPackage;
238 public String getBundleExportService()
240 return bundleExportService;
243 public void setBundleExportService( String bundleExportService )
245 this.bundleExportService = bundleExportService;
248 public String getClassifier()
253 public void setClassifier( String classifier )
255 this.classifier = classifier;
258 public boolean isIncludePomArtifacts()
260 return includePomArtifacts;
263 public void setIncludePomArtifacts( boolean includePomArtifacts )
265 this.includePomArtifacts = includePomArtifacts;
268 public String getQueryTerms()
273 public void setQueryTerms( String queryTerms )
275 this.queryTerms = queryTerms;
278 public String getBundleImportPackage()
280 return bundleImportPackage;
283 public void setBundleImportPackage( String bundleImportPackage )
285 this.bundleImportPackage = bundleImportPackage;
288 public String getBundleRequireBundle()
290 return bundleRequireBundle;
293 public void setBundleRequireBundle( String bundleRequireBundle )
295 this.bundleRequireBundle = bundleRequireBundle;
298 public int getPageSize()
303 public void setPageSize( int pageSize )
305 this.pageSize = pageSize;
308 public int getSelectedPage()
313 public void setSelectedPage( int selectedPage )
315 this.selectedPage = selectedPage;
319 public String toString()
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 );
341 return sb.toString();