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