1 package org.apache.maven.continuum;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.continuum.buildagent.NoBuildAgentException;
23 import org.apache.continuum.buildagent.NoBuildAgentInGroupException;
24 import org.apache.continuum.builder.distributed.manager.DistributedBuildManager;
25 import org.apache.continuum.buildmanager.BuildsManager;
26 import org.apache.continuum.model.project.ProjectGroupSummary;
27 import org.apache.continuum.model.project.ProjectScmRoot;
28 import org.apache.continuum.model.release.ContinuumReleaseResult;
29 import org.apache.continuum.purge.ContinuumPurgeManager;
30 import org.apache.continuum.purge.PurgeConfigurationService;
31 import org.apache.continuum.release.distributed.manager.DistributedReleaseManager;
32 import org.apache.continuum.repository.RepositoryService;
33 import org.apache.continuum.taskqueue.manager.TaskQueueManager;
34 import org.apache.continuum.utils.build.BuildTrigger;
35 import org.apache.maven.continuum.builddefinition.BuildDefinitionService;
36 import org.apache.maven.continuum.configuration.ConfigurationService;
37 import org.apache.maven.continuum.installation.InstallationService;
38 import org.apache.maven.continuum.model.project.BuildDefinition;
39 import org.apache.maven.continuum.model.project.BuildQueue;
40 import org.apache.maven.continuum.model.project.BuildResult;
41 import org.apache.maven.continuum.model.project.Project;
42 import org.apache.maven.continuum.model.project.ProjectGroup;
43 import org.apache.maven.continuum.model.project.ProjectNotifier;
44 import org.apache.maven.continuum.model.project.Schedule;
45 import org.apache.maven.continuum.model.scm.ChangeSet;
46 import org.apache.maven.continuum.profile.ProfileService;
47 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
48 import org.apache.maven.continuum.release.ContinuumReleaseManager;
49
50 import java.io.File;
51 import java.util.Collection;
52 import java.util.Date;
53 import java.util.List;
54 import java.util.Map;
55
56
57
58
59
60
61 public interface Continuum
62 {
63 String ROLE = Continuum.class.getName();
64
65
66
67
68
69 public ProjectGroup getProjectGroup( int projectGroupId )
70 throws ContinuumException;
71
72 public List<ProjectGroup> getAllProjectGroupsWithBuildDetails();
73
74 public List<ProjectGroup> getAllProjectGroups();
75
76 public ProjectGroup getProjectGroupByProjectId( int projectId )
77 throws ContinuumException;
78
79 public Collection<Project> getProjectsInGroup( int projectGroupId )
80 throws ContinuumException;
81
82 public Collection<Project> getProjectsInGroupWithDependencies( int projectGroupId )
83 throws ContinuumException;
84
85 public void removeProjectGroup( int projectGroupId )
86 throws ContinuumException;
87
88 public void addProjectGroup( ProjectGroup projectGroup )
89 throws ContinuumException;
90
91 public ProjectGroup getProjectGroupWithProjects( int projectGroupId )
92 throws ContinuumException;
93
94 public ProjectGroup getProjectGroupWithBuildDetails( int projectGroupId )
95 throws ContinuumException;
96
97 public ProjectGroup getProjectGroupByGroupId( String groupId )
98 throws ContinuumException;
99
100 public ProjectGroup getProjectGroupByGroupIdWithBuildDetails( String groupId )
101 throws ContinuumException;
102
103 public List<ProjectGroup> getAllProjectGroupsWithRepository( int repositoryId );
104
105
106
107
108
109 void removeProject( int projectId )
110 throws ContinuumException;
111
112
113
114
115
116
117
118 @Deprecated
119 void checkoutProject( int projectId )
120 throws ContinuumException;
121
122 Project getProject( int projectId )
123 throws ContinuumException;
124
125 Project getProjectWithBuildDetails( int projectId )
126 throws ContinuumException;
127
128 Collection<Project> getProjects()
129 throws ContinuumException;
130
131 Collection<Project> getProjectsWithDependencies()
132 throws ContinuumException;
133
134 BuildResult getLatestBuildResultForProject( int projectId );
135
136 Map<Integer, BuildResult> getLatestBuildResults( int projectGroupId );
137
138 Map<Integer, BuildResult> getBuildResultsInSuccess( int projectGroupId );
139
140 Map<Integer, ProjectGroupSummary> getProjectsSummaryByGroups();
141
142
143
144
145
146
147
148
149
150
151
152 List<Project> getProjectsInBuildOrder( Collection<Project> projects );
153
154 void buildProjects( String username )
155 throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
156
157 void buildProjectsWithBuildDefinition( List<Project> projects, List<BuildDefinition> bds )
158 throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
159
160 void buildProjectsWithBuildDefinition( List<Project> projects, int buildDefinitionId )
161 throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
162
163 void buildProjects( BuildTrigger buildTrigger )
164 throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
165
166 void buildProjects( Schedule schedule )
167 throws ContinuumException;
168
169 void buildProject( int projectId, String username )
170 throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
171
172 void buildProject( int projectId, BuildTrigger buildTrigger )
173 throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
174
175 void buildProjectWithBuildDefinition( int projectId, int buildDefinitionId, BuildTrigger buildTrigger )
176 throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
177
178 void buildProject( int projectId, int buildDefinitionId, BuildTrigger buildTrigger )
179 throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
180
181 public void buildProjectGroup( int projectGroupId, BuildTrigger buildTrigger )
182 throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
183
184 public void buildProjectGroupWithBuildDefinition( int projectGroupId, int buildDefinitionId,
185 BuildTrigger buildTrigger )
186 throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
187
188
189
190
191
192 BuildResult getBuildResult( int buildId )
193 throws ContinuumException;
194
195 BuildResult getBuildResultByBuildNumber( int projectId, int buildNumber )
196 throws ContinuumException;
197
198 String getBuildOutput( int projectId, int buildId )
199 throws ContinuumException;
200
201 long getNbBuildResultsForProject( int projectId );
202
203 Collection<BuildResult> getBuildResultsForProject( int projectId )
204 throws ContinuumException;
205
206 List<ChangeSet> getChangesSinceLastSuccess( int projectId, int buildResultId )
207 throws ContinuumException;
208
209 void removeBuildResult( int buildId )
210 throws ContinuumException;
211
212 List<BuildResult> getBuildResultsInRange( int projectGroupId, Date fromDate, Date toDate, int state,
213 String triggeredBy );
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228 int addProject( Project project, String executorId, int projectGroupId )
229 throws ContinuumException;
230
231
232
233
234
235
236
237
238
239
240 int addProject( Project project, String executorId, int projectGroupId, int buildDefintionTemplateId )
241 throws ContinuumException;
242
243
244
245
246
247
248
249
250 ContinuumProjectBuildingResult addMavenTwoProject( String metadataUrl )
251 throws ContinuumException;
252
253
254
255
256
257
258
259
260
261 ContinuumProjectBuildingResult addMavenTwoProject( String metadataUrl, boolean checkProtocol )
262 throws ContinuumException;
263
264
265
266
267
268
269
270
271
272 ContinuumProjectBuildingResult addMavenTwoProject( String metadataUrl, int projectGroupId )
273 throws ContinuumException;
274
275
276
277
278
279
280
281
282
283
284 ContinuumProjectBuildingResult addMavenTwoProject( String metadataUrl, int projectGroupId, boolean checkProtocol )
285 throws ContinuumException;
286
287
288
289
290
291
292
293
294
295
296
297 ContinuumProjectBuildingResult addMavenTwoProject( String metadataUrl, int projectGroupId, boolean checkProtocol,
298 boolean useCredentialsCache )
299 throws ContinuumException;
300
301
302
303
304
305
306
307
308
309
310
311
312
313 public ContinuumProjectBuildingResult addMavenTwoProject( String metadataUrl, int projectGroupId,
314 boolean checkProtocol, boolean useCredentialsCache,
315 boolean loadRecursiveProjects )
316 throws ContinuumException;
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331 public ContinuumProjectBuildingResult addMavenTwoProject( String metadataUrl, int projectGroupId,
332 boolean checkProtocol, boolean useCredentialsCache,
333 boolean loadRecursiveProjects,
334 int buildDefintionTemplateId,
335 boolean checkoutInSingleDirectory )
336 throws ContinuumException;
337
338
339
340
341
342
343
344
345
346 ContinuumProjectBuildingResult addMavenOneProject( String metadataUrl, int projectGroupId )
347 throws ContinuumException;
348
349
350
351
352
353
354
355
356
357
358 ContinuumProjectBuildingResult addMavenOneProject( String metadataUrl, int projectGroupId, boolean checkProtocol )
359 throws ContinuumException;
360
361
362
363
364
365
366
367
368
369
370
371 ContinuumProjectBuildingResult addMavenOneProject( String metadataUrl, int projectGroupId, boolean checkProtocol,
372 boolean useCredentialsCache )
373 throws ContinuumException;
374
375 ContinuumProjectBuildingResult addMavenOneProject( String metadataUrl, int projectGroupId, boolean checkProtocol,
376 boolean useCredentialsCache, int buildDefintionTemplateId )
377 throws ContinuumException;
378
379 void updateProject( Project project )
380 throws ContinuumException;
381
382 void updateProjectGroup( ProjectGroup projectGroup )
383 throws ContinuumException;
384
385 Project getProjectWithCheckoutResult( int projectId )
386 throws ContinuumException;
387
388 Project getProjectWithAllDetails( int projectId )
389 throws ContinuumException;
390
391 Project getProjectWithBuilds( int projectId )
392 throws ContinuumException;
393
394
395
396
397
398 ProjectNotifier getNotifier( int projectId, int notifierId )
399 throws ContinuumException;
400
401 ProjectNotifier updateNotifier( int projectId, ProjectNotifier notifier )
402 throws ContinuumException;
403
404 ProjectNotifier addNotifier( int projectId, ProjectNotifier notifier )
405 throws ContinuumException;
406
407 void removeNotifier( int projectId, int notifierId )
408 throws ContinuumException;
409
410 ProjectNotifier getGroupNotifier( int projectGroupId, int notifierId )
411 throws ContinuumException;
412
413 ProjectNotifier updateGroupNotifier( int projectGroupId, ProjectNotifier notifier )
414 throws ContinuumException;
415
416 ProjectNotifier addGroupNotifier( int projectGroupId, ProjectNotifier notifier )
417 throws ContinuumException;
418
419 void removeGroupNotifier( int projectGroupId, int notifierId )
420 throws ContinuumException;
421
422
423
424
425
426
427
428
429 @Deprecated
430 List<BuildDefinition> getBuildDefinitions( int projectId )
431 throws ContinuumException;
432
433
434
435
436 @Deprecated
437 BuildDefinition getBuildDefinition( int projectId, int buildDefinitionId )
438 throws ContinuumException;
439
440
441
442
443 @Deprecated
444 void removeBuildDefinition( int projectId, int buildDefinitionId )
445 throws ContinuumException;
446
447
448
449
450
451
452
453 BuildDefinition getBuildDefinition( int buildDefinitionId )
454 throws ContinuumException;
455
456
457
458
459
460
461
462
463
464
465
466 BuildDefinition getDefaultBuildDefinition( int projectId )
467 throws ContinuumException;
468
469 public List<BuildDefinition> getDefaultBuildDefinitionsForProjectGroup( int projectGroupId )
470 throws ContinuumException;
471
472 BuildDefinition addBuildDefinitionToProject( int projectId, BuildDefinition buildDefinition )
473 throws ContinuumException;
474
475 BuildDefinition addBuildDefinitionToProjectGroup( int projectGroupId, BuildDefinition buildDefinition )
476 throws ContinuumException;
477
478 List<BuildDefinition> getBuildDefinitionsForProject( int projectId )
479 throws ContinuumException;
480
481 List<BuildDefinition> getBuildDefinitionsForProjectGroup( int projectGroupId )
482 throws ContinuumException;
483
484 void removeBuildDefinitionFromProject( int projectId, int buildDefinitionId )
485 throws ContinuumException;
486
487 void removeBuildDefinitionFromProjectGroup( int projectGroupId, int buildDefinitionId )
488 throws ContinuumException;
489
490 BuildDefinition updateBuildDefinitionForProject( int projectId, BuildDefinition buildDefinition )
491 throws ContinuumException;
492
493 BuildDefinition updateBuildDefinitionForProjectGroup( int projectGroupId, BuildDefinition buildDefinition )
494 throws ContinuumException;
495
496
497
498
499
500 Schedule getScheduleByName( String scheduleName )
501 throws ContinuumException;
502
503 Schedule getSchedule( int id )
504 throws ContinuumException;
505
506 Collection<Schedule> getSchedules()
507 throws ContinuumException;
508
509 void addSchedule( Schedule schedule )
510 throws ContinuumException;
511
512 void updateSchedule( Schedule schedule )
513 throws ContinuumException;
514
515 void updateSchedule( int scheduleId, Map<String, String> configuration )
516 throws ContinuumException;
517
518 void removeSchedule( int scheduleId )
519 throws ContinuumException;
520
521 void activePurgeSchedule( Schedule schedule );
522
523 void activeBuildDefinitionSchedule( Schedule schedule );
524
525
526
527
528
529 File getWorkingDirectory( int projectId )
530 throws ContinuumException;
531
532 String getFileContent( int projectId, String directory, String filename )
533 throws ContinuumException;
534
535 List<File> getFiles( int projectId, String currentDirectory )
536 throws ContinuumException;
537
538
539
540
541
542 ConfigurationService getConfiguration();
543
544 void reloadConfiguration()
545 throws ContinuumException;
546
547
548
549
550 ContinuumReleaseManager getReleaseManager();
551
552
553
554
555
556 InstallationService getInstallationService();
557
558 ProfileService getProfileService();
559
560 BuildDefinitionService getBuildDefinitionService();
561
562
563
564
565 ContinuumPurgeManager getPurgeManager();
566
567 PurgeConfigurationService getPurgeConfigurationService();
568
569
570
571
572 RepositoryService getRepositoryService();
573
574
575
576
577 List<ProjectScmRoot> getProjectScmRootByProjectGroup( int projectGroupId );
578
579 ProjectScmRoot getProjectScmRoot( int projectScmRootId )
580 throws ContinuumException;
581
582 ProjectScmRoot getProjectScmRootByProject( int projectId )
583 throws ContinuumException;
584
585 ProjectScmRoot getProjectScmRootByProjectGroupAndScmRootAddress( int projectGroupId, String scmRootAddress )
586 throws ContinuumException;
587
588
589
590
591 TaskQueueManager getTaskQueueManager();
592
593
594
595
596 BuildsManager getBuildsManager();
597
598
599
600
601
602 BuildQueue addBuildQueue( BuildQueue buildQueue )
603 throws ContinuumException;
604
605 BuildQueue getBuildQueue( int buildQueueId )
606 throws ContinuumException;
607
608 BuildQueue getBuildQueueByName( String buildQueueName )
609 throws ContinuumException;
610
611 void removeBuildQueue( BuildQueue buildQueue )
612 throws ContinuumException;
613
614 BuildQueue storeBuildQueue( BuildQueue buildQueue )
615 throws ContinuumException;
616
617 List<BuildQueue> getAllBuildQueues()
618 throws ContinuumException;
619
620 public void startup()
621 throws ContinuumException;
622
623 ContinuumReleaseResult addContinuumReleaseResult( int projectId, String releaseId, String releaseType )
624 throws ContinuumException;
625
626 ContinuumReleaseResult addContinuumReleaseResult( ContinuumReleaseResult releaseResult )
627 throws ContinuumException;
628
629 void removeContinuumReleaseResult( int releaseResultId )
630 throws ContinuumException;
631
632 ContinuumReleaseResult getContinuumReleaseResult( int releaseResultId )
633 throws ContinuumException;
634
635 List<ContinuumReleaseResult> getContinuumReleaseResultsByProjectGroup( int projectGroupId );
636
637 List<ContinuumReleaseResult> getAllContinuumReleaseResults();
638
639 ContinuumReleaseResult getContinuumReleaseResult( int projectId, String releaseGoal, long startTime, long endTime )
640 throws ContinuumException;
641
642 String getReleaseOutput( int releaseResultId )
643 throws ContinuumException;
644
645 DistributedBuildManager getDistributedBuildManager();
646
647 DistributedReleaseManager getDistributedReleaseManager();
648 }