continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r644980 - in /continuum/trunk: continuum-api/ continuum-api/src/main/java/org/apache/maven/continuum/buildqueue/ continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/ continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apa...
Date Fri, 04 Apr 2008 22:49:24 GMT
Author: olamy
Date: Fri Apr  4 15:49:12 2008
New Revision: 644980

URL: http://svn.apache.org/viewvc?rev=644980&view=rev
Log:
[CONTINUUM-1628] 2 new methods for editing building queue with xmlrpc
Submitted by Franck Hugot 
fixes applied on the patch


Added:
    continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/buildqueue/
    continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java
      - copied, changed from r643588, continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java
Removed:
    continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java
Modified:
    continuum/trunk/continuum-api/pom.xml
    continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java
    continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml
    continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java
    continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
    continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/resources/dozerBeanMapping.xml

Modified: continuum/trunk/continuum-api/pom.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/pom.xml?rev=644980&r1=644979&r2=644980&view=diff
==============================================================================
--- continuum/trunk/continuum-api/pom.xml (original)
+++ continuum/trunk/continuum-api/pom.xml Fri Apr  4 15:49:12 2008
@@ -43,5 +43,9 @@
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-jdo2</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-taskqueue</artifactId>
+    </dependency>
   </dependencies>
 </project>

Copied: continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java
(from r643588, continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java)
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java?p2=continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java&p1=continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java&r1=643588&r2=644980&rev=644980&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java
(original)
+++ continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/buildqueue/BuildProjectTask.java
Fri Apr  4 15:49:12 2008
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import java.io.Serializable;
+
 import org.codehaus.plexus.taskqueue.Task;
 
 /**
@@ -26,7 +28,7 @@
  * @version $Id$
  */
 public class BuildProjectTask
-    implements Task
+    implements Task, Serializable
 {    
     private int projectId;
 

Modified: continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java?rev=644980&r1=644979&r2=644980&view=diff
==============================================================================
--- continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java
(original)
+++ continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java
Fri Apr  4 15:49:12 2008
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import java.util.List;
+
 import org.apache.maven.continuum.xmlrpc.project.AddingResult;
 import org.apache.maven.continuum.xmlrpc.project.BuildDefinition;
 import org.apache.maven.continuum.xmlrpc.project.BuildDefinitionTemplate;
@@ -34,8 +36,6 @@
 import org.apache.maven.continuum.xmlrpc.system.SystemConfiguration;
 import org.apache.xmlrpc.XmlRpcException;
 
-import java.util.List;
-
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  * @version $Id$
@@ -569,6 +569,28 @@
 
     SystemConfiguration getSystemConfiguration()
         throws Exception;
+    
+    // ----------------------------------------------------------------------
+    // Queue
+    // ----------------------------------------------------------------------
+    
+        
+        /**
+     * Return true is the project is in building queue.
+     *
+     * @param projectGroupId    The project group id
+     * @throws ContinuumException
+     */
+    boolean isProjectInBuildingQueue( int projectId )
+        throws Exception;
+
+    /**
+     * Return projects building queue.
+     *
+     * @throws ContinuumException
+     */
+    public List getProjectsInBuildQueue()
+        throws Exception;    
 
     // ----------------------------------------------------------------------
     // TODO:Users

Modified: continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml?rev=644980&r1=644979&r2=644980&view=diff
==============================================================================
--- continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml
(original)
+++ continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml
Fri Apr  4 15:49:12 2008
@@ -1128,5 +1128,49 @@
         </codeSegment>
       </codeSegments>
     </class>
+
+    <class>
+      <name>BuildProjectTask</name>
+      <packageName>org.apache.maven.continuum.xmlrpc.project</packageName>
+      <version>1.1.0+</version>
+      <fields>
+        <field>
+          <name>projectId</name>
+          <version>1.1.0+</version>
+          <type>int</type>
+        </field>
+        <field>
+          <name>buildDefinitionId</name>
+          <version>1.1.0+</version>
+          <type>int</type>
+        </field>
+        <field>
+          <name>timestamp</name>
+          <version>1.1.0+</version>
+          <type>long</type>
+        </field>
+        <field>
+          <name>trigger</name>
+          <version>1.1.0+</version>
+          <type>int</type>
+        </field>
+        <field>
+          <name>maxExecutionTime</name>
+          <version>1.1.0+</version>
+          <type>long</type>
+        </field>
+        <field>
+          <name>projectName</name>
+          <version>1.1.0+</version>
+          <type>String</type>
+        </field>
+        <field>
+          <name>buildDefinitionLabel</name>
+          <version>1.1.0+</version>
+          <type>String</type>
+        </field>
+      </fields>
+    </class>    
+    
   </classes>
 </model>

Modified: continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java?rev=644980&r1=644979&r2=644980&view=diff
==============================================================================
--- continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java
(original)
+++ continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java
Fri Apr  4 15:49:12 2008
@@ -499,4 +499,21 @@
     {
         return (String) statusMap.get( new Integer( status ) );
     }
+
+    // ----------------------------------------------------------------------
+    // Queue
+    // ----------------------------------------------------------------------
+
+    public List getProjectsInBuildQueue()
+        throws Exception
+    {
+        return continuum.getProjectsInBuildQueue();
+    }
+
+    public boolean isProjectInBuildingQueue( int projectId )
+        throws Exception
+    {
+        return continuum.isProjectInBuildingQueue( projectId );
+    }
+        
 }

Modified: continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java?rev=644980&r1=644979&r2=644980&view=diff
==============================================================================
--- continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
(original)
+++ continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
Fri Apr  4 15:49:12 2008
@@ -19,8 +19,14 @@
  * under the License.
  */
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
 import net.sf.dozer.util.mapping.DozerBeanMapperSingletonWrapper;
 import net.sf.dozer.util.mapping.MapperIF;
+
 import org.apache.maven.continuum.Continuum;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
@@ -33,6 +39,7 @@
 import org.apache.maven.continuum.xmlrpc.project.AddingResult;
 import org.apache.maven.continuum.xmlrpc.project.BuildDefinition;
 import org.apache.maven.continuum.xmlrpc.project.BuildDefinitionTemplate;
+import org.apache.maven.continuum.xmlrpc.project.BuildProjectTask;
 import org.apache.maven.continuum.xmlrpc.project.BuildResult;
 import org.apache.maven.continuum.xmlrpc.project.BuildResultSummary;
 import org.apache.maven.continuum.xmlrpc.project.Project;
@@ -48,11 +55,6 @@
 import org.codehaus.plexus.redback.role.RoleManagerException;
 import org.codehaus.plexus.util.StringUtils;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
 /**
  * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
  * @version $Id$
@@ -782,9 +784,38 @@
     }
 
     // ----------------------------------------------------------------------
+    // Queue
+    // ----------------------------------------------------------------------
+
+
+    public boolean isProjectInBuildingQueue( int projectId )
+        throws ContinuumException
+    {
+        return continuum.isInBuildingQueue( projectId );
+    }
+
+    public List getProjectsInBuildQueue()
+        throws ContinuumException
+    {
+        return populateBuildProjectTaskList( continuum.getProjectsInBuildQueue() );
+    }
+
+    // ----------------------------------------------------------------------
     // Converters
     // ----------------------------------------------------------------------
 
+    private List populateBuildProjectTaskList(
+                                               List<org.apache.maven.continuum.buildqueue.BuildProjectTask>
buildProjectTasks )
+    {
+        List<BuildProjectTask> responses = new ArrayList<BuildProjectTask>();
+        for ( org.apache.maven.continuum.buildqueue.BuildProjectTask buildProjectTask : buildProjectTasks
)
+        {
+
+            responses.add( (BuildProjectTask) mapper.map( buildProjectTask, BuildProjectTask.class
) );
+        }
+        return responses;
+    }
+    
     private ProjectSummary populateProjectSummary( org.apache.maven.continuum.model.project.Project
project )
     {
         return (ProjectSummary) mapper.map( project, ProjectSummary.class );

Modified: continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/resources/dozerBeanMapping.xml
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/resources/dozerBeanMapping.xml?rev=644980&r1=644979&r2=644980&view=diff
==============================================================================
--- continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/resources/dozerBeanMapping.xml
(original)
+++ continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/resources/dozerBeanMapping.xml
Fri Apr  4 15:49:12 2008
@@ -195,4 +195,9 @@
       <b-hint>org.apache.maven.continuum.model.project.BuildDefinition</b-hint>
     </field>
   </mapping>
+  
+  <mapping>
+    <class-a>org.apache.maven.continuum.buildqueue.BuildProjectTask</class-a>
+    <class-b>org.apache.maven.continuum.xmlrpc.project.BuildProjectTask</class-b>
+  </mapping>  
 </mappings>



Mime
View raw message