1 package org.apache.archiva.admin.model.beans;
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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
22 import javax.xml.bind.annotation.XmlRootElement;
23 import java.io.Serializable;
26 * @author Olivier Lamy
29 @XmlRootElement( name = "managedRepository" )
30 public class ManagedRepository
31 extends AbstractRepository
32 implements Serializable
35 private String location;
37 private boolean snapshots = false;
39 private boolean releases = true;
41 private boolean blockRedeployments = false;
44 * default model value hourly
46 private String cronExpression = "0 0 * * * ?";
50 * not need when creating the repo : only available when reading
52 private ManagedRepository stagingRepository;
54 private boolean scanned = false;
60 private int daysOlder = 100;
65 private int retentionCount = 2;
67 private boolean deleteReleasedSnapshots;
69 private boolean stageRepoNeeded;
71 private boolean resetStats;
73 public ManagedRepository()
78 public ManagedRepository( String id, String name, String location, String layout, boolean snapshots,
79 boolean releases, boolean blockRedeployments, String cronExpression, String indexDir,
80 boolean scanned, int daysOlder, int retentionCount, boolean deleteReleasedSnapshots,
81 boolean stageRepoNeeded )
83 super( id, name, layout );
85 this.location = location;
86 this.snapshots = snapshots;
87 this.releases = releases;
88 this.blockRedeployments = blockRedeployments;
89 this.setCronExpression( cronExpression );
90 this.setIndexDirectory( indexDir );
91 this.scanned = scanned;
92 this.daysOlder = daysOlder;
93 this.retentionCount = retentionCount;
94 this.deleteReleasedSnapshots = deleteReleasedSnapshots;
95 this.stageRepoNeeded = stageRepoNeeded;
98 public String getCronExpression()
100 return cronExpression;
103 public void setCronExpression( String cronExpression )
105 this.cronExpression = cronExpression;
108 public String getLocation()
110 return this.location;
114 public boolean isReleases()
116 return this.releases;
122 public boolean isSnapshots()
124 return this.snapshots;
128 public void setReleases( boolean releases )
130 this.releases = releases;
133 public void setSnapshots( boolean snapshots )
135 this.snapshots = snapshots;
138 public void setLocation( String location )
140 this.location = location;
143 public boolean isBlockRedeployments()
145 return blockRedeployments;
148 public void setBlockRedeployments( boolean blockRedeployments )
150 this.blockRedeployments = blockRedeployments;
154 public ManagedRepository getStagingRepository()
156 return stagingRepository;
160 public void setStagingRepository( ManagedRepository stagingRepository )
162 this.stagingRepository = stagingRepository;
165 public boolean isScanned()
170 public void setScanned( boolean scanned )
172 this.scanned = scanned;
176 public int getDaysOlder()
181 public void setDaysOlder( int daysOlder )
183 this.daysOlder = daysOlder;
186 public int getRetentionCount()
188 return retentionCount;
191 public void setRetentionCount( int retentionCount )
193 this.retentionCount = retentionCount;
196 public boolean isDeleteReleasedSnapshots()
198 return deleteReleasedSnapshots;
201 public void setDeleteReleasedSnapshots( boolean deleteReleasedSnapshots )
203 this.deleteReleasedSnapshots = deleteReleasedSnapshots;
206 public boolean isStageRepoNeeded()
208 return stageRepoNeeded;
211 public void setStageRepoNeeded( boolean stageRepoNeeded )
213 this.stageRepoNeeded = stageRepoNeeded;
216 public boolean isResetStats()
221 public void setResetStats( boolean resetStats )
223 this.resetStats = resetStats;
227 public String toString()
229 final StringBuilder sb = new StringBuilder();
230 sb.append( super.toString() );
231 sb.append( "ManagedRepository" );
232 sb.append( "{location='" ).append( location ).append( '\'' );
233 sb.append( ", snapshots=" ).append( snapshots );
234 sb.append( ", releases=" ).append( releases );
235 sb.append( ", blockRedeployments=" ).append( blockRedeployments );
236 sb.append( ", cronExpression='" ).append( cronExpression ).append( '\'' );
237 sb.append( ", stagingRepository=" ).append( stagingRepository );
238 sb.append( ", scanned=" ).append( scanned );
239 sb.append( ", daysOlder=" ).append( daysOlder );
240 sb.append( ", retentionCount=" ).append( retentionCount );
241 sb.append( ", deleteReleasedSnapshots=" ).append( deleteReleasedSnapshots );
242 sb.append( ", stageRepoNeeded=" ).append( stageRepoNeeded );
243 sb.append( ", resetStats=" ).append( resetStats );
245 return sb.toString();