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