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.4.0,
20   any modifications will be overwritten.
21   ==============================================================
22   */
23  
24  package org.apache.maven.model;
25  
26  /**
27   * This elements describes all that pertains to distribution for a
28   * project. It is
29   *         primarily used for deployment of artifacts and the site
30   * produced by the build.
31   * 
32   * @version $Revision$ $Date$
33   */
34  @SuppressWarnings( "all" )
35  public class DistributionManagement
36      implements java.io.Serializable, java.lang.Cloneable, org.apache.maven.model.InputLocationTracker
37  {
38  
39        //--------------------------/
40       //- Class/Member Variables -/
41      //--------------------------/
42  
43      /**
44       * Information needed to deploy the artifacts generated by the
45       * project to a
46       *             remote repository.
47       */
48      private DeploymentRepository repository;
49  
50      /**
51       * 
52       *             
53       *             Where to deploy snapshots of artifacts to. If
54       * not given, it defaults to the
55       *             <code>repository</code> element.
56       *             
57       *           
58       */
59      private DeploymentRepository snapshotRepository;
60  
61      /**
62       * Information needed for deploying the web site of the project.
63       */
64      private Site site;
65  
66      /**
67       * 
68       *             
69       *             The URL of the project's download page. If not
70       * given users will be
71       *             referred to the homepage given by
72       * <code>url</code>.
73       *             This is given to assist in locating artifacts
74       * that are not in the repository due to
75       *             licensing restrictions.
76       *             
77       *           
78       */
79      private String downloadUrl;
80  
81      /**
82       * Relocation information of the artifact if it has been moved
83       * to a new group ID
84       *             and/or artifact ID.
85       */
86      private Relocation relocation;
87  
88      /**
89       * 
90       *             
91       *             Gives the status of this artifact in the remote
92       * repository.
93       *             This must not be set in your local project, as
94       * it is updated by
95       *             tools placing it in the reposiory. Valid values
96       * are: <code>none</code> (default),
97       *             <code>converted</code> (repository manager
98       * converted this from an Maven 1 POM),
99       *             <code>partner</code>
100      *             (directly synced from a partner Maven 2
101      * repository), <code>deployed</code> (was deployed from a
102      * Maven 2
103      *             instance), <code>verified</code> (has been hand
104      * verified as correct and final).
105      *             
106      *           
107      */
108     private String status;
109 
110     /**
111      * Field locations.
112      */
113     private java.util.Map<Object, InputLocation> locations;
114 
115     /**
116      * Field location.
117      */
118     private InputLocation location;
119 
120     /**
121      * Field repositoryLocation.
122      */
123     private InputLocation repositoryLocation;
124 
125     /**
126      * Field snapshotRepositoryLocation.
127      */
128     private InputLocation snapshotRepositoryLocation;
129 
130     /**
131      * Field siteLocation.
132      */
133     private InputLocation siteLocation;
134 
135     /**
136      * Field downloadUrlLocation.
137      */
138     private InputLocation downloadUrlLocation;
139 
140     /**
141      * Field relocationLocation.
142      */
143     private InputLocation relocationLocation;
144 
145     /**
146      * Field statusLocation.
147      */
148     private InputLocation statusLocation;
149 
150 
151       //-----------/
152      //- Methods -/
153     //-----------/
154 
155     /**
156      * Method clone.
157      * 
158      * @return DistributionManagement
159      */
160     public DistributionManagement clone()
161     {
162         try
163         {
164             DistributionManagement copy = (DistributionManagement) super.clone();
165 
166             if ( this.repository != null )
167             {
168                 copy.repository = (DeploymentRepository) this.repository.clone();
169             }
170 
171             if ( this.snapshotRepository != null )
172             {
173                 copy.snapshotRepository = (DeploymentRepository) this.snapshotRepository.clone();
174             }
175 
176             if ( this.site != null )
177             {
178                 copy.site = (Site) this.site.clone();
179             }
180 
181             if ( this.relocation != null )
182             {
183                 copy.relocation = (Relocation) this.relocation.clone();
184             }
185 
186             if ( copy.locations != null )
187             {
188                 copy.locations = new java.util.LinkedHashMap( copy.locations );
189             }
190 
191             return copy;
192         }
193         catch ( java.lang.Exception ex )
194         {
195             throw (java.lang.RuntimeException) new java.lang.UnsupportedOperationException( getClass().getName()
196                 + " does not support clone()" ).initCause( ex );
197         }
198     } //-- DistributionManagement clone()
199 
200     /**
201      * Get the URL of the project's download page. If not given
202      * users will be
203      *             referred to the homepage given by
204      * <code>url</code>.
205      *             This is given to assist in locating artifacts
206      * that are not in the repository due to
207      *             licensing restrictions.
208      * 
209      * @return String
210      */
211     public String getDownloadUrl()
212     {
213         return this.downloadUrl;
214     } //-- String getDownloadUrl()
215 
216     /**
217      * 
218      * 
219      * @param key a key object.
220      * @return InputLocation
221      */
222     public InputLocation getLocation( Object key )
223     {
224         if ( key instanceof String )
225         {
226             switch ( ( String ) key )
227             {
228                 case "" :
229                 {
230                     return this.location;
231                 }
232                 case "repository" :
233                 {
234                     return repositoryLocation;
235                 }
236                 case "snapshotRepository" :
237                 {
238                     return snapshotRepositoryLocation;
239                 }
240                 case "site" :
241                 {
242                     return siteLocation;
243                 }
244                 case "downloadUrl" :
245                 {
246                     return downloadUrlLocation;
247                 }
248                 case "relocation" :
249                 {
250                     return relocationLocation;
251                 }
252                 case "status" :
253                 {
254                     return statusLocation;
255                 }
256                 default :
257                 {
258                     return getOtherLocation( key );
259                 }
260                 }
261             }
262             else
263             {
264                 return getOtherLocation( key );
265             }
266     } //-- InputLocation getLocation( Object )
267 
268     /**
269      * 
270      * 
271      * @param key a key object.
272      * @param location a location object.
273      */
274     public void setLocation( Object key, InputLocation location )
275     {
276         if ( key instanceof String )
277         {
278             switch ( ( String ) key )
279             {
280                 case "" :
281                 {
282                     this.location = location;
283                     return;
284                 }
285                 case "repository" :
286                 {
287                     repositoryLocation = location;
288                     return;
289                 }
290                 case "snapshotRepository" :
291                 {
292                     snapshotRepositoryLocation = location;
293                     return;
294                 }
295                 case "site" :
296                 {
297                     siteLocation = location;
298                     return;
299                 }
300                 case "downloadUrl" :
301                 {
302                     downloadUrlLocation = location;
303                     return;
304                 }
305                 case "relocation" :
306                 {
307                     relocationLocation = location;
308                     return;
309                 }
310                 case "status" :
311                 {
312                     statusLocation = location;
313                     return;
314                 }
315                 default :
316                 {
317                     setOtherLocation( key, location );
318                     return;
319                 }
320             }
321         }
322         else
323         {
324             setOtherLocation( key, location );
325         }
326     } //-- void setLocation( Object, InputLocation )
327 
328     /**
329      * 
330      * 
331      * @param key a key object.
332      * @param location a location object.
333      */
334     public void setOtherLocation( Object key, InputLocation location )
335     {
336         if ( location != null )
337         {
338             if ( this.locations == null )
339             {
340                 this.locations = new java.util.LinkedHashMap<Object, InputLocation>();
341             }
342             this.locations.put( key, location );
343         }
344     } //-- void setOtherLocation( Object, InputLocation )
345 
346     /**
347      * 
348      * 
349      * @param key a key object.
350      * @return InputLocation
351      */
352     private InputLocation getOtherLocation( Object key )
353     {
354         return ( locations != null ) ? locations.get( key ) : null;
355     } //-- InputLocation getOtherLocation( Object )
356 
357     /**
358      * Get relocation information of the artifact if it has been
359      * moved to a new group ID
360      *             and/or artifact ID.
361      * 
362      * @return Relocation
363      */
364     public Relocation getRelocation()
365     {
366         return this.relocation;
367     } //-- Relocation getRelocation()
368 
369     /**
370      * Get information needed to deploy the artifacts generated by
371      * the project to a
372      *             remote repository.
373      * 
374      * @return DeploymentRepository
375      */
376     public DeploymentRepository getRepository()
377     {
378         return this.repository;
379     } //-- DeploymentRepository getRepository()
380 
381     /**
382      * Get information needed for deploying the web site of the
383      * project.
384      * 
385      * @return Site
386      */
387     public Site getSite()
388     {
389         return this.site;
390     } //-- Site getSite()
391 
392     /**
393      * Get where to deploy snapshots of artifacts to. If not given,
394      * it defaults to the
395      *             <code>repository</code> element.
396      * 
397      * @return DeploymentRepository
398      */
399     public DeploymentRepository getSnapshotRepository()
400     {
401         return this.snapshotRepository;
402     } //-- DeploymentRepository getSnapshotRepository()
403 
404     /**
405      * Get gives the status of this artifact in the remote
406      * repository.
407      *             This must not be set in your local project, as
408      * it is updated by
409      *             tools placing it in the reposiory. Valid values
410      * are: <code>none</code> (default),
411      *             <code>converted</code> (repository manager
412      * converted this from an Maven 1 POM),
413      *             <code>partner</code>
414      *             (directly synced from a partner Maven 2
415      * repository), <code>deployed</code> (was deployed from a
416      * Maven 2
417      *             instance), <code>verified</code> (has been hand
418      * verified as correct and final).
419      * 
420      * @return String
421      */
422     public String getStatus()
423     {
424         return this.status;
425     } //-- String getStatus()
426 
427     /**
428      * Set the URL of the project's download page. If not given
429      * users will be
430      *             referred to the homepage given by
431      * <code>url</code>.
432      *             This is given to assist in locating artifacts
433      * that are not in the repository due to
434      *             licensing restrictions.
435      * 
436      * @param downloadUrl a downloadUrl object.
437      */
438     public void setDownloadUrl( String downloadUrl )
439     {
440         this.downloadUrl = downloadUrl;
441     } //-- void setDownloadUrl( String )
442 
443     /**
444      * Set relocation information of the artifact if it has been
445      * moved to a new group ID
446      *             and/or artifact ID.
447      * 
448      * @param relocation a relocation object.
449      */
450     public void setRelocation( Relocation relocation )
451     {
452         this.relocation = relocation;
453     } //-- void setRelocation( Relocation )
454 
455     /**
456      * Set information needed to deploy the artifacts generated by
457      * the project to a
458      *             remote repository.
459      * 
460      * @param repository a repository object.
461      */
462     public void setRepository( DeploymentRepository repository )
463     {
464         this.repository = repository;
465     } //-- void setRepository( DeploymentRepository )
466 
467     /**
468      * Set information needed for deploying the web site of the
469      * project.
470      * 
471      * @param site a site object.
472      */
473     public void setSite( Site site )
474     {
475         this.site = site;
476     } //-- void setSite( Site )
477 
478     /**
479      * Set where to deploy snapshots of artifacts to. If not given,
480      * it defaults to the
481      *             <code>repository</code> element.
482      * 
483      * @param snapshotRepository a snapshotRepository object.
484      */
485     public void setSnapshotRepository( DeploymentRepository snapshotRepository )
486     {
487         this.snapshotRepository = snapshotRepository;
488     } //-- void setSnapshotRepository( DeploymentRepository )
489 
490     /**
491      * Set gives the status of this artifact in the remote
492      * repository.
493      *             This must not be set in your local project, as
494      * it is updated by
495      *             tools placing it in the reposiory. Valid values
496      * are: <code>none</code> (default),
497      *             <code>converted</code> (repository manager
498      * converted this from an Maven 1 POM),
499      *             <code>partner</code>
500      *             (directly synced from a partner Maven 2
501      * repository), <code>deployed</code> (was deployed from a
502      * Maven 2
503      *             instance), <code>verified</code> (has been hand
504      * verified as correct and final).
505      * 
506      * @param status a status object.
507      */
508     public void setStatus( String status )
509     {
510         this.status = status;
511     } //-- void setStatus( String )
512 
513 }