This project has retired. For details please refer to its Attic page.
RepositoryGroupConfiguration xref
View Javadoc
1   package org.apache.archiva.configuration;
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 java.io.Serializable;
23  import java.util.ArrayList;
24  import java.util.List;
25  
26  /**
27   * Class RepositoryGroupConfiguration.
28   * 
29   * @version $Revision$ $Date$
30   */
31  @SuppressWarnings( "all" )
32  public class RepositoryGroupConfiguration
33      implements Serializable
34  {
35  
36        //--------------------------/
37       //- Class/Member Variables -/
38      //--------------------------/
39  
40      /**
41       * The id of the repository group.
42       */
43      private String id;
44  
45      /**
46       * The name of the repository group
47       */
48      private String name;
49  
50      /**
51       *
52       *             The repository type. Currently only MAVEN type
53       * is known.
54       *
55       */
56      private String type = "MAVEN";
57  
58  
59      /**
60       * The path of the merged index.
61       */
62      private String mergedIndexPath = ".indexer";
63  
64      /**
65       * The time to live of the merged index of the repository group.
66       */
67      private int mergedIndexTtl = 30;
68  
69      /**
70       * 
71       *           When to run the index merging for this group.
72       *
73       */
74      private String cronExpression = "";
75  
76      /**
77       * Field repositories.
78       */
79      private List<String> repositories;
80  
81  
82        //-----------/
83       //- Methods -/
84      //-----------/
85  
86      /**
87       * Method addRepository.
88       * 
89       * @param string
90       */
91      public void addRepository( String string )
92      {
93          getRepositories().add( string );
94      } //-- void addRepository( String )
95  
96      /**
97       * Get when to run the index merging for this group.
98       *           No default value.
99       * 
100      * @return String
101      */
102     public String getCronExpression()
103     {
104         return this.cronExpression;
105     } //-- String getCronExpression()
106 
107     /**
108      * Get the id of the repository group.
109      * 
110      * @return String
111      */
112     public String getId()
113     {
114         return this.id;
115     } //-- String getId()
116 
117     /**
118      * Get the path of the merged index.
119      * 
120      * @return String
121      */
122     public String getMergedIndexPath()
123     {
124         return this.mergedIndexPath;
125     } //-- String getMergedIndexPath()
126 
127     /**
128      * Get the time to live of the merged index of the repository
129      * group.
130      * 
131      * @return int
132      */
133     public int getMergedIndexTtl()
134     {
135         return this.mergedIndexTtl;
136     } //-- int getMergedIndexTtl()
137 
138     /**
139      * Method getRepositories.
140      * 
141      * @return List
142      */
143     public List<String> getRepositories()
144     {
145         if ( this.repositories == null )
146         {
147             this.repositories = new ArrayList<String>();
148         }
149 
150         return this.repositories;
151     } //-- java.util.List<String> getRepositories()
152 
153     /**
154      * Method removeRepository.
155      * 
156      * @param string
157      */
158     public void removeRepository( String string )
159     {
160         getRepositories().remove( string );
161     } //-- void removeRepository( String )
162 
163     /**
164      * Set when to run the index merging for this group.
165      *           No default value.
166      * 
167      * @param cronExpression
168      */
169     public void setCronExpression( String cronExpression )
170     {
171         this.cronExpression = cronExpression;
172     } //-- void setCronExpression( String )
173 
174     /**
175      * Set the id of the repository group.
176      * 
177      * @param id
178      */
179     public void setId( String id )
180     {
181         this.id = id;
182     } //-- void setId( String )
183 
184     /**
185      * Set the path of the merged index.
186      * 
187      * @param mergedIndexPath
188      */
189     public void setMergedIndexPath( String mergedIndexPath )
190     {
191         this.mergedIndexPath = mergedIndexPath;
192     } //-- void setMergedIndexPath( String )
193 
194     /**
195      * Set the time to live of the merged index of the repository
196      * group.
197      * 
198      * @param mergedIndexTtl
199      */
200     public void setMergedIndexTtl( int mergedIndexTtl )
201     {
202         this.mergedIndexTtl = mergedIndexTtl;
203     } //-- void setMergedIndexTtl( int )
204 
205     /**
206      * Set the list of repository ids under the group.
207      * 
208      * @param repositories
209      */
210     public void setRepositories( List<String> repositories )
211     {
212         this.repositories = repositories;
213     } //-- void setRepositories( java.util.List )
214 
215     public String getName() {
216         return name;
217     }
218 
219     public void setName(String name) {
220         this.name = name;
221     }
222 
223     public String getType() {
224         return type;
225     }
226 
227     public void setType(String type) {
228         this.type = type;
229     }
230 }