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.

ManagedRepositoryConfiguration.java 8.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. package org.apache.archiva.configuration;
  2. /*
  3. * Licensed to the Apache Software Foundation (ASF) under one
  4. * or more contributor license agreements. See the NOTICE file
  5. * distributed with this work for additional information
  6. * regarding copyright ownership. The ASF licenses this file
  7. * to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance
  9. * with the License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing,
  14. * software distributed under the License is distributed on an
  15. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16. * KIND, either express or implied. See the License for the
  17. * specific language governing permissions and limitations
  18. * under the License.
  19. */
  20. /**
  21. * Class ManagedRepositoryConfiguration.
  22. *
  23. * @version $Revision$ $Date$
  24. */
  25. @SuppressWarnings( "all" )
  26. public class ManagedRepositoryConfiguration
  27. extends AbstractRepositoryConfiguration
  28. implements java.io.Serializable
  29. {
  30. //--------------------------/
  31. //- Class/Member Variables -/
  32. //--------------------------/
  33. /**
  34. *
  35. * The file system location for this repository.
  36. *
  37. */
  38. private String location;
  39. /**
  40. * True if this repository contains release versioned artifacts.
  41. */
  42. private boolean releases = true;
  43. /**
  44. * True if re-deployment of artifacts already in the repository
  45. * will be blocked.
  46. */
  47. private boolean blockRedeployments = false;
  48. /**
  49. * True if this repository contains snapshot versioned artifacts
  50. */
  51. private boolean snapshots = false;
  52. /**
  53. * True if this repository should be scanned and processed.
  54. */
  55. private boolean scanned = true;
  56. /**
  57. *
  58. * When to run the refresh task.
  59. * Default is every hour
  60. * .
  61. */
  62. private String refreshCronExpression = "0 0 * * * ?";
  63. /**
  64. *
  65. * The total count of the artifact to be retained
  66. * for each snapshot.
  67. *
  68. */
  69. private int retentionCount = 2;
  70. /**
  71. *
  72. * The number of days after which snapshots will be
  73. * removed.
  74. *
  75. */
  76. private int retentionPeriod = 100;
  77. /**
  78. *
  79. * True if the released snapshots are to be removed
  80. * from the repo during repository purge.
  81. *
  82. */
  83. private boolean deleteReleasedSnapshots = false;
  84. /**
  85. *
  86. * True to not generate packed index (note you
  87. * won't be able to export your index.
  88. *
  89. */
  90. private boolean skipPackedIndexCreation = false;
  91. /**
  92. *
  93. * Need a staging repository
  94. * .
  95. */
  96. private boolean stageRepoNeeded = false;
  97. //-----------/
  98. //- Methods -/
  99. //-----------/
  100. /**
  101. * Get the file system location for this repository.
  102. *
  103. * @return String
  104. */
  105. public String getLocation()
  106. {
  107. return this.location;
  108. } //-- String getLocation()
  109. /**
  110. * Get when to run the refresh task.
  111. * Default is every hour.
  112. *
  113. * @return String
  114. */
  115. public String getRefreshCronExpression()
  116. {
  117. return this.refreshCronExpression;
  118. } //-- String getRefreshCronExpression()
  119. /**
  120. * Get the total count of the artifact to be retained for each
  121. * snapshot.
  122. *
  123. * @return int
  124. */
  125. public int getRetentionCount()
  126. {
  127. return this.retentionCount;
  128. } //-- int getRetentionCount()
  129. /**
  130. * Get the number of days after which snapshots will be
  131. * removed.
  132. *
  133. * @return int
  134. */
  135. public int getRetentionPeriod()
  136. {
  137. return this.retentionPeriod;
  138. } //-- int getRetentionPeriod()
  139. /**
  140. * Get true if re-deployment of artifacts already in the
  141. * repository will be blocked.
  142. *
  143. * @return boolean
  144. */
  145. public boolean isBlockRedeployments()
  146. {
  147. return this.blockRedeployments;
  148. } //-- boolean isBlockRedeployments()
  149. /**
  150. * Get true if the released snapshots are to be removed from
  151. * the repo during repository purge.
  152. *
  153. * @return boolean
  154. */
  155. public boolean isDeleteReleasedSnapshots()
  156. {
  157. return this.deleteReleasedSnapshots;
  158. } //-- boolean isDeleteReleasedSnapshots()
  159. /**
  160. * Get true if this repository contains release versioned
  161. * artifacts.
  162. *
  163. * @return boolean
  164. */
  165. public boolean isReleases()
  166. {
  167. return this.releases;
  168. } //-- boolean isReleases()
  169. /**
  170. * Get true if this repository should be scanned and processed.
  171. *
  172. * @return boolean
  173. */
  174. public boolean isScanned()
  175. {
  176. return this.scanned;
  177. } //-- boolean isScanned()
  178. /**
  179. * Get true to not generate packed index (note you won't be
  180. * able to export your index.
  181. *
  182. * @return boolean
  183. */
  184. public boolean isSkipPackedIndexCreation()
  185. {
  186. return this.skipPackedIndexCreation;
  187. } //-- boolean isSkipPackedIndexCreation()
  188. /**
  189. * Get true if this repository contains snapshot versioned
  190. * artifacts.
  191. *
  192. * @return boolean
  193. */
  194. public boolean isSnapshots()
  195. {
  196. return this.snapshots;
  197. } //-- boolean isSnapshots()
  198. /**
  199. * Get need a staging repository.
  200. *
  201. * @return boolean
  202. */
  203. public boolean isStageRepoNeeded()
  204. {
  205. return this.stageRepoNeeded;
  206. } //-- boolean isStageRepoNeeded()
  207. /**
  208. * Set true if re-deployment of artifacts already in the
  209. * repository will be blocked.
  210. *
  211. * @param blockRedeployments
  212. */
  213. public void setBlockRedeployments( boolean blockRedeployments )
  214. {
  215. this.blockRedeployments = blockRedeployments;
  216. } //-- void setBlockRedeployments( boolean )
  217. /**
  218. * Set true if the released snapshots are to be removed from
  219. * the repo during repository purge.
  220. *
  221. * @param deleteReleasedSnapshots
  222. */
  223. public void setDeleteReleasedSnapshots( boolean deleteReleasedSnapshots )
  224. {
  225. this.deleteReleasedSnapshots = deleteReleasedSnapshots;
  226. } //-- void setDeleteReleasedSnapshots( boolean )
  227. /**
  228. * Set the file system location for this repository.
  229. *
  230. * @param location
  231. */
  232. public void setLocation( String location )
  233. {
  234. this.location = location;
  235. } //-- void setLocation( String )
  236. /**
  237. * Set when to run the refresh task.
  238. * Default is every hour.
  239. *
  240. * @param refreshCronExpression
  241. */
  242. public void setRefreshCronExpression( String refreshCronExpression )
  243. {
  244. this.refreshCronExpression = refreshCronExpression;
  245. } //-- void setRefreshCronExpression( String )
  246. /**
  247. * Set true if this repository contains release versioned
  248. * artifacts.
  249. *
  250. * @param releases
  251. */
  252. public void setReleases( boolean releases )
  253. {
  254. this.releases = releases;
  255. } //-- void setReleases( boolean )
  256. /**
  257. * Set the total count of the artifact to be retained for each
  258. * snapshot.
  259. *
  260. * @param retentionCount
  261. */
  262. public void setRetentionCount( int retentionCount )
  263. {
  264. this.retentionCount = retentionCount;
  265. } //-- void setRetentionCount( int )
  266. /**
  267. * Set the number of days after which snapshots will be
  268. * removed.
  269. *
  270. * @param retentionPeriod
  271. */
  272. public void setRetentionPeriod( int retentionPeriod )
  273. {
  274. this.retentionPeriod = retentionPeriod;
  275. } //-- void setRetentionPeriod( int )
  276. /**
  277. * Set true if this repository should be scanned and processed.
  278. *
  279. * @param scanned
  280. */
  281. public void setScanned( boolean scanned )
  282. {
  283. this.scanned = scanned;
  284. } //-- void setScanned( boolean )
  285. /**
  286. * Set true to not generate packed index (note you won't be
  287. * able to export your index.
  288. *
  289. * @param skipPackedIndexCreation
  290. */
  291. public void setSkipPackedIndexCreation( boolean skipPackedIndexCreation )
  292. {
  293. this.skipPackedIndexCreation = skipPackedIndexCreation;
  294. } //-- void setSkipPackedIndexCreation( boolean )
  295. /**
  296. * Set true if this repository contains snapshot versioned
  297. * artifacts.
  298. *
  299. * @param snapshots
  300. */
  301. public void setSnapshots( boolean snapshots )
  302. {
  303. this.snapshots = snapshots;
  304. } //-- void setSnapshots( boolean )
  305. /**
  306. * Set need a staging repository.
  307. *
  308. * @param stageRepoNeeded
  309. */
  310. public void setStageRepoNeeded( boolean stageRepoNeeded )
  311. {
  312. this.stageRepoNeeded = stageRepoNeeded;
  313. } //-- void setStageRepoNeeded( boolean )
  314. }