1 package org.apache.archiva.admin.repository.managed;
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 org.apache.archiva.admin.repository.AbstractRepository;
24 import java.io.Serializable;
27 * @author Olivier Lamy
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;
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 = true;
56 private String indexDirectory;
61 private int daysOlder = 100;
66 private int retentionCount = 2;
68 private boolean deleteReleasedSnapshots;
70 public ManagedRepository()
75 public ManagedRepository( String id, String name, String location, String layout, boolean snapshots,
76 boolean releases, boolean blockRedeployments, String cronExpression, String indexDir,
77 boolean scanned, int daysOlder, int retentionCount, boolean deleteReleasedSnapshots )
79 super(id, name, layout);
81 this.location = location;
82 this.snapshots = snapshots;
83 this.releases = releases;
84 this.blockRedeployments = blockRedeployments;
85 this.cronExpression = cronExpression;
86 this.indexDirectory = indexDir;
87 this.scanned = scanned;
88 this.daysOlder = daysOlder;
89 this.retentionCount = retentionCount;
90 this.deleteReleasedSnapshots = deleteReleasedSnapshots;
93 public String getLocation()
99 public boolean isReleases()
101 return this.releases;
107 public boolean isSnapshots()
109 return this.snapshots;
113 public void setReleases( boolean releases )
115 this.releases = releases;
118 public void setSnapshots( boolean snapshots )
120 this.snapshots = snapshots;
123 public void setLocation( String location )
125 this.location = location;
128 public boolean isBlockRedeployments()
130 return blockRedeployments;
133 public void setBlockRedeployments( boolean blockRedeployments )
135 this.blockRedeployments = blockRedeployments;
138 public String getCronExpression()
140 return cronExpression;
143 public void setCronExpression( String cronExpression )
145 this.cronExpression = cronExpression;
148 public ManagedRepository getStagingRepository()
150 return stagingRepository;
154 public void setStagingRepository( ManagedRepository stagingRepository )
156 this.stagingRepository = stagingRepository;
159 public boolean isScanned()
164 public void setScanned( boolean scanned )
166 this.scanned = scanned;
169 public String getIndexDirectory()
171 return indexDirectory;
174 public void setIndexDirectory( String indexDirectory )
176 this.indexDirectory = indexDirectory;
179 public int getDaysOlder()
184 public void setDaysOlder( int daysOlder )
186 this.daysOlder = daysOlder;
189 public int getRetentionCount()
191 return retentionCount;
194 public void setRetentionCount( int retentionCount )
196 this.retentionCount = retentionCount;
199 public boolean isDeleteReleasedSnapshots()
201 return deleteReleasedSnapshots;
204 public void setDeleteReleasedSnapshots( boolean deleteReleasedSnapshots )
206 this.deleteReleasedSnapshots = deleteReleasedSnapshots;
211 public String toString()
213 final StringBuilder sb = new StringBuilder();
214 sb.append( "ManagedRepository" );
215 sb.append( "{location='" ).append( location ).append( '\'' );
216 sb.append( ", snapshots=" ).append( snapshots );
217 sb.append( ", releases=" ).append( releases );
218 sb.append( ", blockRedeployments=" ).append( blockRedeployments );
219 sb.append( ", cronExpression='" ).append( cronExpression ).append( '\'' );
220 sb.append( ", stagingRepository=" ).append( stagingRepository );
221 sb.append( ", scanned=" ).append( scanned );
222 sb.append( ", indexDirectory='" ).append( indexDirectory ).append( '\'' );
223 sb.append( ", daysOlder=" ).append( daysOlder );
224 sb.append( ", retentionCount=" ).append( retentionCount );
225 sb.append( ", deleteReleasedSnapshots=" ).append( deleteReleasedSnapshots );
227 sb.append( super.toString() );
228 return sb.toString();