1 package org.apache.archiva.rest.api.model;
3 import javax.xml.bind.annotation.XmlRootElement;
4 import java.util.ArrayList;
8 * Licensed to the Apache Software Foundation (ASF) under one
9 * or more contributor license agreements. See the NOTICE file
10 * distributed with this work for additional information
11 * regarding copyright ownership. The ASF licenses this file
12 * to you under the Apache License, Version 2.0 (the
13 * "License"); you may not use this file except in compliance
14 * with the License. You may obtain a copy of the License at
16 * http://www.apache.org/licenses/LICENSE-2.0
18 * Unless required by applicable law or agreed to in writing,
19 * software distributed under the License is distributed on an
20 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 * KIND, either express or implied. See the License for the
22 * specific language governing permissions and limitations
25 @XmlRootElement( name = "searchRequest" )
26 public class SearchRequest
31 * to be able to search with a query on selected repositories
33 private String queryTerms;
38 private String groupId;
43 private String artifactId;
48 private String version;
51 * packaging (jar, war, pom, etc.)
53 private String packaging;
56 * class name or package name
58 private String className;
63 private List<String> repositories = new ArrayList<String>();
67 * contains osgi metadata Bundle-Version if available
71 private String bundleVersion;
74 * contains osgi metadata Bundle-SymbolicName if available
78 private String bundleSymbolicName;
81 * contains osgi metadata Export-Package if available
85 private String bundleExportPackage;
88 * contains osgi metadata Export-Service if available
92 private String bundleExportService;
94 private String classifier;
97 * not return artifact with file extension pom
100 private boolean includePomArtifacts = false;
102 public SearchRequest()
107 public SearchRequest( String groupId, String artifactId, String version, String packaging, String className,
108 List<String> repositories )
110 this.groupId = groupId;
111 this.artifactId = artifactId;
112 this.version = version;
113 this.packaging = packaging;
114 this.className = className;
115 this.repositories = repositories;
118 public String getGroupId()
123 public void setGroupId( String groupId )
125 this.groupId = groupId;
128 public String getArtifactId()
133 public void setArtifactId( String artifactId )
135 this.artifactId = artifactId;
138 public String getVersion()
143 public void setVersion( String version )
145 this.version = version;
148 public String getPackaging()
153 public void setPackaging( String packaging )
155 this.packaging = packaging;
158 public String getClassName()
163 public void setClassName( String className )
165 this.className = className;
168 public List<String> getRepositories()
173 public void setRepositories( List<String> repositories )
175 this.repositories = repositories;
179 public String getBundleVersion()
181 return bundleVersion;
184 public void setBundleVersion( String bundleVersion )
186 this.bundleVersion = bundleVersion;
189 public String getBundleSymbolicName()
191 return bundleSymbolicName;
194 public void setBundleSymbolicName( String bundleSymbolicName )
196 this.bundleSymbolicName = bundleSymbolicName;
199 public String getBundleExportPackage()
201 return bundleExportPackage;
204 public void setBundleExportPackage( String bundleExportPackage )
206 this.bundleExportPackage = bundleExportPackage;
209 public String getBundleExportService()
211 return bundleExportService;
214 public void setBundleExportService( String bundleExportService )
216 this.bundleExportService = bundleExportService;
219 public String getClassifier()
224 public void setClassifier( String classifier )
226 this.classifier = classifier;
229 public boolean isIncludePomArtifacts()
231 return includePomArtifacts;
234 public void setIncludePomArtifacts( boolean includePomArtifacts )
236 this.includePomArtifacts = includePomArtifacts;
239 public String getQueryTerms()
244 public void setQueryTerms( String queryTerms )
246 this.queryTerms = queryTerms;
250 public String toString()
252 final StringBuilder sb = new StringBuilder();
253 sb.append( "SearchRequest" );
254 sb.append( "{queryTerms='" ).append( queryTerms ).append( '\'' );
255 sb.append( ", groupId='" ).append( groupId ).append( '\'' );
256 sb.append( ", artifactId='" ).append( artifactId ).append( '\'' );
257 sb.append( ", version='" ).append( version ).append( '\'' );
258 sb.append( ", packaging='" ).append( packaging ).append( '\'' );
259 sb.append( ", className='" ).append( className ).append( '\'' );
260 sb.append( ", repositories=" ).append( repositories );
261 sb.append( ", bundleVersion='" ).append( bundleVersion ).append( '\'' );
262 sb.append( ", bundleSymbolicName='" ).append( bundleSymbolicName ).append( '\'' );
263 sb.append( ", bundleExportPackage='" ).append( bundleExportPackage ).append( '\'' );
264 sb.append( ", bundleExportService='" ).append( bundleExportService ).append( '\'' );
265 sb.append( ", classifier='" ).append( classifier ).append( '\'' );
266 sb.append( ", includePomArtifacts=" ).append( includePomArtifacts );
268 return sb.toString();