You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by oc...@apache.org on 2008/12/15 07:54:34 UTC
svn commit: r726627 - in /continuum/branches/continuum-parallel-builds:
continuum-api/src/main/java/org/apache/continuum/buildmanager/
continuum-core/src/main/java/org/apache/continuum/buildmanager/
continuum-core/src/main/java/org/apache/maven/continuum/
Author: oching
Date: Sun Dec 14 22:54:34 2008
New Revision: 726627
URL: http://svn.apache.org/viewvc?rev=726627&view=rev
Log:
applied some formatting & some javadocs
Modified:
continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Modified: continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java?rev=726627&r1=726626&r2=726627&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java Sun Dec 14 22:54:34 2008
@@ -35,31 +35,101 @@
*/
public interface BuildsManager
{
+ /**
+ * Build projects using their corresponding build definitions. This method adds the group of projects to the
+ * build queue of the overall queue with the least amount of tasks queued.
+ *
+ * @param projects
+ * @param projectsBuildDefinitionsMap
+ * @param trigger
+ * @throws BuildManagerException
+ */
void buildProjects( List<Project> projects, Map<Integer, BuildDefinition> projectsBuildDefinitionsMap, int trigger )
throws BuildManagerException;
+ /**
+ * Build the project using the specified build definition. Adds the project to the build queue of the overall queue with the
+ * least among of tasks queued. The overall queue is chosen from the pool of queues attached to the schedule of the
+ * build definition.
+ *
+ * @param projectId
+ * @param buildDefinition
+ * @param projectName
+ * @param trigger
+ * @throws BuildManagerException
+ */
void buildProject( int projectId, BuildDefinition buildDefinition, String projectName, int trigger )
throws BuildManagerException;
- void prepareBuildProject( Map<Integer, Integer> projectsBuildDefinitionsMap, int trigger )
- throws BuildManagerException;
-
+ /**
+ * Adds the projects in the prepare-build-queue.
+ *
+ * @param projectsBuildDefinitionsMap
+ * @param trigger
+ * @throws BuildManagerException
+ */
+ void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, int trigger )
+ throws BuildManagerException;
+
+ /**
+ * Adds the project to the checkout queue of the overall build queue with the least amount of tasks queued.
+ * The overall queue is chosen from the pool of queues attached to the schedule of the build definition.
+ *
+ * @param projectId
+ * @param projectName
+ * @param workingDirectory
+ * @param scmUsername
+ * @param scmPassword
+ * @param defaultBuildDefinition
+ * @throws BuildManagerException
+ */
void checkoutProject( int projectId, String projectName, File workingDirectory, String scmUsername,
String scmPassword, BuildDefinition defaultBuildDefinition )
throws BuildManagerException;
+ /**
+ * Cancels the specified project's build.
+ *
+ * @param projectId
+ * @return
+ * @throws BuildManagerException
+ */
boolean cancelBuild( int projectId )
throws BuildManagerException;
+ /**
+ * Cancels all the builds in all the overall queues.
+ *
+ * @return
+ * @throws BuildManagerException
+ */
boolean cancelAllBuilds()
throws BuildManagerException;
+ /**
+ * Cancels the current build on the specified overall queue.
+ *
+ * @param buildQueueId
+ * @return
+ * @throws BuildManagerException
+ */
boolean cancelBuildInQueue( int buildQueueId )
throws BuildManagerException;
+ /**
+ *
+ * @param projectId
+ * @return
+ * @throws BuildManagerException
+ */
boolean cancelCheckout( int projectId )
throws BuildManagerException;
+ /**
+ *
+ * @return
+ * @throws BuildManagerException
+ */
boolean cancelAllCheckouts()
throws BuildManagerException;
@@ -67,23 +137,66 @@
// public boolean cancelAllPrepareBuilds() throws BuildManagerException;
+ /**
+ * Removes the project from the build queue.
+ *
+ * @param projectId
+ * @throws BuildManagerException
+ */
void removeProjectFromBuildQueue( int projectId )
throws BuildManagerException;
+ /**
+ * Removes the project built using the specified build definition from the build queue.
+ *
+ * @param projectId
+ * @param buildDefinitionId
+ * @param trigger
+ * @param projectName
+ * @throws BuildManagerException
+ */
void removeProjectFromBuildQueue( int projectId, int buildDefinitionId, int trigger, String projectName )
throws BuildManagerException;
// TODO: should we throw an exception when one of the projects cannot be removed?
+ /**
+ * Removes the specified projects from their build queues.
+ *
+ * @param projectIds
+ */
void removeProjectsFromBuildQueue( int[] projectIds );
+ /**
+ * Removes a set of projects using the specified hashcodes from the build queues.
+ *
+ * @param hascodes
+ * @throws BuildManagerException
+ */
void removeProjectsFromBuildQueueWithHashcodes( int[] hascodes )
throws BuildManagerException;
+ /**
+ * Removes the project from the checkout queue.
+ *
+ * @param projectId
+ * @throws BuildManagerException
+ */
void removeProjectFromCheckoutQueue( int projectId )
throws BuildManagerException;
+ /**
+ * Removes the specified projects from their checkout queues.
+ *
+ * @param projectIds
+ */
void removeProjectsFromCheckoutQueue( int[] projectIds );
+ /**
+ * Removes a set of projects using the specified hashcodes from the checkout queues.
+ *
+ * @param hashcodes
+ * @throws BuildManagerException
+ */
void removeProjectsFromCheckoutQueueWithHashcodes( int[] hashcodes )
throws BuildManagerException;
@@ -92,39 +205,116 @@
// public void removeProjectsFromPrepareBuildQueue( int[] projectIds );
+ /**
+ * Add an overall build queue.
+ *
+ * @param overallBuildQueue
+ */
void addOverallBuildQueue( OverallBuildQueue overallBuildQueue );
+ /**
+ * Remove an overall build queue.
+ *
+ * @param overallBuildQueueId
+ * @throws BuildManagerException
+ */
void removeOverallBuildQueue( int overallBuildQueueId )
throws BuildManagerException;
+ /**
+ * Checks whether the project build is queued.
+ *
+ * @param projectId
+ * @return
+ * @throws BuildManagerException
+ */
boolean isInAnyBuildQueue( int projectId )
throws BuildManagerException;
+ /**
+ * Checks whether the project build using the specified build definition is queued.
+ *
+ * @param projectId
+ * @param buildDefinitionId
+ * @return
+ * @throws BuildManagerException
+ */
boolean isInAnyBuildQueue( int projectId, int buildDefinitionId )
throws BuildManagerException;
+ /**
+ * Checks whether the project checkout is already queued.
+ *
+ * @param projectId
+ * @return
+ * @throws BuildManagerException
+ */
boolean isInAnyCheckoutQueue( int projectId )
throws BuildManagerException;
+ /**
+ * Checks whether the project is already in the prepare-build queue.
+ *
+ * @param projectId
+ * @return
+ * @throws BuildManagerException
+ */
boolean isInPrepareBuildQueue( int projectId )
throws BuildManagerException;
+ /**
+ * Checks whether the project is currently being built.
+ *
+ * @param projectId
+ * @return
+ * @throws BuildManagerException
+ */
boolean isProjectInAnyCurrentBuild( int projectId )
throws BuildManagerException;
// needed in QueuesAction
+
+ /**
+ * Returns all the build tasks currently being executed.
+ *
+ * @return
+ * @throws BuildManagerException
+ */
List<Task> getCurrentBuilds()
throws BuildManagerException;
+ /**
+ * Returns all the checkout tasks currently being executed.
+ * @return
+ * @throws BuildManagerException
+ */
List<Task> getCurrentCheckouts()
throws BuildManagerException;
+ /**
+ * Returns all the overall build queues together with a list of the build tasks in it's build queue.
+ *
+ * @return
+ * @throws BuildManagerException
+ */
Map<String, List<Task>> getProjectsInBuildQueues()
throws BuildManagerException;
+ /**
+ * Returns all the overall build queues together with a list of checkout tasks in it's checkout queue.
+ *
+ * @return
+ * @throws BuildManagerException
+ */
Map<String, List<Task>> getProjectsInCheckoutQueues()
throws BuildManagerException;
+ /**
+ * Checks whether a build is in progress.
+ *
+ * @return
+ * @throws BuildManagerException
+ */
boolean isBuildInProgress()
throws BuildManagerException;
}
Modified: continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java?rev=726627&r1=726626&r2=726627&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java Sun Dec 14 22:54:34 2008
@@ -27,7 +27,6 @@
import java.util.Map;
import java.util.Set;
-import org.apache.commons.lang.ArrayUtils;
import org.apache.continuum.dao.BuildDefinitionDao;
import org.apache.continuum.taskqueue.OverallBuildQueue;
import org.apache.maven.continuum.buildqueue.BuildProjectTask;
@@ -450,7 +449,7 @@
return false;
}
- public void prepareBuildProject( Map<Integer, Integer> projectsBuildDefinitionsMap, int trigger )
+ public void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, int trigger )
throws BuildManagerException
{
try
Modified: continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=726627&r1=726626&r2=726627&view=diff
==============================================================================
--- continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original)
+++ continuum/branches/continuum-parallel-builds/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Sun Dec 14 22:54:34 2008
@@ -3390,7 +3390,7 @@
{
try
{
- parallelBuildsManager.prepareBuildProject( projectsBuildDefinitionsMap, trigger );
+ parallelBuildsManager.prepareBuildProjects( projectsBuildDefinitionsMap, trigger );
}
catch( BuildManagerException e )
{