1 // =================== DO NOT EDIT THIS FILE ====================
2 // Generated by Modello 1.7,
3 // any modifications will be overwritten.
4 // ==============================================================
5
6 package org.apache.archiva.configuration;
7
8 /**
9 * Class AbstractRepositoryConnectorConfiguration.
10 *
11 * @version $Revision$ $Date$
12 */
13 @SuppressWarnings( "all" )
14 public class AbstractRepositoryConnectorConfiguration
15 implements java.io.Serializable
16 {
17
18 //--------------------------/
19 //- Class/Member Variables -/
20 //--------------------------/
21
22 /**
23 *
24 * The Repository Source for this connector.
25 *
26 */
27 private String sourceRepoId;
28
29 /**
30 *
31 * The Repository Target for this connector.
32 *
33 */
34 private String targetRepoId;
35
36 /**
37 *
38 * The network proxy ID to use for this connector.
39 *
40 */
41 private String proxyId;
42
43 /**
44 * Field blackListPatterns.
45 */
46 private java.util.List<String> blackListPatterns;
47
48 /**
49 * Field whiteListPatterns.
50 */
51 private java.util.List<String> whiteListPatterns;
52
53 /**
54 * Field policies.
55 */
56 private java.util.Map policies;
57
58 /**
59 * Field properties.
60 */
61 private java.util.Map properties;
62
63 /**
64 *
65 * If the the repository proxy connector is
66 * disabled or not
67 * .
68 */
69 private boolean disabled = false;
70
71
72 //-----------/
73 //- Methods -/
74 //-----------/
75
76 /**
77 * Method addBlackListPattern.
78 *
79 * @param string
80 */
81 public void addBlackListPattern( String string )
82 {
83 getBlackListPatterns().add( string );
84 } //-- void addBlackListPattern( String )
85
86 /**
87 * Method addPolicy.
88 *
89 * @param key
90 * @param value
91 */
92 public void addPolicy( Object key, String value )
93 {
94 getPolicies().put( key, value );
95 } //-- void addPolicy( Object, String )
96
97 /**
98 * Method addProperty.
99 *
100 * @param key
101 * @param value
102 */
103 public void addProperty( Object key, String value )
104 {
105 getProperties().put( key, value );
106 } //-- void addProperty( Object, String )
107
108 /**
109 * Method addWhiteListPattern.
110 *
111 * @param string
112 */
113 public void addWhiteListPattern( String string )
114 {
115 getWhiteListPatterns().add( string );
116 } //-- void addWhiteListPattern( String )
117
118 /**
119 * Method getBlackListPatterns.
120 *
121 * @return List
122 */
123 public java.util.List<String> getBlackListPatterns()
124 {
125 if ( this.blackListPatterns == null )
126 {
127 this.blackListPatterns = new java.util.ArrayList<String>();
128 }
129
130 return this.blackListPatterns;
131 } //-- java.util.List<String> getBlackListPatterns()
132
133 /**
134 * Method getPolicies.
135 *
136 * @return Map
137 */
138 public java.util.Map getPolicies()
139 {
140 if ( this.policies == null )
141 {
142 this.policies = new java.util.HashMap();
143 }
144
145 return this.policies;
146 } //-- java.util.Map getPolicies()
147
148 /**
149 * Method getProperties.
150 *
151 * @return Map
152 */
153 public java.util.Map getProperties()
154 {
155 if ( this.properties == null )
156 {
157 this.properties = new java.util.HashMap();
158 }
159
160 return this.properties;
161 } //-- java.util.Map getProperties()
162
163 /**
164 * Get the network proxy ID to use for this connector.
165 *
166 * @return String
167 */
168 public String getProxyId()
169 {
170 return this.proxyId;
171 } //-- String getProxyId()
172
173 /**
174 * Get the Repository Source for this connector.
175 *
176 * @return String
177 */
178 public String getSourceRepoId()
179 {
180 return this.sourceRepoId;
181 } //-- String getSourceRepoId()
182
183 /**
184 * Get the Repository Target for this connector.
185 *
186 * @return String
187 */
188 public String getTargetRepoId()
189 {
190 return this.targetRepoId;
191 } //-- String getTargetRepoId()
192
193 /**
194 * Method getWhiteListPatterns.
195 *
196 * @return List
197 */
198 public java.util.List<String> getWhiteListPatterns()
199 {
200 if ( this.whiteListPatterns == null )
201 {
202 this.whiteListPatterns = new java.util.ArrayList<String>();
203 }
204
205 return this.whiteListPatterns;
206 } //-- java.util.List<String> getWhiteListPatterns()
207
208 /**
209 * Get if the the repository proxy connector is disabled or
210 * not.
211 *
212 * @return boolean
213 */
214 public boolean isDisabled()
215 {
216 return this.disabled;
217 } //-- boolean isDisabled()
218
219 /**
220 * Method removeBlackListPattern.
221 *
222 * @param string
223 */
224 public void removeBlackListPattern( String string )
225 {
226 getBlackListPatterns().remove( string );
227 } //-- void removeBlackListPattern( String )
228
229 /**
230 * Method removeWhiteListPattern.
231 *
232 * @param string
233 */
234 public void removeWhiteListPattern( String string )
235 {
236 getWhiteListPatterns().remove( string );
237 } //-- void removeWhiteListPattern( String )
238
239 /**
240 * Set the list of blacklisted patterns for this connector.
241 *
242 * @param blackListPatterns
243 */
244 public void setBlackListPatterns( java.util.List<String> blackListPatterns )
245 {
246 this.blackListPatterns = blackListPatterns;
247 } //-- void setBlackListPatterns( java.util.List )
248
249 /**
250 * Set if the the repository proxy connector is disabled or
251 * not.
252 *
253 * @param disabled
254 */
255 public void setDisabled( boolean disabled )
256 {
257 this.disabled = disabled;
258 } //-- void setDisabled( boolean )
259
260 /**
261 * Set policy configuration for the connector.
262 *
263 * @param policies
264 */
265 public void setPolicies( java.util.Map policies )
266 {
267 this.policies = policies;
268 } //-- void setPolicies( java.util.Map )
269
270 /**
271 * Set configuration for the connector.
272 *
273 * @param properties
274 */
275 public void setProperties( java.util.Map properties )
276 {
277 this.properties = properties;
278 } //-- void setProperties( java.util.Map )
279
280 /**
281 * Set the network proxy ID to use for this connector.
282 *
283 * @param proxyId
284 */
285 public void setProxyId( String proxyId )
286 {
287 this.proxyId = proxyId;
288 } //-- void setProxyId( String )
289
290 /**
291 * Set the Repository Source for this connector.
292 *
293 * @param sourceRepoId
294 */
295 public void setSourceRepoId( String sourceRepoId )
296 {
297 this.sourceRepoId = sourceRepoId;
298 } //-- void setSourceRepoId( String )
299
300 /**
301 * Set the Repository Target for this connector.
302 *
303 * @param targetRepoId
304 */
305 public void setTargetRepoId( String targetRepoId )
306 {
307 this.targetRepoId = targetRepoId;
308 } //-- void setTargetRepoId( String )
309
310 /**
311 * Set the list of whitelisted patterns for this connector.
312 *
313 * @param whiteListPatterns
314 */
315 public void setWhiteListPatterns( java.util.List<String> whiteListPatterns )
316 {
317 this.whiteListPatterns = whiteListPatterns;
318 } //-- void setWhiteListPatterns( java.util.List )
319
320
321 /**
322 * Obtain a specific policy from the underlying connector.
323 *
324 * @param policyId the policy id to fetch.
325 * @param defaultValue the default value for the policy id.
326 * @return the configured policy value (or default value if not found).
327 */
328 public String getPolicy( String policyId, String defaultValue )
329 {
330 if ( this.getPolicies() == null )
331 {
332 return null;
333 }
334
335 Object value = this.getPolicies().get( policyId );
336
337 if ( value == null )
338 {
339 return defaultValue;
340 }
341
342 return (String) value;
343 }
344
345 }