View Javadoc

1   package org.apache.continuum.builder.distributed.manager;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.continuum.buildagent.NoBuildAgentException;
23  import org.apache.continuum.buildagent.NoBuildAgentInGroupException;
24  import org.apache.continuum.configuration.BuildAgentConfiguration;
25  import org.apache.continuum.model.project.ProjectRunSummary;
26  import org.apache.continuum.model.project.ProjectScmRoot;
27  import org.apache.continuum.taskqueue.BuildProjectTask;
28  import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
29  import org.apache.continuum.utils.build.BuildTrigger;
30  import org.apache.maven.continuum.ContinuumException;
31  import org.apache.maven.continuum.model.system.Installation;
32  
33  import java.util.List;
34  import java.util.Map;
35  
36  public interface DistributedBuildManager
37  {
38      String ROLE = DistributedBuildManager.class.getName();
39  
40      void cancelDistributedBuild( String buildAgentUrl )
41          throws ContinuumException;
42  
43      void reload()
44          throws ContinuumException;
45  
46      void update( BuildAgentConfiguration buildAgent )
47          throws ContinuumException;
48  
49      void removeDistributedBuildQueueOfAgent( String buildAgentUrl )
50          throws ContinuumException;
51  
52      boolean isBuildAgentBusy( String buildAgentUrl );
53  
54      List<Installation> getAvailableInstallations( String buildAgentUrl )
55          throws ContinuumException;
56  
57      String getBuildAgentPlatform( String buildAgentUrl )
58          throws ContinuumException;
59  
60      Map<String, List<PrepareBuildProjectsTask>> getProjectsInPrepareBuildQueue()
61          throws ContinuumException;
62  
63      Map<String, List<BuildProjectTask>> getProjectsInBuildQueue()
64          throws ContinuumException;
65  
66      Map<String, Object> getBuildResult( int projectId )
67          throws ContinuumException;
68  
69      String generateWorkingCopyContent( int projectId, String directory, String baseUrl, String imagesBaseUrl )
70          throws ContinuumException;
71  
72      Map<String, Object> getFileContent( int projectId, String directory, String filename )
73          throws ContinuumException;
74  
75      void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, BuildTrigger buildTrigger,
76                                 int projectGroupId, String projectGroupName, String scmRootAddress, int scmRootId,
77                                 List<ProjectScmRoot> scmRoots )
78          throws ContinuumException, NoBuildAgentException, NoBuildAgentInGroupException;
79  
80      Map<String, PrepareBuildProjectsTask> getProjectsCurrentlyPreparingBuild()
81          throws ContinuumException;
82  
83      Map<String, BuildProjectTask> getProjectsCurrentlyBuilding()
84          throws ContinuumException;
85  
86      void removeFromPrepareBuildQueue( String buildAgnetUrl, int projectGroupId, int scmRootId )
87          throws ContinuumException;
88  
89      void removeFromPrepareBuildQueue( List<String> hashCodes )
90          throws ContinuumException;
91  
92      void removeFromBuildQueue( String buildAgentUrl, int projectId, int buildDefinitionId )
93          throws ContinuumException;
94  
95      void removeFromBuildQueue( List<String> hashCodes )
96          throws ContinuumException;
97  
98      boolean isAgentAvailable( String buildAgentUrl )
99          throws ContinuumException;
100 
101     boolean pingBuildAgent( String buildAgentUrl )
102         throws ContinuumException;
103 
104     boolean isProjectInAnyPrepareBuildQueue( int projectId, int buildDefinitionId )
105         throws ContinuumException;
106 
107     boolean isProjectInAnyBuildQueue( int projectId, int buildDefinitionId )
108         throws ContinuumException;
109 
110     boolean isProjectCurrentlyPreparingBuild( int projectId, int buildDefinitionId )
111         throws ContinuumException;
112 
113     boolean isProjectCurrentlyBuilding( int projectId, int buildDefinitionId )
114         throws ContinuumException;
115 
116     String getBuildAgentUrl( int projectId, int buildDefinitionId )
117         throws ContinuumException;
118 
119     List<ProjectRunSummary> getCurrentRuns();
120 
121     void removeCurrentRun( int projectId, int buildDefinitionId );
122 
123     void cancelBuild( int projectId )
124         throws ContinuumException;
125 
126     void cancelGroupBuild( int projectGroupId )
127         throws ContinuumException;
128 }