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;
96 this.resetStats = resetStats;
99 public String getCronExpression()
101 return cronExpression;
104 public void setCronExpression( String cronExpression )
106 this.cronExpression = cronExpression;
109 public String getLocation()
111 return this.location;
115 public boolean isReleases()
117 return this.releases;
123 public boolean isSnapshots()
125 return this.snapshots;
129 public void setReleases( boolean releases )
131 this.releases = releases;
134 public void setSnapshots( boolean snapshots )
136 this.snapshots = snapshots;
139 public void setLocation( String location )
141 this.location = location;
144 public boolean isBlockRedeployments()
146 return blockRedeployments;
149 public void setBlockRedeployments( boolean blockRedeployments )
151 this.blockRedeployments = blockRedeployments;
155 public ManagedRepository getStagingRepository()
157 return stagingRepository;
161 public void setStagingRepository( ManagedRepository stagingRepository )
163 this.stagingRepository = stagingRepository;
166 public boolean isScanned()
171 public void setScanned( boolean scanned )
173 this.scanned = scanned;
177 public int getDaysOlder()
182 public void setDaysOlder( int daysOlder )
184 this.daysOlder = daysOlder;
187 public int getRetentionCount()
189 return retentionCount;
192 public void setRetentionCount( int retentionCount )
194 this.retentionCount = retentionCount;
197 public boolean isDeleteReleasedSnapshots()
199 return deleteReleasedSnapshots;
202 public void setDeleteReleasedSnapshots( boolean deleteReleasedSnapshots )
204 this.deleteReleasedSnapshots = deleteReleasedSnapshots;
207 public boolean isStageRepoNeeded()
209 return stageRepoNeeded;
212 public void setStageRepoNeeded( boolean stageRepoNeeded )
214 this.stageRepoNeeded = stageRepoNeeded;
217 public boolean isResetStats()
222 public void setResetStats( boolean resetStats )
224 this.resetStats = resetStats;
228 public String toString()
230 final StringBuilder sb = new StringBuilder();
231 sb.append( super.toString() );
232 sb.append( "ManagedRepository" );
233 sb.append( "{location='" ).append( location ).append( '\'' );
234 sb.append( ", snapshots=" ).append( snapshots );
235 sb.append( ", releases=" ).append( releases );
236 sb.append( ", blockRedeployments=" ).append( blockRedeployments );
237 sb.append( ", cronExpression='" ).append( cronExpression ).append( '\'' );
238 sb.append( ", stagingRepository=" ).append( stagingRepository );
239 sb.append( ", scanned=" ).append( scanned );
240 sb.append( ", daysOlder=" ).append( daysOlder );
241 sb.append( ", retentionCount=" ).append( retentionCount );
242 sb.append( ", deleteReleasedSnapshots=" ).append( deleteReleasedSnapshots );
243 sb.append( ", stageRepoNeeded=" ).append( stageRepoNeeded );
244 sb.append( ", resetStats=" ).append( resetStats );
246 return sb.toString();