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.

RepositoryGroupConfiguration.java 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  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. import java.io.Serializable;
  21. import java.util.ArrayList;
  22. import java.util.List;
  23. /**
  24. * Class RepositoryGroupConfiguration.
  25. *
  26. * @version $Revision$ $Date$
  27. */
  28. @SuppressWarnings( "all" )
  29. public class RepositoryGroupConfiguration
  30. implements Serializable
  31. {
  32. //--------------------------/
  33. //- Class/Member Variables -/
  34. //--------------------------/
  35. /**
  36. * The id of the repository group.
  37. */
  38. private String id;
  39. /**
  40. * The name of the repository group
  41. */
  42. private String name;
  43. /**
  44. *
  45. * The repository type. Currently only MAVEN type
  46. * is known.
  47. *
  48. */
  49. private String type = "MAVEN";
  50. /**
  51. * The path of the merged index.
  52. */
  53. private String mergedIndexPath = ".indexer";
  54. /**
  55. * The time to live of the merged index of the repository group.
  56. */
  57. private int mergedIndexTtl = 30;
  58. /**
  59. *
  60. * When to run the index merging for this group.
  61. *
  62. */
  63. private String cronExpression = "";
  64. /**
  65. * Field repositories.
  66. */
  67. private List<String> repositories;
  68. /**
  69. * The path for local data
  70. */
  71. private String location;
  72. //-----------/
  73. //- Methods -/
  74. //-----------/
  75. /**
  76. * Return the local path for group data. If the merged index property is set to a non absolute path,
  77. * it is relative to this location.
  78. *
  79. * @return the path for group data storage
  80. */
  81. public String getLocation( )
  82. {
  83. return location;
  84. }
  85. /**
  86. * Set the local path for group data
  87. * @param location
  88. */
  89. public void setLocation( String location )
  90. {
  91. this.location = location;
  92. }
  93. /**
  94. * Method addRepository.
  95. *
  96. * @param string
  97. */
  98. public void addRepository( String string )
  99. {
  100. getRepositories().add( string );
  101. } //-- void addRepository( String )
  102. /**
  103. * Get when to run the index merging for this group.
  104. * No default value.
  105. *
  106. * @return String
  107. */
  108. public String getCronExpression()
  109. {
  110. return this.cronExpression;
  111. } //-- String getCronExpression()
  112. /**
  113. * Get the id of the repository group.
  114. *
  115. * @return String
  116. */
  117. public String getId()
  118. {
  119. return this.id;
  120. } //-- String getId()
  121. /**
  122. * Get the path of the merged index.
  123. *
  124. * @return String
  125. */
  126. public String getMergedIndexPath()
  127. {
  128. return this.mergedIndexPath;
  129. } //-- String getMergedIndexPath()
  130. /**
  131. * Get the time to live of the merged index of the repository
  132. * group.
  133. *
  134. * @return int
  135. */
  136. public int getMergedIndexTtl()
  137. {
  138. return this.mergedIndexTtl;
  139. } //-- int getMergedIndexTtl()
  140. /**
  141. * Method getRepositories.
  142. *
  143. * @return List
  144. */
  145. public List<String> getRepositories()
  146. {
  147. if ( this.repositories == null )
  148. {
  149. this.repositories = new ArrayList<String>();
  150. }
  151. return this.repositories;
  152. } //-- java.util.List<String> getRepositories()
  153. /**
  154. * Method removeRepository.
  155. *
  156. * @param string
  157. */
  158. public void removeRepository( String string )
  159. {
  160. getRepositories().remove( string );
  161. } //-- void removeRepository( String )
  162. /**
  163. * Set when to run the index merging for this group.
  164. * No default value.
  165. *
  166. * @param cronExpression
  167. */
  168. public void setCronExpression( String cronExpression )
  169. {
  170. this.cronExpression = cronExpression;
  171. } //-- void setCronExpression( String )
  172. /**
  173. * Set the id of the repository group.
  174. *
  175. * @param id
  176. */
  177. public void setId( String id )
  178. {
  179. this.id = id;
  180. } //-- void setId( String )
  181. /**
  182. * Set the path of the merged index.
  183. *
  184. * @param mergedIndexPath
  185. */
  186. public void setMergedIndexPath( String mergedIndexPath )
  187. {
  188. this.mergedIndexPath = mergedIndexPath;
  189. } //-- void setMergedIndexPath( String )
  190. /**
  191. * Set the time to live of the merged index of the repository
  192. * group.
  193. *
  194. * @param mergedIndexTtl
  195. */
  196. public void setMergedIndexTtl( int mergedIndexTtl )
  197. {
  198. this.mergedIndexTtl = mergedIndexTtl;
  199. } //-- void setMergedIndexTtl( int )
  200. /**
  201. * Set the list of repository ids under the group.
  202. *
  203. * @param repositories
  204. */
  205. public void setRepositories( List<String> repositories )
  206. {
  207. this.repositories = repositories;
  208. } //-- void setRepositories( java.util.List )
  209. public String getName() {
  210. return name;
  211. }
  212. public void setName(String name) {
  213. this.name = name;
  214. }
  215. public String getType() {
  216. return type;
  217. }
  218. public void setType(String type) {
  219. this.type = type;
  220. }
  221. }