View Javadoc
1   /*
2    Licensed to the Apache Software Foundation (ASF) under one
3    or more contributor license agreements.  See the NOTICE file
4    distributed with this work for additional information
5    regarding copyright ownership.  The ASF licenses this file
6    to you under the Apache License, Version 2.0 (the
7    "License"); you may not use this file except in compliance
8    with the License.  You may obtain a copy of the License at
9    
10       http://www.apache.org/licenses/LICENSE-2.0
11   
12   Unless required by applicable law or agreed to in writing,
13   software distributed under the License is distributed on an
14   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   KIND, either express or implied.  See the License for the
16   specific language governing permissions and limitations
17   under the License.
18   =================== DO NOT EDIT THIS FILE ====================
19   Generated by Modello 2.8.1,
20   any modifications will be overwritten.
21   ==============================================================
22   */
23  
24  package org.apache.maven.settings;
25  
26  /**
27   * 
28   *         
29   *         The <code>&lt;server&gt;</code> element contains
30   * informations required to a server settings.
31   *         
32   * 
33   * @version $Revision$ $Date$
34   */
35  @SuppressWarnings( "all" )
36  public class Server
37      extends IdentifiableBase
38      implements java.io.Serializable, java.lang.Cloneable
39  {
40  
41        //--------------------------/
42       //- Class/Member Variables -/
43      //--------------------------/
44  
45      /**
46       * 
47       *             
48       *             The username used to authenticate.
49       *             
50       *           
51       */
52      private String username;
53  
54      /**
55       * 
56       *             
57       *             The password used in conjunction with the
58       * username to authenticate.
59       *             
60       *           
61       */
62      private String password;
63  
64      /**
65       * 
66       *             
67       *             The private key location used to authenticate.
68       *             
69       *           
70       */
71      private String privateKey;
72  
73      /**
74       * 
75       *             
76       *             The passphrase used in conjunction with the
77       * privateKey to authenticate.
78       *             
79       *           
80       */
81      private String passphrase;
82  
83      /**
84       * 
85       *             
86       *             The permissions for files when they are created.
87       *             
88       *           
89       */
90      private String filePermissions;
91  
92      /**
93       * 
94       *             
95       *             The permissions for directories when they are
96       * created.
97       *             
98       *           
99       */
100     private String directoryPermissions;
101 
102     /**
103      * 
104      *             
105      *             Extra configuration for the transport layer.
106      *             
107      *           
108      */
109     private Object configuration;
110 
111     /**
112      * Field aliases.
113      */
114     private java.util.List<String> aliases;
115 
116     /**
117      * Field repositoryOrigins.
118      */
119     private java.util.List<String> repositoryOrigins;
120 
121 
122       //-----------/
123      //- Methods -/
124     //-----------/
125 
126     /**
127      * Method addAlias.
128      * 
129      * @param string a string object.
130      */
131     public void addAlias( String string )
132     {
133         getAliases().add( string );
134     } //-- void addAlias( String )
135 
136     /**
137      * Method addRepositoryOrigin.
138      * 
139      * @param string a string object.
140      */
141     public void addRepositoryOrigin( String string )
142     {
143         getRepositoryOrigins().add( string );
144     } //-- void addRepositoryOrigin( String )
145 
146     /**
147      * Method clone.
148      * 
149      * @return Server
150      */
151     public Server clone()
152     {
153         try
154         {
155             Server copy = (Server) super.clone();
156 
157             if ( this.configuration != null )
158             {
159                 copy.configuration = new org.codehaus.plexus.util.xml.Xpp3Dom( (org.codehaus.plexus.util.xml.Xpp3Dom) this.configuration );
160             }
161 
162             if ( this.aliases != null )
163             {
164                 copy.aliases = new java.util.ArrayList<String>();
165                 copy.aliases.addAll( this.aliases );
166             }
167 
168             if ( this.repositoryOrigins != null )
169             {
170                 copy.repositoryOrigins = new java.util.ArrayList<String>();
171                 copy.repositoryOrigins.addAll( this.repositoryOrigins );
172             }
173 
174             return copy;
175         }
176         catch ( java.lang.Exception ex )
177         {
178             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
179                 + " does not support clone()" ).initCause( ex );
180         }
181     } //-- Server clone()
182 
183     /**
184      * Method getAliases.
185      * 
186      * @return List
187      */
188     public java.util.List<String> getAliases()
189     {
190         if ( this.aliases == null )
191         {
192             this.aliases = new java.util.ArrayList<String>();
193         }
194 
195         return this.aliases;
196     } //-- java.util.List<String> getAliases()
197 
198     /**
199      * Get extra configuration for the transport layer.
200      * 
201      * @return Object
202      */
203     public Object getConfiguration()
204     {
205         return this.configuration;
206     } //-- Object getConfiguration()
207 
208     /**
209      * Get the permissions for directories when they are created.
210      * 
211      * @return String
212      */
213     public String getDirectoryPermissions()
214     {
215         return this.directoryPermissions;
216     } //-- String getDirectoryPermissions()
217 
218     /**
219      * Get the permissions for files when they are created.
220      * 
221      * @return String
222      */
223     public String getFilePermissions()
224     {
225         return this.filePermissions;
226     } //-- String getFilePermissions()
227 
228     /**
229      * Get the passphrase used in conjunction with the privateKey
230      * to authenticate.
231      * 
232      * @return String
233      */
234     public String getPassphrase()
235     {
236         return this.passphrase;
237     } //-- String getPassphrase()
238 
239     /**
240      * Get the password used in conjunction with the username to
241      * authenticate.
242      * 
243      * @return String
244      */
245     public String getPassword()
246     {
247         return this.password;
248     } //-- String getPassword()
249 
250     /**
251      * Get the private key location used to authenticate.
252      * 
253      * @return String
254      */
255     public String getPrivateKey()
256     {
257         return this.privateKey;
258     } //-- String getPrivateKey()
259 
260     /**
261      * Method getRepositoryOrigins.
262      * 
263      * @return List
264      */
265     public java.util.List<String> getRepositoryOrigins()
266     {
267         if ( this.repositoryOrigins == null )
268         {
269             this.repositoryOrigins = new java.util.ArrayList<String>();
270         }
271 
272         return this.repositoryOrigins;
273     } //-- java.util.List<String> getRepositoryOrigins()
274 
275     /**
276      * Get the username used to authenticate.
277      * 
278      * @return String
279      */
280     public String getUsername()
281     {
282         return this.username;
283     } //-- String getUsername()
284 
285     /**
286      * Method removeAlias.
287      * 
288      * @param string a string object.
289      */
290     public void removeAlias( String string )
291     {
292         getAliases().remove( string );
293     } //-- void removeAlias( String )
294 
295     /**
296      * Method removeRepositoryOrigin.
297      * 
298      * @param string a string object.
299      */
300     public void removeRepositoryOrigin( String string )
301     {
302         getRepositoryOrigins().remove( string );
303     } //-- void removeRepositoryOrigin( String )
304 
305     /**
306      * Set list of additional server aliases. For each alias, an
307      * additional server entry will be generated
308      *             with the same configuration as the original one,
309      * but with the ID replaced by the alias
310      *             and with an empty aliases list.
311      *             This is useful when the same credentials should
312      * be used for multiple servers.
313      * 
314      * @param aliases a aliases object.
315      */
316     public void setAliases( java.util.List<String> aliases )
317     {
318         this.aliases = aliases;
319     } //-- void setAliases( java.util.List )
320 
321     /**
322      * Set extra configuration for the transport layer.
323      * 
324      * @param configuration a configuration object.
325      */
326     public void setConfiguration( Object configuration )
327     {
328         this.configuration = configuration;
329     } //-- void setConfiguration( Object )
330 
331     /**
332      * Set the permissions for directories when they are created.
333      * 
334      * @param directoryPermissions a directoryPermissions object.
335      */
336     public void setDirectoryPermissions( String directoryPermissions )
337     {
338         this.directoryPermissions = directoryPermissions;
339     } //-- void setDirectoryPermissions( String )
340 
341     /**
342      * Set the permissions for files when they are created.
343      * 
344      * @param filePermissions a filePermissions object.
345      */
346     public void setFilePermissions( String filePermissions )
347     {
348         this.filePermissions = filePermissions;
349     } //-- void setFilePermissions( String )
350 
351     /**
352      * Set the passphrase used in conjunction with the privateKey
353      * to authenticate.
354      * 
355      * @param passphrase a passphrase object.
356      */
357     public void setPassphrase( String passphrase )
358     {
359         this.passphrase = passphrase;
360     } //-- void setPassphrase( String )
361 
362     /**
363      * Set the password used in conjunction with the username to
364      * authenticate.
365      * 
366      * @param password a password object.
367      */
368     public void setPassword( String password )
369     {
370         this.password = password;
371     } //-- void setPassword( String )
372 
373     /**
374      * Set the private key location used to authenticate.
375      * 
376      * @param privateKey a privateKey object.
377      */
378     public void setPrivateKey( String privateKey )
379     {
380         this.privateKey = privateKey;
381     } //-- void setPrivateKey( String )
382 
383     /**
384      * Set list of repository origins these credentials may be used
385      * with, each written as
386      *             {@code scheme://host} or {@code
387      * scheme://host:port}, for example {@code
388      * https://repo.example.org}
389      *             or {@code https://mirror.example.org:8443} - an
390      * origin, not a full repository URL.
391      *             Maven binds the credentials of a server to the
392      * origins of the repositories and mirrors declared
393      *             with the same id, see the {@code
394      * maven.repository.credentialScope} user property. The origins
395      *             listed here are added to those; nothing is
396      * replaced. Declaring them is needed when the repository
397      *             using these credentials is not known when the
398      * session is created, for example a repository
399      *             declared in a {@code settings.xml} profile that
400      * is not listed in {@code <activeProfiles>}
401      *             but activated through {@code <activation>} or
402      * {@code -P}.
403      *             Comparison is case insensitive and the default
404      * ports 80 (http) and 443 (https) are equivalent to
405      *             no port.
406      * 
407      * @param repositoryOrigins a repositoryOrigins object.
408      */
409     public void setRepositoryOrigins( java.util.List<String> repositoryOrigins )
410     {
411         this.repositoryOrigins = repositoryOrigins;
412     } //-- void setRepositoryOrigins( java.util.List )
413 
414     /**
415      * Set the username used to authenticate.
416      * 
417      * @param username a username object.
418      */
419     public void setUsername( String username )
420     {
421         this.username = username;
422     } //-- void setUsername( String )
423 
424 }