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