View Javadoc

1   package org.apache.continuum.buildagent.taskqueue.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 java.util.List;
23  
24  import org.apache.continuum.buildagent.taskqueue.PrepareBuildProjectsTask;
25  import org.apache.continuum.taskqueue.BuildProjectTask;
26  import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
27  import org.codehaus.plexus.taskqueue.TaskQueue;
28  
29  public interface BuildAgentTaskQueueManager
30  {
31      String ROLE = BuildAgentTaskQueueManager.class.getName();
32  
33      TaskQueue getBuildQueue();
34  
35      TaskQueue getPrepareBuildQueue();
36  
37      void cancelBuild()
38          throws TaskQueueManagerException;
39  
40      int getIdOfProjectCurrentlyBuilding()
41          throws TaskQueueManagerException;
42  
43      BuildProjectTask getCurrentProjectInBuilding()
44          throws TaskQueueManagerException;
45  
46      PrepareBuildProjectsTask getCurrentProjectInPrepareBuild()
47          throws TaskQueueManagerException;
48      
49      boolean hasBuildTaskInQueue()
50          throws TaskQueueManagerException;
51  
52      boolean isProjectInBuildQueue( int projectId )
53          throws TaskQueueManagerException;
54  
55      boolean isInPrepareBuildQueue( int projectGroupId, int trigger, String scmRootAddress )
56          throws TaskQueueManagerException;
57  
58      List<PrepareBuildProjectsTask> getProjectsInPrepareBuildQueue()
59          throws TaskQueueManagerException;
60  
61      List<BuildProjectTask> getProjectsInBuildQueue()
62          throws TaskQueueManagerException;
63  
64      boolean removeFromPrepareBuildQueue( int projectGroupId, int scmRootId )
65          throws TaskQueueManagerException;
66  
67      void removeFromPrepareBuildQueue( int[] hashCodes )
68          throws TaskQueueManagerException;
69  
70      boolean removeFromBuildQueue( int projectId, int buildDefinitionId )
71          throws TaskQueueManagerException;
72  
73      void removeFromBuildQueue( int[] hashCodes )
74          throws TaskQueueManagerException;
75  }