1
2
3
4
5
6
7
8 package org.apache.maven.continuum.model.project;
9
10
11
12
13
14 import java.util.Collection;
15 import org.apache.continuum.model.project.ProjectScmRoot;
16 import org.apache.continuum.model.release.ContinuumReleaseResult;
17 import org.apache.continuum.model.repository.AbstractPurgeConfiguration;
18 import org.apache.continuum.model.repository.DirectoryPurgeConfiguration;
19 import org.apache.continuum.model.repository.LocalRepository;
20 import org.apache.continuum.model.repository.RepositoryPurgeConfiguration;
21 import org.apache.maven.continuum.model.scm.ChangeFile;
22 import org.apache.maven.continuum.model.scm.ChangeSet;
23 import org.apache.maven.continuum.model.scm.ScmResult;
24 import org.apache.maven.continuum.model.system.Installation;
25 import org.apache.maven.continuum.model.system.NotificationAddress;
26 import org.apache.maven.continuum.model.system.Profile;
27 import org.apache.maven.continuum.model.system.SystemConfiguration;
28 import org.apache.maven.continuum.project.ContinuumProjectState;
29
30
31
32
33
34
35 @SuppressWarnings( "all" )
36 public class Project
37 implements java.io.Serializable
38 {
39
40
41
42
43
44
45
46
47 private int id = 0;
48
49
50
51
52 private String groupId;
53
54
55
56
57 private String artifactId;
58
59
60
61
62 private String executorId;
63
64
65
66
67 private String name;
68
69
70
71
72 private String description;
73
74
75
76
77 private String url;
78
79
80
81
82 private String scmUrl;
83
84
85
86
87 private String scmTag;
88
89
90
91
92 private String scmUsername;
93
94
95
96
97 private String scmPassword;
98
99
100
101
102 private boolean scmUseCache = false;
103
104
105
106
107 private String version;
108
109
110
111
112 private int state = 1;
113
114
115
116
117 private int oldState = 0;
118
119
120
121
122 private int latestBuildId = 0;
123
124
125
126
127 private int buildNumber = 0;
128
129
130
131
132 private String workingDirectory;
133
134
135
136
137 private String relativePath;
138
139
140
141
142 private java.util.List<BuildResult> buildResults;
143
144
145
146
147 private ScmResult checkoutResult;
148
149
150
151
152 private java.util.List<ProjectDeveloper> developers;
153
154
155
156
157 private ProjectDependency parent;
158
159
160
161
162 private java.util.List<ProjectDependency> dependencies;
163
164
165
166
167 private ProjectGroup projectGroup;
168
169
170
171
172 private java.util.List<ProjectNotifier> notifiers;
173
174
175
176
177 private java.util.List<BuildDefinition> buildDefinitions;
178
179
180
181
182
183
184
185
186
187
188
189 public void addBuildDefinition( BuildDefinition buildDefinition )
190 {
191 getBuildDefinitions().add( buildDefinition );
192 }
193
194
195
196
197
198
199 public void addBuildResult( BuildResult buildResult )
200 {
201 getBuildResults().add( buildResult );
202 buildResult.createProjectAssociation( this );
203 }
204
205
206
207
208
209
210 public void addDependency( ProjectDependency projectDependency )
211 {
212 getDependencies().add( projectDependency );
213 }
214
215
216
217
218
219
220 public void addDeveloper( ProjectDeveloper projectDeveloper )
221 {
222 getDevelopers().add( projectDeveloper );
223 }
224
225
226
227
228
229
230 public void addNotifier( ProjectNotifier projectNotifier )
231 {
232 getNotifiers().add( projectNotifier );
233 }
234
235
236
237
238
239
240 public void breakBuildResultAssociation( BuildResult buildResult )
241 {
242 if ( ! getBuildResults().contains( buildResult ) )
243 {
244 throw new IllegalStateException( "buildResult isn't associated." );
245 }
246
247 getBuildResults().remove( buildResult );
248 }
249
250
251
252
253
254
255 public void breakProjectGroupAssociation( ProjectGroup projectGroup )
256 {
257 if ( this.projectGroup != projectGroup )
258 {
259 throw new IllegalStateException( "projectGroup isn't associated." );
260 }
261
262 this.projectGroup = null;
263 }
264
265
266
267
268
269
270 public void createBuildResultAssociation( BuildResult buildResult )
271 {
272 Collection buildResults = getBuildResults();
273
274 if ( buildResults.contains( buildResult ) )
275 {
276 throw new IllegalStateException( "buildResult is already assigned." );
277 }
278
279 buildResults.add( buildResult );
280 }
281
282
283
284
285
286
287 public void createProjectGroupAssociation( ProjectGroup projectGroup )
288 {
289 if ( this.projectGroup != null )
290 {
291 breakProjectGroupAssociation( this.projectGroup );
292 }
293
294 this.projectGroup = projectGroup;
295 }
296
297
298
299
300
301
302
303 public boolean equals( Object other )
304 {
305 if ( this == other )
306 {
307 return true;
308 }
309
310 if ( !( other instanceof Project ) )
311 {
312 return false;
313 }
314
315 Project that = (Project) other;
316 boolean result = true;
317
318 result = result && id == that.id;
319
320 return result;
321 }
322
323
324
325
326
327
328 public String getArtifactId()
329 {
330 return this.artifactId;
331 }
332
333
334
335
336
337
338 public java.util.List<BuildDefinition> getBuildDefinitions()
339 {
340 if ( this.buildDefinitions == null )
341 {
342 this.buildDefinitions = new java.util.ArrayList<BuildDefinition>();
343 }
344
345 return this.buildDefinitions;
346 }
347
348
349
350
351
352
353 public int getBuildNumber()
354 {
355 return this.buildNumber;
356 }
357
358
359
360
361
362
363 public java.util.List<BuildResult> getBuildResults()
364 {
365 if ( this.buildResults == null )
366 {
367 this.buildResults = new java.util.ArrayList<BuildResult>();
368 }
369
370 return this.buildResults;
371 }
372
373
374
375
376
377
378 public ScmResult getCheckoutResult()
379 {
380 return this.checkoutResult;
381 }
382
383
384
385
386
387
388 public java.util.List<ProjectDependency> getDependencies()
389 {
390 if ( this.dependencies == null )
391 {
392 this.dependencies = new java.util.ArrayList<ProjectDependency>();
393 }
394
395 return this.dependencies;
396 }
397
398
399
400
401
402
403 public String getDescription()
404 {
405 return this.description;
406 }
407
408
409
410
411
412
413 public java.util.List<ProjectDeveloper> getDevelopers()
414 {
415 if ( this.developers == null )
416 {
417 this.developers = new java.util.ArrayList<ProjectDeveloper>();
418 }
419
420 return this.developers;
421 }
422
423
424
425
426
427
428 public String getExecutorId()
429 {
430 return this.executorId;
431 }
432
433
434
435
436
437
438 public String getGroupId()
439 {
440 return this.groupId;
441 }
442
443
444
445
446
447
448 public int getId()
449 {
450 return this.id;
451 }
452
453
454
455
456
457
458 public int getLatestBuildId()
459 {
460 return this.latestBuildId;
461 }
462
463
464
465
466
467
468 public String getName()
469 {
470 return this.name;
471 }
472
473
474
475
476
477
478 public java.util.List<ProjectNotifier> getNotifiers()
479 {
480 if ( this.notifiers == null )
481 {
482 this.notifiers = new java.util.ArrayList<ProjectNotifier>();
483 }
484
485 return this.notifiers;
486 }
487
488
489
490
491
492
493 public int getOldState()
494 {
495 return this.oldState;
496 }
497
498
499
500
501
502
503 public ProjectDependency getParent()
504 {
505 return this.parent;
506 }
507
508
509
510
511
512
513 public ProjectGroup getProjectGroup()
514 {
515 return this.projectGroup;
516 }
517
518
519
520
521
522
523 public String getRelativePath()
524 {
525 return this.relativePath;
526 }
527
528
529
530
531
532
533 public String getScmPassword()
534 {
535 return this.scmPassword;
536 }
537
538
539
540
541
542
543 public String getScmTag()
544 {
545 return this.scmTag;
546 }
547
548
549
550
551
552
553 public String getScmUrl()
554 {
555 return this.scmUrl;
556 }
557
558
559
560
561
562
563 public String getScmUsername()
564 {
565 return this.scmUsername;
566 }
567
568
569
570
571
572
573 public int getState()
574 {
575 return this.state;
576 }
577
578
579
580
581
582
583 public String getUrl()
584 {
585 return this.url;
586 }
587
588
589
590
591
592
593 public String getVersion()
594 {
595 return this.version;
596 }
597
598
599
600
601
602
603 public String getWorkingDirectory()
604 {
605 return this.workingDirectory;
606 }
607
608
609
610
611
612
613 public int hashCode()
614 {
615 int result = 17;
616
617 result = 37 * result + (int) id;
618
619 return result;
620 }
621
622
623
624
625
626
627 public boolean isScmUseCache()
628 {
629 return this.scmUseCache;
630 }
631
632
633
634
635
636
637 public void removeBuildDefinition( BuildDefinition buildDefinition )
638 {
639 getBuildDefinitions().remove( buildDefinition );
640 }
641
642
643
644
645
646
647 public void removeBuildResult( BuildResult buildResult )
648 {
649 buildResult.breakProjectAssociation( this );
650 getBuildResults().remove( buildResult );
651 }
652
653
654
655
656
657
658 public void removeDependency( ProjectDependency projectDependency )
659 {
660 getDependencies().remove( projectDependency );
661 }
662
663
664
665
666
667
668 public void removeDeveloper( ProjectDeveloper projectDeveloper )
669 {
670 getDevelopers().remove( projectDeveloper );
671 }
672
673
674
675
676
677
678 public void removeNotifier( ProjectNotifier projectNotifier )
679 {
680 getNotifiers().remove( projectNotifier );
681 }
682
683
684
685
686
687
688 public void setArtifactId( String artifactId )
689 {
690 this.artifactId = artifactId;
691 }
692
693
694
695
696
697
698 public void setBuildDefinitions( java.util.List<BuildDefinition> buildDefinitions )
699 {
700 this.buildDefinitions = buildDefinitions;
701 }
702
703
704
705
706
707
708 public void setBuildNumber( int buildNumber )
709 {
710 this.buildNumber = buildNumber;
711 }
712
713
714
715
716
717
718 public void setBuildResults( java.util.List<BuildResult> buildResults )
719 {
720 this.buildResults = buildResults;
721 }
722
723
724
725
726
727
728 public void setCheckoutResult( ScmResult checkoutResult )
729 {
730 this.checkoutResult = checkoutResult;
731 }
732
733
734
735
736
737
738 public void setDependencies( java.util.List<ProjectDependency> dependencies )
739 {
740 this.dependencies = dependencies;
741 }
742
743
744
745
746
747
748 public void setDescription( String description )
749 {
750 this.description = description;
751 }
752
753
754
755
756
757
758 public void setDevelopers( java.util.List<ProjectDeveloper> developers )
759 {
760 this.developers = developers;
761 }
762
763
764
765
766
767
768 public void setExecutorId( String executorId )
769 {
770 this.executorId = executorId;
771 }
772
773
774
775
776
777
778 public void setGroupId( String groupId )
779 {
780 this.groupId = groupId;
781 }
782
783
784
785
786
787
788 public void setId( int id )
789 {
790 this.id = id;
791 }
792
793
794
795
796
797
798 public void setLatestBuildId( int latestBuildId )
799 {
800 this.latestBuildId = latestBuildId;
801 }
802
803
804
805
806
807
808 public void setName( String name )
809 {
810 this.name = name;
811 }
812
813
814
815
816
817
818 public void setNotifiers( java.util.List<ProjectNotifier> notifiers )
819 {
820 this.notifiers = notifiers;
821 }
822
823
824
825
826
827
828 public void setOldState( int oldState )
829 {
830 this.oldState = oldState;
831 }
832
833
834
835
836
837
838 public void setParent( ProjectDependency parent )
839 {
840 this.parent = parent;
841 }
842
843
844
845
846
847
848 public void setProjectGroup( ProjectGroup projectGroup )
849 {
850 if ( this.projectGroup != null )
851 {
852 this.projectGroup.breakProjectAssociation( this );
853 }
854
855 this.projectGroup = projectGroup;
856
857 if ( projectGroup != null )
858 {
859 this.projectGroup.createProjectAssociation( this );
860 }
861 }
862
863
864
865
866
867
868 public void setRelativePath( String relativePath )
869 {
870 this.relativePath = relativePath;
871 }
872
873
874
875
876
877
878 public void setScmPassword( String scmPassword )
879 {
880 this.scmPassword = scmPassword;
881 }
882
883
884
885
886
887
888 public void setScmTag( String scmTag )
889 {
890 this.scmTag = scmTag;
891 }
892
893
894
895
896
897
898 public void setScmUrl( String scmUrl )
899 {
900 this.scmUrl = scmUrl;
901 }
902
903
904
905
906
907
908 public void setScmUseCache( boolean scmUseCache )
909 {
910 this.scmUseCache = scmUseCache;
911 }
912
913
914
915
916
917
918 public void setScmUsername( String scmUsername )
919 {
920 this.scmUsername = scmUsername;
921 }
922
923
924
925
926
927
928 public void setState( int state )
929 {
930 this.state = state;
931 }
932
933
934
935
936
937
938 public void setUrl( String url )
939 {
940 this.url = url;
941 }
942
943
944
945
946
947
948 public void setVersion( String version )
949 {
950 this.version = version;
951 }
952
953
954
955
956
957
958 public void setWorkingDirectory( String workingDirectory )
959 {
960 this.workingDirectory = workingDirectory;
961 }
962
963
964
965
966
967
968 public java.lang.String toString()
969 {
970 StringBuilder buf = new StringBuilder( 128 );
971
972 buf.append( "id = '" );
973 buf.append( getId() );
974 buf.append( "'" );
975
976 return buf.toString();
977 }
978
979 }