continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jzurb...@apache.org
Subject svn commit: r786863 [1/2] - in /continuum/branches/continuum-1.3.x: continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/ continuum-api/src/main/java/org/apache/continuum/buildmanager/ continuum-api/src/main/java/org/apache/cont...
Date Sat, 20 Jun 2009 17:07:10 GMT
Author: jzurbano
Date: Sat Jun 20 17:07:08 2009
New Revision: 786863

URL: http://svn.apache.org/viewvc?rev=786863&view=rev
Log:
[CONTINUUM-565] - Forced builds should say who (which continuum user) forced the build. added BuildTrigger class and used it in place of int (trigger) when building. updated unit tests.

Added:
    continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/utils/build/
    continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/utils/build/BuildTrigger.java   (with props)
Modified:
    continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java
    continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
    continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/BuildProjectTask.java
    continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/OverallBuildQueue.java
    continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/PrepareBuildProjectsTask.java
    continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
    continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CreateBuildProjectTaskAction.java
    continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.java
    continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/BuildContext.java
    continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/PrepareBuildProjectsTask.java
    continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
    continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java
    continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java
    continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java
    continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/ContinuumBuildAgentUtil.java
    continuum/branches/continuum-1.3.x/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
    continuum/branches/continuum-1.3.x/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/util/DistributedBuildUtil.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildContext.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildController.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/evaluator/BuildProjectTaskViabilityEvaluator.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractContinuumAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CreateBuildProjectTaskAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/scm/queue/PrepareBuildProjectsTaskExecutor.java
    continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/continuum/buildmanager/ParallelBuildsManagerTest.java
    continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueueTest.java
    continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/DefaultContinuumTest.java
    continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutorTest.java
    continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/buildcontroller/DefaultBuildControllerTest.java
    continuum/branches/continuum-1.3.x/continuum-core/src/test/java/org/apache/maven/continuum/buildqueue/BuildQueueTest.java
    continuum/branches/continuum-1.3.x/continuum-data-management/continuum-legacy/src/main/mdo/continuum.xml
    continuum/branches/continuum-1.3.x/continuum-model/src/main/mdo/continuum.xml
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildProjectAction.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/admin/QueuesAction.java
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/resources/localization/Continuum.properties
    continuum/branches/continuum-1.3.x/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildResult.jsp
    continuum/branches/continuum-1.3.x/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java

Modified: continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/builder/distributed/manager/DistributedBuildManager.java Sat Jun 20 17:07:08 2009
@@ -24,6 +24,7 @@
 
 import org.apache.continuum.taskqueue.BuildProjectTask;
 import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.system.Installation;
 
@@ -60,7 +61,7 @@
     String getFileContent( int projectId, String directory, String filename )
         throws ContinuumException;
 
-    void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, int trigger, int projectGroupId, 
+    void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, BuildTrigger buildTrigger, int projectGroupId,  
                                String projectGroupName, String scmRootAddress, int scmRootId )
         throws ContinuumException;
 

Modified: continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/buildmanager/BuildsManager.java Sat Jun 20 17:07:08 2009
@@ -26,6 +26,7 @@
 import org.apache.continuum.taskqueue.BuildProjectTask;
 import org.apache.continuum.taskqueue.CheckOutTask;
 import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildQueue;
 import org.apache.maven.continuum.model.project.Project;
@@ -44,13 +45,13 @@
      *
      * @param projects
      * @param projectsBuildDefinitionsMap
-     * @param trigger
+     * @param buildTrigger
      * @param scmResultMap                TODO
      * @param projectGroupId
      * @throws BuildManagerException
      */
-    void buildProjects( List<Project> projects, Map<Integer, BuildDefinition> projectsBuildDefinitionsMap, int trigger,
-                        Map<Integer, ScmResult> scmResultMap, int projectGroupId )
+	void buildProjects( List<Project> projects, Map<Integer, BuildDefinition> projectsBuildDefinitionsMap,
+			            BuildTrigger buildTrigger, Map<Integer, ScmResult> scmResultMap, int projectGroupId )
         throws BuildManagerException;
 
     /**
@@ -61,12 +62,12 @@
      * @param projectId
      * @param buildDefinition
      * @param projectName
-     * @param trigger
+     * @param buildTrigger
      * @param scmResult       TODO
      * @param projectGroupId
      * @throws BuildManagerException
      */
-    void buildProject( int projectId, BuildDefinition buildDefinition, String projectName, int trigger,
+	void buildProject( int projectId, BuildDefinition buildDefinition, String projectName, BuildTrigger buildTrigger,
                        ScmResult scmResult, int projectGroupId )
         throws BuildManagerException;
 
@@ -74,13 +75,14 @@
      * Adds the projects in the prepare-build-queue.
      *
      * @param projectsBuildDefinitionsMap
-     * @param trigger
+     * @param buildTrigger
      * @param projectGroupId              TODO
      * @param scmRootAddress              TODO
+     * @param scmRootId
      * @throws BuildManagerException
      */
-    void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, int trigger, int projectGroupId,
-                               String projectGroupName, String scmRootAddress, int scmRootId )
+	void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, BuildTrigger buildTrigger,
+			                   int projectGroupId, String projectGroupName, String scmRootAddress, int scmRootId )
         throws BuildManagerException;
 
     /**
@@ -162,13 +164,13 @@
      *
      * @param projectId
      * @param buildDefinitionId
-     * @param trigger
+     * @param buildTrigger
      * @param projectName
      * @param projectGroupId
      * @throws BuildManagerException
      */
-    void removeProjectFromBuildQueue( int projectId, int buildDefinitionId, int trigger, String projectName,
-                                      int projectGroupId )
+    void removeProjectFromBuildQueue( int projectId, int buildDefinitionId, BuildTrigger buildTrigger,
+    		                          String projectName, int projectGroupId )
         throws BuildManagerException;
 
     // TODO: should we throw an exception when one of the projects cannot be removed?

Modified: continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/BuildProjectTask.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/BuildProjectTask.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/BuildProjectTask.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/BuildProjectTask.java Sat Jun 20 17:07:08 2009
@@ -21,6 +21,7 @@
 
 import java.io.Serializable;
 
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.model.scm.ScmResult;
 import org.codehaus.plexus.taskqueue.Task;
 
@@ -39,7 +40,7 @@
 
     private final long timestamp;
 
-    private final int trigger;
+    private BuildTrigger buildTrigger;
 
     private long maxExecutionTime;
 
@@ -51,7 +52,7 @@
 
     int projectGroupId;
 
-    public BuildProjectTask( int projectId, int buildDefinitionId, int trigger, String projectName,
+    public BuildProjectTask( int projectId, int buildDefinitionId, BuildTrigger buildTrigger, String projectName,
                              String buildDefinitionLabel, ScmResult scmResult, int projectGroupId )
     {
         this.projectId = projectId;
@@ -60,7 +61,7 @@
 
         this.timestamp = System.currentTimeMillis();
 
-        this.trigger = trigger;
+        this.buildTrigger = buildTrigger;
 
         this.projectName = projectName;
 
@@ -86,9 +87,14 @@
         return timestamp;
     }
 
-    public int getTrigger()
+    public BuildTrigger getBuildTrigger()
     {
-        return trigger;
+    	return buildTrigger;
+    }
+    
+    public void setBuildTrigger( BuildTrigger buildTrigger )
+    {
+        this.buildTrigger = buildTrigger;
     }
 
     public void setMaxExecutionTime( long maxExecutionTime )
@@ -138,12 +144,12 @@
         BuildProjectTask buildProjectTask = (BuildProjectTask) obj;
         return buildProjectTask.getBuildDefinitionId() == this.getBuildDefinitionId() &&
             buildProjectTask.getProjectId() == this.getProjectId() &&
-            buildProjectTask.getTrigger() == this.getTrigger();
+            buildProjectTask.getBuildTrigger().getTrigger() == this.buildTrigger.getTrigger();
     }
 
     public int hashCode()
     {
-        return this.getBuildDefinitionId() + this.getProjectId() + this.getTrigger();
+    	return this.getBuildDefinitionId() + this.getProjectId() + this.buildTrigger.getTrigger();
     }
 
     public int getHashCode()

Modified: continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/OverallBuildQueue.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/OverallBuildQueue.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/OverallBuildQueue.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/OverallBuildQueue.java Sat Jun 20 17:07:08 2009
@@ -21,6 +21,7 @@
 
 import java.util.List;
 
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.codehaus.plexus.taskqueue.TaskQueue;
 import org.codehaus.plexus.taskqueue.TaskQueueException;
 import org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor;
@@ -213,14 +214,14 @@
      *
      * @param projectId
      * @param buildDefinitionId
-     * @param trigger
+     * @param buildTrigger
      * @param projectName
      * @param projectGroupId
      * @return
      * @throws TaskQueueException TODO
      */
-    boolean removeProjectFromBuildQueue( int projectId, int buildDefinitionId, int trigger, String projectName,
-                                         int projectGroupId )
+    boolean removeProjectFromBuildQueue( int projectId, int buildDefinitionId, BuildTrigger buildTrigger,
+    		                             String projectName, int projectGroupId )
         throws TaskQueueException;
 
     /**

Modified: continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/PrepareBuildProjectsTask.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/PrepareBuildProjectsTask.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/PrepareBuildProjectsTask.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/taskqueue/PrepareBuildProjectsTask.java Sat Jun 20 17:07:08 2009
@@ -21,6 +21,7 @@
 
 import java.util.Map;
 
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.codehaus.plexus.taskqueue.Task;
 
 public class PrepareBuildProjectsTask
@@ -28,7 +29,7 @@
 {
     private final Map<Integer, Integer> projectsBuildDefinitionsMap;
 
-    private final int trigger;
+    private BuildTrigger buildTrigger;
 
     private final int projectGroupId;
 
@@ -38,11 +39,11 @@
 
     private final int projectScmRootId;
 
-    public PrepareBuildProjectsTask( Map<Integer, Integer> projectsBuildDefinitionsMap, int trigger, int projectGroupId,
+    public PrepareBuildProjectsTask( Map<Integer, Integer> projectsBuildDefinitionsMap, BuildTrigger buildTrigger, int projectGroupId,
                                      String projectGroupName, String scmRootAddress, int projectScmRootId )
     {
         this.projectsBuildDefinitionsMap = projectsBuildDefinitionsMap;
-        this.trigger = trigger;
+        this.buildTrigger = buildTrigger;
         this.projectGroupId = projectGroupId;
         this.projectGroupName = projectGroupName;
         this.scmRootAddress = scmRootAddress;
@@ -60,9 +61,9 @@
         return projectsBuildDefinitionsMap;
     }
 
-    public int getTrigger()
+    public BuildTrigger getBuildTrigger()
     {
-        return trigger;
+    	return buildTrigger;
     }
 
     public int getHashCode()
@@ -92,6 +93,6 @@
 
     public int hashCode()
     {
-        return this.projectGroupId + this.projectScmRootId + this.trigger;
+    	return this.projectGroupId + this.projectScmRootId + this.buildTrigger.getTrigger();
     }
 }

Added: continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/utils/build/BuildTrigger.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/utils/build/BuildTrigger.java?rev=786863&view=auto
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/utils/build/BuildTrigger.java (added)
+++ continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/utils/build/BuildTrigger.java Sat Jun 20 17:07:08 2009
@@ -0,0 +1,69 @@
+package org.apache.continuum.utils.build;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @author Jevica Arianne B. Zurbano
+ * @version $Id: BuildTrigger.java
+ * @since 19 jun 09
+ */
+public class BuildTrigger
+{
+    private int trigger;
+    
+    private String username;
+    
+    public BuildTrigger( int trigger )
+    {
+        this.trigger = trigger;
+    }
+    
+    public BuildTrigger( String username )
+    {
+        this.username = username;
+    }
+    
+    public BuildTrigger( int trigger, String username )
+    {
+        this.trigger = trigger;
+        this.username = username;
+    }
+    
+    public void setTrigger( int trigger )
+    {
+        this.trigger = trigger;
+    }
+    
+    public int getTrigger()
+    {
+        return this.trigger;
+    }
+    
+    public void setUsername( String username )
+    {
+        this.username = username;
+    }
+    
+    public String getUsername()
+    {
+        return this.username;
+    }
+}
+

Propchange: continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/utils/build/BuildTrigger.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java Sat Jun 20 17:07:08 2009
@@ -34,6 +34,7 @@
 import org.apache.continuum.release.distributed.manager.DistributedReleaseManager;
 import org.apache.continuum.repository.RepositoryService;
 import org.apache.continuum.taskqueue.manager.TaskQueueManager;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.builddefinition.BuildDefinitionService;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.installation.InstallationService;
@@ -166,7 +167,7 @@
      */
     List<Project> getProjectsInBuildOrder( Collection<Project> projects );
 
-    void buildProjects()
+    void buildProjects( String username )
         throws ContinuumException;
 
     void buildProjectsWithBuildDefinition( int buildDefinitionId )
@@ -178,31 +179,31 @@
     void buildProjectsWithBuildDefinition( List<Project> projects, int buildDefinitionId )
         throws ContinuumException;
 
-    void buildProjects( int trigger )
+    void buildProjects( BuildTrigger buildTrigger )
         throws ContinuumException;
 
-    void buildProjects( int trigger, int buildDefinitionId )
+    void buildProjects( BuildTrigger buildTrigger, int buildDefinitionId )
         throws ContinuumException;
 
     void buildProjects( Schedule schedule )
         throws ContinuumException;
 
-    void buildProject( int projectId )
+    void buildProject( int projectId, String username )
         throws ContinuumException;
 
-    void buildProject( int projectId, int trigger )
+    void buildProject( int projectId, BuildTrigger buildTrigger )
         throws ContinuumException;
 
-    void buildProjectWithBuildDefinition( int projectId, int buildDefinitionId )
+    void buildProjectWithBuildDefinition( int projectId, int buildDefinitionId, BuildTrigger buildTrigger )
         throws ContinuumException;
 
-    void buildProject( int projectId, int buildDefinitionId, int trigger )
+    void buildProject( int projectId, int buildDefinitionId, BuildTrigger buildTrigger )
         throws ContinuumException;
 
-    public void buildProjectGroup( int projectGroupId )
+    public void buildProjectGroup( int projectGroupId, BuildTrigger buildTrigger )
         throws ContinuumException;
 
-    public void buildProjectGroupWithBuildDefinition( int projectGroupId, int buildDefinitionId )
+    public void buildProjectGroupWithBuildDefinition( int projectGroupId, int buildDefinitionId, BuildTrigger buildTrigger )
         throws ContinuumException;
 
     // ----------------------------------------------------------------------

Modified: continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java Sat Jun 20 17:07:08 2009
@@ -43,6 +43,7 @@
 import org.apache.continuum.buildagent.utils.WorkingCopyContentGenerator;
 import org.apache.continuum.taskqueue.BuildProjectTask;
 import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.scm.ChangeFile;
@@ -195,6 +196,7 @@
             result.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, buildContext.getProjectId() );
             result.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, buildContext.getBuildDefinitionId() );
             result.put( ContinuumBuildAgentUtil.KEY_TRIGGER, buildContext.getTrigger() );
+            result.put( ContinuumBuildAgentUtil.KEY_USERNAME, buildContext.getUsername() );
 
             BuildResult buildResult = buildContext.getBuildResult();
 
@@ -611,7 +613,8 @@
                 map.put( ContinuumBuildAgentUtil.KEY_PROJECT_GROUP_ID, new Integer( task.getProjectGroupId() ) );
                 map.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_ID, new Integer( task.getScmRootId() ) );
                 map.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_ADDRESS, task.getScmRootAddress() );
-                map.put( ContinuumBuildAgentUtil.KEY_TRIGGER, new Integer( task.getTrigger() ) );
+                map.put( ContinuumBuildAgentUtil.KEY_TRIGGER, task.getBuildTrigger().getTrigger() );
+                map.put( ContinuumBuildAgentUtil.KEY_USERNAME, task.getBuildTrigger().getUsername() );
 
                 projects.add( map );
             }
@@ -637,7 +640,8 @@
                 Map<String, Object> map = new HashMap<String, Object>();
                 map.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, new Integer( task.getProjectId() ) );
                 map.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, new Integer( task.getBuildDefinitionId() ) );
-                map.put( ContinuumBuildAgentUtil.KEY_TRIGGER, new Integer( task.getTrigger() ) );
+                map.put( ContinuumBuildAgentUtil.KEY_TRIGGER, task.getBuildTrigger().getTrigger() );
+                map.put( ContinuumBuildAgentUtil.KEY_USERNAME, task.getBuildTrigger().getUsername() );
                 map.put( ContinuumBuildAgentUtil.KEY_PROJECT_GROUP_ID, new Integer( task.getProjectGroupId() ) );
                 map.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_LABEL, task.getBuildDefinitionLabel() );
 
@@ -667,7 +671,8 @@
                 project.put( ContinuumBuildAgentUtil.KEY_PROJECT_GROUP_ID, new Integer( task.getProjectGroupId() ) );
                 project.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_ID, new Integer( task.getScmRootId() ) );
                 project.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_ADDRESS, task.getScmRootAddress() );
-                project.put( ContinuumBuildAgentUtil.KEY_TRIGGER, task.getTrigger() );
+                project.put( ContinuumBuildAgentUtil.KEY_TRIGGER, task.getBuildTrigger().getTrigger() );
+                project.put( ContinuumBuildAgentUtil.KEY_USERNAME, task.getBuildTrigger().getUsername() );
             }
 
             return project;
@@ -692,7 +697,8 @@
             {
                 project.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, new Integer( task.getProjectId() ) );
                 project.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, new Integer( task.getBuildDefinitionId() ) );
-                project.put( ContinuumBuildAgentUtil.KEY_TRIGGER, new Integer( task.getTrigger() ) );
+                project.put( ContinuumBuildAgentUtil.KEY_TRIGGER, task.getBuildTrigger().getTrigger() );
+                project.put( ContinuumBuildAgentUtil.KEY_USERNAME, task.getBuildTrigger().getUsername() );
                 project.put( ContinuumBuildAgentUtil.KEY_PROJECT_GROUP_ID, new Integer( task.getProjectGroupId() ) );
                 project.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_LABEL, task.getBuildDefinitionLabel() );
             }
@@ -923,6 +929,7 @@
             context.setProjectName( ContinuumBuildAgentUtil.getProjectName( map ) );
             context.setProjectState( ContinuumBuildAgentUtil.getProjectState( map ) );
             context.setTrigger( ContinuumBuildAgentUtil.getTrigger( map ) );
+            context.setUsername( ContinuumBuildAgentUtil.getUsername( map ) );
             context.setLocalRepository( ContinuumBuildAgentUtil.getLocalRepository( map ) );
             context.setBuildNumber( ContinuumBuildAgentUtil.getBuildNumber( map ) );
             context.setOldScmResult( getScmResult( ContinuumBuildAgentUtil.getOldScmChanges( map ) ) );
@@ -1005,8 +1012,8 @@
         if ( buildContexts != null && buildContexts.size() > 0 )
         {
             BuildContext context = buildContexts.get( 0 );
-            return new PrepareBuildProjectsTask( buildContexts, context.getTrigger(), context.getProjectGroupId(),
-                                                 context.getScmRootAddress(), context.getScmRootId() );
+            return new PrepareBuildProjectsTask( buildContexts, new BuildTrigger( context.getTrigger(), context.getUsername() ),
+            		                             context.getProjectGroupId(), context.getScmRootAddress(), context.getScmRootId() );
         }
         else
         {

Modified: continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CreateBuildProjectTaskAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CreateBuildProjectTaskAction.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CreateBuildProjectTaskAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/CreateBuildProjectTaskAction.java Sat Jun 20 17:07:08 2009
@@ -27,6 +27,7 @@
 import org.apache.continuum.buildagent.utils.ContinuumBuildAgentUtil;
 import org.apache.continuum.taskqueue.BuildProjectTask;
 import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.ContinuumException;
 import org.codehaus.plexus.action.AbstractAction;
 import org.codehaus.plexus.taskqueue.TaskQueueException;
@@ -53,9 +54,11 @@
 
         for ( BuildContext buildContext : buildContexts )
         {
-            BuildProjectTask buildProjectTask =
+        	BuildTrigger buildTrigger = new BuildTrigger( buildContext.getTrigger(), buildContext.getUsername() );
+        	
+        	BuildProjectTask buildProjectTask =
                 new BuildProjectTask( buildContext.getProjectId(), buildContext.getBuildDefinitionId(),
-                                      buildContext.getTrigger(), buildContext.getProjectName(), buildContext.getBuildDefinitionLabel(),
+                		              buildTrigger, buildContext.getProjectName(), buildContext.getBuildDefinitionLabel(),
                                       buildContext.getScmResult(), buildContext.getProjectGroupId() );
             buildProjectTask.setMaxExecutionTime( buildContext.getMaxExecutionTime() * 1000 );
 

Modified: continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/action/ExecuteBuilderAction.java Sat Jun 20 17:07:08 2009
@@ -67,6 +67,8 @@
         String localRepository = ContinuumBuildAgentUtil.getLocalRepository( context );
 
         int trigger = ContinuumBuildAgentUtil.getTrigger( context );
+        
+        String username = ContinuumBuildAgentUtil.getUsername( context );
 
         ContinuumAgentBuildExecutor buildExecutor = buildAgentBuildExecutorManager.getBuildExecutor( project.getExecutorId() );
         
@@ -81,6 +83,8 @@
         buildResult.setState( ContinuumProjectState.BUILDING );
 
         buildResult.setTrigger( trigger );
+        
+        buildResult.setUsername( username );
 
         buildResult.setBuildDefinition( buildDefinition );
 

Modified: continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/BuildContext.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/BuildContext.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/BuildContext.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/buildcontext/BuildContext.java Sat Jun 20 17:07:08 2009
@@ -22,6 +22,7 @@
 import java.util.Date;
 import java.util.Map;
 
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.scm.ScmResult;
 
@@ -56,6 +57,8 @@
     private String scmPassword;
 
     private int trigger;
+    
+    private String username;
 
     private boolean buildFresh;
 
@@ -374,4 +377,14 @@
     {
         return buildDefinitionLabel;
     }
+    
+    public void setUsername( String username )
+    {
+         this.username = username;
+    }
+    
+    public String getUsername()
+    {
+         return username;
+    }
 }

Modified: continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/PrepareBuildProjectsTask.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/PrepareBuildProjectsTask.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/PrepareBuildProjectsTask.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/PrepareBuildProjectsTask.java Sat Jun 20 17:07:08 2009
@@ -22,6 +22,7 @@
 import java.util.List;
 
 import org.apache.continuum.buildagent.buildcontext.BuildContext;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.codehaus.plexus.taskqueue.Task;
 
 public class PrepareBuildProjectsTask
@@ -29,7 +30,7 @@
 {
     private final List<BuildContext> buildContexts;
 
-    private final int trigger;
+    private BuildTrigger buildTrigger;
 
     private final int projectGroupId;
 
@@ -37,11 +38,11 @@
 
     private final int scmRootId;
 
-    public PrepareBuildProjectsTask( List<BuildContext> buildContexts, int trigger, int projectGroupId,
+    public PrepareBuildProjectsTask( List<BuildContext> buildContexts, BuildTrigger buildTrigger, int projectGroupId,
                                      String scmRootAddress, int scmRootId )
     {
         this.buildContexts = buildContexts;
-        this.trigger = trigger;
+        this.buildTrigger = buildTrigger;
         this.projectGroupId = projectGroupId;
         this.scmRootAddress = scmRootAddress;
         this.scmRootId = scmRootId;
@@ -58,9 +59,9 @@
         return buildContexts;
     }
 
-    public int getTrigger()
+    public BuildTrigger getBuildTrigger()
     {
-        return trigger;
+    	return buildTrigger;
     }
 
     public int getProjectGroupId()
@@ -80,6 +81,6 @@
 
     public int getHashCode()
     {
-        return projectGroupId + scmRootId + trigger;
+    	return projectGroupId + scmRootId + buildTrigger.getTrigger();
     }
 }

Modified: continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/BuildProjectTaskExecutor.java Sat Jun 20 17:07:08 2009
@@ -164,6 +164,7 @@
                            BuildContextToBuildDefinition.getBuildDefinition( buildContext ) );
         actionContext.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, buildContext.getBuildDefinitionId() );
         actionContext.put( ContinuumBuildAgentUtil.KEY_TRIGGER, buildContext.getTrigger() );
+        actionContext.put( ContinuumBuildAgentUtil.KEY_USERNAME, buildContext.getUsername() );
         actionContext.put( ContinuumBuildAgentUtil.KEY_ENVIRONMENTS,
                            getEnvironments( buildContext.getBuildDefinitionId(),
                                             getInstallationType( buildContext ) ) );
@@ -205,6 +206,7 @@
         result.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, buildContext.getProjectId() );
         result.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, buildContext.getBuildDefinitionId() );
         result.put( ContinuumBuildAgentUtil.KEY_TRIGGER, buildContext.getTrigger() );
+        result.put( ContinuumBuildAgentUtil.KEY_USERNAME, buildContext.getUsername() );
         result.put( ContinuumBuildAgentUtil.KEY_BUILD_STATE, buildResult.getState() );
         result.put( ContinuumBuildAgentUtil.KEY_START_TIME, Long.toString( buildResult.getStartTime() ) );
         result.put( ContinuumBuildAgentUtil.KEY_END_TIME, Long.toString( buildResult.getEndTime() ) );
@@ -300,6 +302,8 @@
             build.setState( ContinuumProjectState.ERROR );
 
             build.setTrigger( context.getTrigger() );
+            
+            build.setUsername( context.getUsername() );
 
             build.setStartTime( context.getBuildStartTime() );
 
@@ -401,6 +405,7 @@
         map.put( ContinuumBuildAgentUtil.KEY_PROJECT_ID, context.getProjectId() );
         map.put( ContinuumBuildAgentUtil.KEY_BUILD_DEFINITION_ID, context.getBuildDefinitionId() );
         map.put( ContinuumBuildAgentUtil.KEY_TRIGGER, context.getTrigger() );
+        map.put( ContinuumBuildAgentUtil.KEY_USERNAME, context.getUsername() );
         map.put( ContinuumBuildAgentUtil.KEY_SCM_CHANGES, getScmChanges( context.getScmResult() ) );
         map.put( ContinuumBuildAgentUtil.KEY_MAVEN_PROJECT, getMavenProject( context ) );
         if ( context.getLatestUpdateDate() != null )

Modified: continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/execution/PrepareBuildProjectsTaskExecutor.java Sat Jun 20 17:07:08 2009
@@ -31,6 +31,7 @@
 import org.apache.continuum.buildagent.utils.BuildContextToBuildDefinition;
 import org.apache.continuum.buildagent.utils.BuildContextToProject;
 import org.apache.continuum.buildagent.utils.ContinuumBuildAgentUtil;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
@@ -174,6 +175,8 @@
         actionContext.put( ContinuumBuildAgentUtil.KEY_SCM_ROOT_ADDRESS, buildContext.getScmRootAddress() );
         actionContext.put( ContinuumBuildAgentUtil.KEY_OLD_SCM_RESULT, buildContext.getOldScmResult() );
         actionContext.put( ContinuumBuildAgentUtil.KEY_LATEST_UPDATE_DATE, buildContext.getLatestUpdateDate() );
+        actionContext.put( ContinuumBuildAgentUtil.KEY_TRIGGER, buildContext.getTrigger() );
+        actionContext.put( ContinuumBuildAgentUtil.KEY_USERNAME, buildContext.getUsername() );
 
         buildContext.setActionContext( actionContext );
     }

Modified: continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/BuildAgentTaskQueueManager.java Sat Jun 20 17:07:08 2009
@@ -24,6 +24,7 @@
 import org.apache.continuum.buildagent.taskqueue.PrepareBuildProjectsTask;
 import org.apache.continuum.taskqueue.BuildProjectTask;
 import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.codehaus.plexus.taskqueue.TaskQueue;
 
 public interface BuildAgentTaskQueueManager
@@ -52,7 +53,7 @@
     boolean isProjectInBuildQueue( int projectId )
         throws TaskQueueManagerException;
 
-    boolean isInPrepareBuildQueue( int projectGroupId, int trigger, String scmRootAddress )
+    boolean isInPrepareBuildQueue( int projectGroupId, BuildTrigger buildTrigger, String scmRootAddress )
         throws TaskQueueManagerException;
 
     List<PrepareBuildProjectsTask> getProjectsInPrepareBuildQueue()

Modified: continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/taskqueue/manager/DefaultBuildAgentTaskQueueManager.java Sat Jun 20 17:07:08 2009
@@ -25,6 +25,7 @@
 import org.apache.continuum.buildagent.taskqueue.PrepareBuildProjectsTask;
 import org.apache.continuum.taskqueue.BuildProjectTask;
 import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
@@ -205,7 +206,7 @@
         return false;
     }
 
-    public boolean isInPrepareBuildQueue( int projectGroupId, int trigger, String scmRootAddress )
+    public boolean isInPrepareBuildQueue( int projectGroupId, BuildTrigger buildTrigger, String scmRootAddress )
         throws TaskQueueManagerException
     {
         try
@@ -216,7 +217,7 @@
             {
                 for ( PrepareBuildProjectsTask task : queues )
                 {
-                    if ( task.getProjectGroupId() == projectGroupId && task.getTrigger() == trigger &&
+                	if ( task.getProjectGroupId() == projectGroupId && task.getBuildTrigger().getTrigger() == buildTrigger.getTrigger() &&
                         task.getScmRootAddress().equals( scmRootAddress ) )
                     {
                         log.info( "projects already in build queue" );

Modified: continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/ContinuumBuildAgentUtil.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/ContinuumBuildAgentUtil.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/ContinuumBuildAgentUtil.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-buildagent/continuum-buildagent-core/src/main/java/org/apache/continuum/buildagent/utils/ContinuumBuildAgentUtil.java Sat Jun 20 17:07:08 2009
@@ -30,6 +30,7 @@
 import java.util.Map;
 
 import org.apache.continuum.buildagent.buildcontext.BuildContext;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
@@ -54,6 +55,8 @@
     public static final String KEY_BUILD_DEFINITION_LABEL = "builddefinition-label";
 
     public static final String KEY_TRIGGER = "trigger";
+    
+    public static final String KEY_USERNAME = "username";
 
     public static final String KEY_EXECUTOR_ID = "executor-id";
 
@@ -355,6 +358,16 @@
     {
         return getInteger( context, KEY_TRIGGER );
     }
+    
+    public static String getUsername( Map<String, Object> context )
+    {
+         return getString( context, KEY_USERNAME, "" );
+    }
+    
+    public static BuildTrigger getBuildTrigger( Map<String, Object> context )
+    {
+         return new BuildTrigger( getTrigger( context ), getUsername( context ) );
+    }
 
     public static BuildResult getBuildResult( Map<String, Object> context, Object defaultValue )
     {

Modified: continuum/branches/continuum-1.3.x/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-builder/src/main/java/org/apache/continuum/builder/distributed/executor/DistributedBuildProjectTaskExecutor.java Sat Jun 20 17:07:08 2009
@@ -38,6 +38,7 @@
 import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
 import org.apache.continuum.utils.ContinuumUtils;
 import org.apache.continuum.utils.ProjectSorter;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
@@ -106,7 +107,7 @@
             log.info( "initializing buildContext" );
             List<Map<String, Object>> buildContext =
                 initializeBuildContext( prepareBuildTask.getProjectsBuildDefinitionsMap(),
-                                        prepareBuildTask.getTrigger(), prepareBuildTask.getScmRootAddress(),
+                		                prepareBuildTask.getBuildTrigger(), prepareBuildTask.getScmRootAddress(),
                                         prepareBuildTask.getProjectScmRootId() );
 
             startTime = System.currentTimeMillis();
@@ -127,7 +128,7 @@
     }
 
     private List<Map<String, Object>> initializeBuildContext( Map<Integer, Integer> projectsAndBuildDefinitions,
-                                                              int trigger, String scmRootAddress, int scmRootId )
+    		                                     BuildTrigger buildTrigger, String scmRootAddress, int scmRootId )
         throws ContinuumException
     {
         List<Map<String, Object>> buildContext = new ArrayList<Map<String, Object>>();
@@ -216,7 +217,8 @@
                 {
                     context.put( ContinuumBuildConstant.KEY_ARGUMENTS, buildDef.getArguments() );
                 }
-                context.put( ContinuumBuildConstant.KEY_TRIGGER, trigger );
+                context.put( ContinuumBuildConstant.KEY_TRIGGER, buildTrigger.getTrigger() );
+                context.put( ContinuumBuildConstant.KEY_USERNAME, buildTrigger.getUsername() );
                 context.put( ContinuumBuildConstant.KEY_BUILD_FRESH, buildDef.isBuildFresh() );
                 context.put( ContinuumBuildConstant.KEY_ALWAYS_BUILD, buildDef.isAlwaysBuild() );
                 context.put( ContinuumBuildConstant.KEY_OLD_SCM_CHANGES,
@@ -269,7 +271,8 @@
                         buildResult.setBuildDefinition( buildDef );
                         buildResult.setError( error );
                         buildResult.setState( ContinuumProjectState.ERROR );
-                        buildResult.setTrigger( task.getTrigger() );
+                        buildResult.setTrigger( task.getBuildTrigger().getTrigger() );
+                        buildResult.setUsername( task.getBuildTrigger().getUsername() );
                         buildResult.setStartTime( startTime );
                         buildResult.setEndTime( endTime );
 

Modified: continuum/branches/continuum-1.3.x/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-builder/src/main/java/org/apache/continuum/builder/utils/ContinuumBuildConstant.java Sat Jun 20 17:07:08 2009
@@ -25,6 +25,7 @@
 import java.util.List;
 import java.util.Map;
 
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.model.project.BuildResult;
 
 public class ContinuumBuildConstant
@@ -40,6 +41,10 @@
     public static final String KEY_BUILD_DEFINITION_LABEL = "builddefinition-label";
 
     public static final String KEY_TRIGGER = "trigger";
+    
+    public static final String KEY_USERNAME = "username";
+        
+    public static final String KEY_BUILD_TRIGGER = "buildTrigger";
 
     public static final String KEY_EXECUTOR_ID = "executor-id";
 
@@ -202,6 +207,17 @@
     {
         return getInteger( context, KEY_TRIGGER );
     }
+    
+    public static String getUsername( Map<String, Object> context )
+    {
+        return getString( context, KEY_USERNAME, "" );
+    }
+    
+    public static BuildTrigger getBuildTrigger( Map<String, Object> context )
+    {
+        BuildTrigger defaultValue = new BuildTrigger( 0, "" );
+        return (BuildTrigger) getObject( context, KEY_BUILD_TRIGGER, defaultValue );
+    }
 
     public static long getStartTime( Map<String, Object> context )
     {

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/manager/DefaultDistributedBuildManager.java Sat Jun 20 17:07:08 2009
@@ -41,6 +41,7 @@
 import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
 import org.apache.continuum.utils.ContinuumUtils;
 import org.apache.continuum.utils.ProjectSorter;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -211,11 +212,11 @@
         }
     }
 
-    public void prepareBuildProjects( Map<Integer, Integer>projectsBuildDefinitionsMap, int trigger, int projectGroupId, 
+    public void prepareBuildProjects( Map<Integer, Integer>projectsBuildDefinitionsMap, BuildTrigger buildTrigger, int projectGroupId, 
                                       String projectGroupName, String scmRootAddress, int scmRootId )
         throws ContinuumException
     {
-        PrepareBuildProjectsTask task = new PrepareBuildProjectsTask( projectsBuildDefinitionsMap, trigger,
+    	PrepareBuildProjectsTask task = new PrepareBuildProjectsTask( projectsBuildDefinitionsMap, buildTrigger,
                                                                       projectGroupId, projectGroupName, 
                                                                       scmRootAddress, scmRootId );
 
@@ -1065,19 +1066,19 @@
         int projectGroupId = ContinuumBuildConstant.getProjectGroupId( context );
         int scmRootId = ContinuumBuildConstant.getScmRootId( context );
         String scmRootAddress = ContinuumBuildConstant.getScmRootAddress( context );
-        int trigger = ContinuumBuildConstant.getTrigger( context );
+        BuildTrigger buildTrigger = new BuildTrigger( ContinuumBuildConstant.getTrigger( context ), ContinuumBuildConstant.getUsername( context ) );
 
-        return new PrepareBuildProjectsTask( null, trigger, projectGroupId, null, scmRootAddress, scmRootId );
+        return new PrepareBuildProjectsTask( null, buildTrigger, projectGroupId, null, scmRootAddress, scmRootId );
     }
 
     private BuildProjectTask getBuildProjectTask( Map context )
     {
         int projectId = ContinuumBuildConstant.getProjectId( context );
         int buildDefinitionId = ContinuumBuildConstant.getBuildDefinitionId( context );
-        int trigger = ContinuumBuildConstant.getTrigger( context );
+        BuildTrigger buildTrigger = new BuildTrigger( ContinuumBuildConstant.getTrigger( context ), ContinuumBuildConstant.getUsername( context ) );
         int projectGroupId = ContinuumBuildConstant.getProjectGroupId( context );
         String buildDefinitionLabel = ContinuumBuildConstant.getBuildDefinitionLabel( context );
 
-        return new BuildProjectTask( projectId, buildDefinitionId, trigger, null, buildDefinitionLabel, null, projectGroupId );
+        return new BuildProjectTask( projectId, buildDefinitionId, buildTrigger, null, buildDefinitionLabel, null, projectGroupId );
     }
 }
\ No newline at end of file

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/util/DistributedBuildUtil.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/util/DistributedBuildUtil.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/util/DistributedBuildUtil.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/builder/distributed/util/DistributedBuildUtil.java Sat Jun 20 17:07:08 2009
@@ -45,6 +45,7 @@
         buildResult.setExitCode( ContinuumBuildConstant.getBuildExitCode( context ) );
         buildResult.setState( ContinuumBuildConstant.getBuildState( context ) );
         buildResult.setTrigger( ContinuumBuildConstant.getTrigger( context ) );
+        buildResult.setUsername( ContinuumBuildConstant.getUsername( context ) );
         buildResult.setBuildUrl( ContinuumBuildConstant.getBuildAgentUrl( context ) );
     
         return buildResult;

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/buildmanager/ParallelBuildsManager.java Sat Jun 20 17:07:08 2009
@@ -38,6 +38,7 @@
 import org.apache.continuum.taskqueue.OverallBuildQueue;
 import org.apache.continuum.taskqueue.PrepareBuildProjectsTask;
 import org.apache.continuum.taskqueueexecutor.ParallelBuildsThreadedTaskQueueExecutor;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildQueue;
@@ -96,9 +97,9 @@
     private PlexusContainer container;
 
     /**
-     * @see BuildsManager#buildProject(int, BuildDefinition, String, int, ScmResult, int)
+     * @see BuildsManager#buildProject(int, BuildDefinition, String, BuildTrigger, ScmResult, int)
      */
-    public void buildProject( int projectId, BuildDefinition buildDefinition, String projectName, int trigger,
+    public void buildProject( int projectId, BuildDefinition buildDefinition, String projectName, BuildTrigger buildTrigger,
                               ScmResult scmResult, int projectGroupId )
         throws BuildManagerException
     {
@@ -133,7 +134,7 @@
             }
     
             BuildProjectTask buildTask =
-                new BuildProjectTask( projectId, buildDefinition.getId(), trigger, projectName, buildDefinitionLabel,
+            	new BuildProjectTask( projectId, buildDefinition.getId(), buildTrigger, projectName, buildDefinitionLabel,
                                       scmResult, projectGroupId );
             try
             {
@@ -153,10 +154,10 @@
     }
 
     /**
-     * @see BuildsManager#buildProjects(List, Map, int, Map, int)
+     * @see BuildsManager#buildProjects(List, Map, BuildTrigger, Map, int)
      */
     public void buildProjects( List<Project> projects, Map<Integer, BuildDefinition> projectsBuildDefinitionsMap,
-                               int trigger, Map<Integer, ScmResult> scmResultMap, int projectGroupId )
+    		                   BuildTrigger buildTrigger, Map<Integer, ScmResult> scmResultMap, int projectGroupId )
         throws BuildManagerException
     {
         int firstProjectId = 0;
@@ -216,7 +217,7 @@
 
                     ScmResult scmResult = scmResultMap.get( project.getId() );
                     BuildProjectTask buildTask =
-                        new BuildProjectTask( project.getId(), buildDefinition.getId(), trigger, project.getName(),
+                    	new BuildProjectTask( project.getId(), buildDefinition.getId(), buildTrigger, project.getName(),
                                               buildDefinitionLabel, scmResult, projectGroupId );
                     buildTask.setMaxExecutionTime( buildDefinition.getSchedule().getMaxJobExecutionTime() * 1000 );
 
@@ -569,9 +570,9 @@
     }
 
     /**
-     * @see BuildsManager#prepareBuildProjects(Map, int, int, String, String, int)
+     * @see BuildsManager#prepareBuildProjects(Map, BuildTrigger, int, String, String, int)
      */
-    public void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, int trigger,
+    public void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, BuildTrigger buildTrigger,
                                       int projectGroupId, String projectGroupName, String scmRootAddress,
                                       int scmRootId )
         throws BuildManagerException
@@ -579,7 +580,7 @@
         try
         {
             PrepareBuildProjectsTask task =
-                new PrepareBuildProjectsTask( projectsBuildDefinitionsMap, trigger, projectGroupId, projectGroupName,
+            	new PrepareBuildProjectsTask( projectsBuildDefinitionsMap, buildTrigger, projectGroupId, projectGroupName,
                                               scmRootAddress, scmRootId );
 
             log.info( "Queueing prepare-build-project task '" + task + "' to prepare-build queue." );
@@ -618,10 +619,10 @@
     }
 
     /**
-     * @see BuildsManager#removeProjectFromBuildQueue(int, int, int, String)
+     * @see BuildsManager#removeProjectFromBuildQueue(int, int, BuildTrigger, String, int)
      */
-    public void removeProjectFromBuildQueue( int projectId, int buildDefinitionId, int trigger, String projectName,
-                                             int projectGroupId )
+    public void removeProjectFromBuildQueue( int projectId, int buildDefinitionId, BuildTrigger buildTrigger,
+    		                                 String projectName, int projectGroupId )
         throws BuildManagerException
     {
         try
@@ -629,7 +630,7 @@
             OverallBuildQueue overallBuildQueue = getOverallBuildQueueWhereProjectIsQueued( projectId, BUILD_QUEUE );
             if ( overallBuildQueue != null )
             {
-                overallBuildQueue.removeProjectFromBuildQueue( projectId, buildDefinitionId, trigger, projectName,
+            	overallBuildQueue.removeProjectFromBuildQueue( projectId, buildDefinitionId, buildTrigger, projectName,
                                                                projectGroupId );
             }
             else
@@ -889,7 +890,7 @@
                     buildDefinitionDao.getBuildDefinition( buildTask.getBuildDefinitionId() );
 
                 buildProject( buildTask.getProjectId(), buildDefinition, buildTask.getProjectName(),
-                              buildTask.getTrigger(), buildTask.getScmResult(), buildTask.getProjectGroupId() );
+                		      buildTask.getBuildTrigger(), buildTask.getScmResult(), buildTask.getProjectGroupId() );
             }
             catch ( ContinuumStoreException e )
             {

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/taskqueue/DefaultOverallBuildQueue.java Sat Jun 20 17:07:08 2009
@@ -27,6 +27,7 @@
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.continuum.dao.BuildDefinitionDao;
 import org.apache.continuum.taskqueueexecutor.ParallelBuildsThreadedTaskQueueExecutor;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.codehaus.plexus.taskqueue.Task;
@@ -323,10 +324,10 @@
     }
 
     /**
-     * @see OverallBuildQueue#removeProjectFromBuildQueue(int, int, int, String, int)
+     * @see OverallBuildQueue#removeProjectFromBuildQueue(int, int, BuildTrigger, String, int)
      */
-    public boolean removeProjectFromBuildQueue( int projectId, int buildDefinitionId, int trigger, String projectName,
-                                                int projectGroupId )
+    public boolean removeProjectFromBuildQueue( int projectId, int buildDefinitionId, BuildTrigger buildTrigger,
+    		                                    String projectName, int projectGroupId )
         throws TaskQueueException
     {
         BuildDefinition buildDefinition;
@@ -348,7 +349,7 @@
         }
 
         BuildProjectTask buildProjectTask =
-            new BuildProjectTask( projectId, buildDefinitionId, trigger, projectName, 
+        	                      new BuildProjectTask( projectId, buildDefinitionId, buildTrigger, projectName, 
                                   buildDefinitionLabel, null, projectGroupId );
 
         return getBuildQueue().remove( buildProjectTask );

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Sat Jun 20 17:07:08 2009
@@ -58,6 +58,7 @@
 import org.apache.continuum.taskqueue.manager.TaskQueueManager;
 import org.apache.continuum.taskqueue.manager.TaskQueueManagerException;
 import org.apache.continuum.utils.ProjectSorter;
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.build.settings.SchedulesActivationException;
 import org.apache.maven.continuum.build.settings.SchedulesActivator;
 import org.apache.maven.continuum.builddefinition.BuildDefinitionService;
@@ -791,16 +792,16 @@
     // Building
     // ----------------------------------------------------------------------
 
-    public void buildProjects()
+    public void buildProjects( String username )
         throws ContinuumException
     {
-        buildProjects( ContinuumProjectState.TRIGGER_FORCED );
+    	buildProjects( new BuildTrigger( ContinuumProjectState.TRIGGER_FORCED, username ) );
     }
 
     public void buildProjectsWithBuildDefinition( int buildDefinitionId )
         throws ContinuumException
     {
-        buildProjects( ContinuumProjectState.TRIGGER_FORCED, buildDefinitionId );
+    	buildProjects( new BuildTrigger( ContinuumProjectState.TRIGGER_FORCED, "" ), buildDefinitionId );
     }
 
     public void buildProjectsWithBuildDefinition( List<Project> projects, List<BuildDefinition> bds )
@@ -808,7 +809,7 @@
     {
         Collection<Project> filteredProjectsList = getProjectsNotInReleaseStage( projects );
 
-        prepareBuildProjects( filteredProjectsList, bds, true, ContinuumProjectState.TRIGGER_FORCED );
+        prepareBuildProjects( filteredProjectsList, bds, true, new BuildTrigger( ContinuumProjectState.TRIGGER_FORCED, "" ) );
     }
 
     public void buildProjectsWithBuildDefinition( List<Project> projects, int buildDefinitionId )
@@ -816,49 +817,50 @@
     {
         Collection<Project> filteredProjectsList = getProjectsNotInReleaseStage( projects );
 
-        prepareBuildProjects( filteredProjectsList, buildDefinitionId, ContinuumProjectState.TRIGGER_FORCED );
+        prepareBuildProjects( filteredProjectsList, buildDefinitionId, new BuildTrigger( ContinuumProjectState.TRIGGER_FORCED, "" ) );
     }
 
     /**
      * fire of the builds of all projects across all project groups using their default build definitions
      *
-     * @param trigger
+     * @param buildTrigger
      * @throws ContinuumException
      */
-    public void buildProjects( int trigger )
+    public void buildProjects( BuildTrigger buildTrigger )
         throws ContinuumException
     {
         Collection<Project> projectsList = getProjectsInBuildOrder();
 
         Collection<Project> filteredProjectsList = getProjectsNotInReleaseStage( projectsList );
 
-        prepareBuildProjects( filteredProjectsList, null, true, trigger );
+        prepareBuildProjects( filteredProjectsList, null, true, buildTrigger );
     }
 
     /**
      * fire of the builds of all projects across all project groups using the group build definition
      *
-     * @param trigger
+     * @param buildTrigger
      * @param buildDefinitionId
      * @throws ContinuumException
      */
-    public void buildProjects( int trigger, int buildDefinitionId )
+    public void buildProjects( BuildTrigger buildTrigger, int buildDefinitionId )
         throws ContinuumException
     {
         Collection<Project> projectsList = getProjectsInBuildOrder();
 
         Collection<Project> filteredProjectsList = getProjectsNotInReleaseStage( projectsList );
 
-        prepareBuildProjects( filteredProjectsList, buildDefinitionId, trigger );
+        prepareBuildProjects( filteredProjectsList, buildDefinitionId, buildTrigger );
     }
 
     /**
      * fire off a build for all of the projects in a project group using their default builds
      *
      * @param projectGroupId
+     * @param buildTrigger
      * @throws ContinuumException
      */
-    public void buildProjectGroup( int projectGroupId )
+    public void buildProjectGroup( int projectGroupId, BuildTrigger buildTrigger )
         throws ContinuumException
     {
         List<BuildDefinition> groupDefaultBDs;
@@ -867,7 +869,7 @@
         {
             groupDefaultBDs = getDefaultBuildDefinitionsForProjectGroup( projectGroupId );
 
-            buildProjectGroupWithBuildDefinition( projectGroupId, groupDefaultBDs, true );
+            buildProjectGroupWithBuildDefinition( projectGroupId, groupDefaultBDs, true, buildTrigger );
         }
     }
 
@@ -876,9 +878,10 @@
      *
      * @param projectGroupId    the project group id
      * @param buildDefinitionId the build definition id to use
+     * @param buildTrigger      the trigger state and the username
      * @throws ContinuumException
      */
-    public void buildProjectGroupWithBuildDefinition( int projectGroupId, int buildDefinitionId )
+    public void buildProjectGroupWithBuildDefinition( int projectGroupId, int buildDefinitionId, BuildTrigger buildTrigger )
         throws ContinuumException
     {
         if ( !isAnyProjectInGroupInReleaseStage( projectGroupId ) )
@@ -889,7 +892,7 @@
             {
                 bds.add( bd );
             }
-            buildProjectGroupWithBuildDefinition( projectGroupId, bds, false );
+            buildProjectGroupWithBuildDefinition( projectGroupId, bds, false, buildTrigger );
         }
     }
 
@@ -897,10 +900,13 @@
      * fire off a build for all of the projects in a project group using their default builds
      *
      * @param projectGroupId
+     * @param bds
+     * @param checkDefaultBuildDefinitionForProject
+     * @param buildTrigger
      * @throws ContinuumException
      */
     private void buildProjectGroupWithBuildDefinition( int projectGroupId, List<BuildDefinition> bds,
-                                                       boolean checkDefaultBuildDefinitionForProject )
+    		                                   boolean checkDefaultBuildDefinitionForProject, BuildTrigger buildTrigger )
         throws ContinuumException
     {
         if ( !isAnyProjectInGroupInReleaseStage( projectGroupId ) )
@@ -908,9 +914,10 @@
             Collection<Project> projectsList;
 
             projectsList = getProjectsInBuildOrder( projectDao.getProjectsWithDependenciesByGroupId( projectGroupId ) );
+            
+            buildTrigger.setTrigger( ContinuumProjectState.TRIGGER_FORCED );
 
-            prepareBuildProjects( projectsList, bds, checkDefaultBuildDefinitionForProject,
-                                  ContinuumProjectState.TRIGGER_FORCED );
+            prepareBuildProjects( projectsList, bds, checkDefaultBuildDefinitionForProject, buildTrigger );
         }
     }
 
@@ -1002,22 +1009,23 @@
             }
         }
 
-        prepareBuildProjects( map, ContinuumProjectState.TRIGGER_SCHEDULED, sortedScmRoot );
+        prepareBuildProjects( map, new BuildTrigger( ContinuumProjectState.TRIGGER_SCHEDULED, "" ), sortedScmRoot );
     }
 
-    public void buildProject( int projectId )
+    public void buildProject( int projectId, String username )
         throws ContinuumException
     {
-        buildProject( projectId, ContinuumProjectState.TRIGGER_FORCED );
+    	buildProject( projectId, new BuildTrigger( ContinuumProjectState.TRIGGER_FORCED, username ) );
     }
 
-    public void buildProjectWithBuildDefinition( int projectId, int buildDefinitionId )
+    public void buildProjectWithBuildDefinition( int projectId, int buildDefinitionId, BuildTrigger buildTrigger )
         throws ContinuumException
     {
-        buildProject( projectId, buildDefinitionId, ContinuumProjectState.TRIGGER_FORCED );
+    	buildTrigger.setTrigger( ContinuumProjectState.TRIGGER_FORCED );
+    	buildProject( projectId, buildDefinitionId, buildTrigger );
     }
 
-    public void buildProject( int projectId, int trigger )
+    public void buildProject( int projectId, BuildTrigger buildTrigger )
         throws ContinuumException
     {
         Project project = getProject( projectId );
@@ -1051,11 +1059,11 @@
         projectsBuildDefinitionsMap.put( projectId, buildDef.getId() );
 
         ProjectScmRoot scmRoot = getProjectScmRootByProject( projectId );
-        prepareBuildProjects( projectsBuildDefinitionsMap, trigger, scmRoot.getScmRootAddress(),
+        prepareBuildProjects( projectsBuildDefinitionsMap, buildTrigger, scmRoot.getScmRootAddress(),
                               scmRoot.getProjectGroup().getId(), scmRoot.getId() );
     }
 
-    public void buildProject( int projectId, int buildDefinitionId, int trigger )
+    public void buildProject( int projectId, int buildDefinitionId, BuildTrigger buildTrigger )
         throws ContinuumException
     {
         Project project = getProject( projectId );
@@ -1082,7 +1090,7 @@
         projectsBuildDefinitionsMap.put( projectId, buildDefinitionId );
 
         ProjectScmRoot scmRoot = getProjectScmRootByProject( projectId );
-        prepareBuildProjects( projectsBuildDefinitionsMap, trigger, scmRoot.getScmRootAddress(),
+        prepareBuildProjects( projectsBuildDefinitionsMap, buildTrigger, scmRoot.getScmRootAddress(),
                               scmRoot.getProjectGroup().getId(), scmRoot.getId() );
     }
 
@@ -3405,7 +3413,7 @@
     }
 
     private void prepareBuildProjects( Collection<Project> projects, List<BuildDefinition> bds,
-                                       boolean checkDefaultBuildDefinitionForProject, int trigger )
+    		                           boolean checkDefaultBuildDefinitionForProject, BuildTrigger buildTrigger )
         throws ContinuumException
     {
         Map<ProjectScmRoot, Map<Integer, Integer>> map = new HashMap<ProjectScmRoot, Map<Integer, Integer>>();
@@ -3501,10 +3509,10 @@
             }
         }
 
-        prepareBuildProjects( map, trigger, sortedScmRoot );
+        prepareBuildProjects( map, buildTrigger, sortedScmRoot );
     }
 
-    private void prepareBuildProjects( Collection<Project> projects, int buildDefinitionId, int trigger )
+    private void prepareBuildProjects( Collection<Project> projects, int buildDefinitionId, BuildTrigger buildTrigger )
         throws ContinuumException
     {
         Map<ProjectScmRoot, Map<Integer, Integer>> map = new HashMap<ProjectScmRoot, Map<Integer, Integer>>();
@@ -3555,21 +3563,21 @@
             }
         }
 
-        prepareBuildProjects( map, trigger, sortedScmRoot );
+        prepareBuildProjects( map, buildTrigger, sortedScmRoot );
     }
 
-    private void prepareBuildProjects( Map<ProjectScmRoot, Map<Integer, Integer>> map, int trigger,
+    private void prepareBuildProjects( Map<ProjectScmRoot, Map<Integer, Integer>> map, BuildTrigger buildTrigger,
                                        List<ProjectScmRoot> scmRoots )
         throws ContinuumException
     {
         for ( ProjectScmRoot scmRoot : scmRoots )
         {
-            prepareBuildProjects( map.get( scmRoot ), trigger, scmRoot.getScmRootAddress(),
+        	prepareBuildProjects( map.get( scmRoot ), buildTrigger, scmRoot.getScmRootAddress(),
                                   scmRoot.getProjectGroup().getId(), scmRoot.getId() );
         }
     }
 
-    private void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, int trigger,
+    private void prepareBuildProjects( Map<Integer, Integer> projectsBuildDefinitionsMap, BuildTrigger buildTrigger,
                                        String scmRootAddress, int projectGroupId, int scmRootId )
         throws ContinuumException
     {
@@ -3579,12 +3587,12 @@
         {
             if ( configurationService.isDistributedBuildEnabled() )
             {
-                distributedBuildManager.prepareBuildProjects( projectsBuildDefinitionsMap, trigger, projectGroupId,
+            	distributedBuildManager.prepareBuildProjects( projectsBuildDefinitionsMap, buildTrigger, projectGroupId, 
                                                               group.getName(), scmRootAddress, scmRootId );
             }
             else
             {
-                parallelBuildsManager.prepareBuildProjects( projectsBuildDefinitionsMap, trigger, projectGroupId,
+            	parallelBuildsManager.prepareBuildProjects( projectsBuildDefinitionsMap, buildTrigger, projectGroupId,
                                                             group.getName(), scmRootAddress, scmRootId );
             }
         }

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildContext.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildContext.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildContext.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildContext.java Sat Jun 20 17:07:08 2009
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
@@ -51,7 +52,7 @@
 
     private ScmResult scmResult;
 
-    private int trigger;
+    private BuildTrigger buildTrigger;
 
     private BuildResult buildResult;
 
@@ -138,14 +139,14 @@
         return actionContext;
     }
 
-    public int getTrigger()
+    public BuildTrigger getBuildTrigger()
     {
-        return trigger;
+    	return buildTrigger;
     }
 
-    public void setTrigger( int trigger )
+    public void setBuildTrigger( BuildTrigger buildTrigger )
     {
-        this.trigger = trigger;
+    	this.buildTrigger = buildTrigger;
     }
 
     public List<ProjectDependency> getModifiedDependencies()

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildController.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildController.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildController.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildController.java Sat Jun 20 17:07:08 2009
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.continuum.utils.build.BuildTrigger;
 import org.apache.maven.continuum.model.scm.ScmResult;
 import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
 
@@ -30,6 +31,6 @@
 {
     String ROLE = BuildController.class.getName();
 
-    void build( int projectId, int buildDefinitionId, int trigger, ScmResult scmResult )
+    void build( int projectId, int buildDefinitionId, BuildTrigger buildTrigger, ScmResult scmResult )
         throws TaskExecutionException;
 }

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java?rev=786863&r1=786862&r2=786863&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java (original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/BuildProjectTaskExecutor.java Sat Jun 20 17:07:08 2009
@@ -46,6 +46,6 @@
         BuildProjectTask buildProjectTask = (BuildProjectTask) task;
 
         controller.build( buildProjectTask.getProjectId(), buildProjectTask.getBuildDefinitionId(), buildProjectTask
-            .getTrigger(), buildProjectTask.getScmResult() );
+        		.getBuildTrigger(), buildProjectTask.getScmResult() );
     }
 }



Mime
View raw message