You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SearchRequest.java 7.9KB

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