This project has retired. For details please refer to its Attic page.
ManagedRepository xref
View Javadoc
1   package org.apache.archiva.admin.model.beans;
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  import javax.xml.bind.annotation.XmlRootElement;
23  import java.io.Serializable;
24  
25  /**
26   * @author Olivier Lamy
27   * @since 1.4-M1
28   */
29  @XmlRootElement (name = "managedRepository")
30  public class ManagedRepository
31      extends AbstractRepository
32      implements Serializable
33  {
34  
35      private String location;
36  
37      private boolean snapshots = false;
38  
39      private boolean releases = true;
40  
41      private boolean blockRedeployments = false;
42  
43      /**
44       * default model value hourly
45       */
46      private String cronExpression = "0 0 * * * ?";
47  
48  
49      /**
50       * not need when creating the repo : only available when reading
51       */
52      private ManagedRepository stagingRepository;
53  
54      private boolean scanned = true;
55  
56  
57      /**
58       * default model value
59       */
60      private int daysOlder = 100;
61  
62      /**
63       * default model value
64       */
65      private int retentionCount = 2;
66  
67      private boolean deleteReleasedSnapshots;
68  
69      private boolean stageRepoNeeded;
70  
71      private boolean resetStats;
72  
73      /**
74       * @since 1.4-M3
75       */
76      private boolean skipPackedIndexCreation;
77  
78      public ManagedRepository()
79      {
80          // no op
81      }
82  
83      public ManagedRepository( String id, String name, String location, String layout, boolean snapshots,
84                                boolean releases, boolean blockRedeployments, String cronExpression, String indexDir,
85                                boolean scanned, int daysOlder, int retentionCount, boolean deleteReleasedSnapshots,
86                                boolean stageRepoNeeded )
87      {
88          super( id, name, layout );
89  
90          this.location = location;
91          this.snapshots = snapshots;
92          this.releases = releases;
93          this.blockRedeployments = blockRedeployments;
94          this.setCronExpression( cronExpression );
95          this.setIndexDirectory( indexDir );
96          this.scanned = scanned;
97          this.daysOlder = daysOlder;
98          this.retentionCount = retentionCount;
99          this.deleteReleasedSnapshots = deleteReleasedSnapshots;
100         this.stageRepoNeeded = stageRepoNeeded;
101     }
102 
103     /**
104      * @since 1.4-M3
105      */
106     public ManagedRepository( String id, String name, String location, String layout, boolean snapshots,
107                               boolean releases, boolean blockRedeployments, String cronExpression, String indexDir,
108                               boolean scanned, int daysOlder, int retentionCount, boolean deleteReleasedSnapshots,
109                               boolean stageRepoNeeded, String description, boolean skipPackedIndexCreation )
110     {
111         this( id, name, location, layout, snapshots, releases, blockRedeployments, cronExpression, indexDir, scanned,
112               daysOlder, retentionCount, deleteReleasedSnapshots, stageRepoNeeded );
113         setDescription( description );
114         setSkipPackedIndexCreation( skipPackedIndexCreation );
115     }
116 
117     public String getCronExpression()
118     {
119         return cronExpression;
120     }
121 
122     public void setCronExpression( String cronExpression )
123     {
124         this.cronExpression = cronExpression;
125     }
126 
127     public String getLocation()
128     {
129         return this.location;
130     }
131 
132 
133     public boolean isReleases()
134     {
135         return this.releases;
136     }
137 
138     /**
139      * Get null
140      */
141     public boolean isSnapshots()
142     {
143         return this.snapshots;
144     }
145 
146 
147     public void setReleases( boolean releases )
148     {
149         this.releases = releases;
150     }
151 
152     public void setSnapshots( boolean snapshots )
153     {
154         this.snapshots = snapshots;
155     }
156 
157     public void setLocation( String location )
158     {
159         this.location = location;
160     }
161 
162     public boolean isBlockRedeployments()
163     {
164         return blockRedeployments;
165     }
166 
167     public void setBlockRedeployments( boolean blockRedeployments )
168     {
169         this.blockRedeployments = blockRedeployments;
170     }
171 
172 
173     public ManagedRepository getStagingRepository()
174     {
175         return stagingRepository;
176     }
177 
178 
179     public void setStagingRepository( ManagedRepository stagingRepository )
180     {
181         this.stagingRepository = stagingRepository;
182     }
183 
184     public boolean isScanned()
185     {
186         return scanned;
187     }
188 
189     public void setScanned( boolean scanned )
190     {
191         this.scanned = scanned;
192     }
193 
194 
195     public int getDaysOlder()
196     {
197         return daysOlder;
198     }
199 
200     public void setDaysOlder( int daysOlder )
201     {
202         this.daysOlder = daysOlder;
203     }
204 
205     public int getRetentionCount()
206     {
207         return retentionCount;
208     }
209 
210     public void setRetentionCount( int retentionCount )
211     {
212         this.retentionCount = retentionCount;
213     }
214 
215     public boolean isDeleteReleasedSnapshots()
216     {
217         return deleteReleasedSnapshots;
218     }
219 
220     public void setDeleteReleasedSnapshots( boolean deleteReleasedSnapshots )
221     {
222         this.deleteReleasedSnapshots = deleteReleasedSnapshots;
223     }
224 
225     public boolean isStageRepoNeeded()
226     {
227         return stageRepoNeeded;
228     }
229 
230     public void setStageRepoNeeded( boolean stageRepoNeeded )
231     {
232         this.stageRepoNeeded = stageRepoNeeded;
233     }
234 
235     public boolean isResetStats()
236     {
237         return resetStats;
238     }
239 
240     public void setResetStats( boolean resetStats )
241     {
242         this.resetStats = resetStats;
243     }
244 
245     public boolean isSkipPackedIndexCreation()
246     {
247         return skipPackedIndexCreation;
248     }
249 
250     public void setSkipPackedIndexCreation( boolean skipPackedIndexCreation )
251     {
252         this.skipPackedIndexCreation = skipPackedIndexCreation;
253     }
254 
255     @Override
256     public String toString()
257     {
258         final StringBuilder sb = new StringBuilder();
259         sb.append( super.toString() );
260         sb.append( "ManagedRepository" );
261         sb.append( "{location='" ).append( location ).append( '\'' );
262         sb.append( ", snapshots=" ).append( snapshots );
263         sb.append( ", releases=" ).append( releases );
264         sb.append( ", blockRedeployments=" ).append( blockRedeployments );
265         sb.append( ", cronExpression='" ).append( cronExpression ).append( '\'' );
266         sb.append( ", stagingRepository=" ).append( stagingRepository );
267         sb.append( ", scanned=" ).append( scanned );
268         sb.append( ", daysOlder=" ).append( daysOlder );
269         sb.append( ", retentionCount=" ).append( retentionCount );
270         sb.append( ", deleteReleasedSnapshots=" ).append( deleteReleasedSnapshots );
271         sb.append( ", stageRepoNeeded=" ).append( stageRepoNeeded );
272         sb.append( ", resetStats=" ).append( resetStats );
273         sb.append( ", skipPackedIndexCreation=" ).append( skipPackedIndexCreation );
274         sb.append( '}' );
275         return sb.toString();
276     }
277 
278 
279 }