continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r553918 - in /maven/continuum/trunk/continuum-xmlrpc: continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ continuum-xmlrpc-api/src/main/mdo/ continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ c...
Date Fri, 06 Jul 2007 15:06:46 GMT
Author: evenisse
Date: Fri Jul  6 08:06:45 2007
New Revision: 553918

URL: http://svn.apache.org/viewvc?view=rev&rev=553918
Log:
Add methods to read build definitions

Modified:
    maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java
    maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml
    maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java
    maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java

Modified: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java?view=diff&rev=553918&r1=553917&r2=553918
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java
(original)
+++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java
Fri Jul  6 08:06:45 2007
@@ -140,6 +140,32 @@
         throws ContinuumException, XmlRpcException;
 
     // ----------------------------------------------------------------------
+    // Build Definitions
+    // ----------------------------------------------------------------------
+
+    /**
+     * Get the build definitions list of the project.
+     *
+     * @param projectId The project id
+     * @return The build definitions list
+     * @throws ContinuumException
+     * @throws XmlRpcException
+     */
+    List getBuildDefinitionsForProject( int projectId )
+        throws ContinuumException, XmlRpcException;
+
+    /**
+     * Get the build definitions list of the project group.
+     *
+     * @param projectGroupId The project group id
+     * @return The build definitions list
+     * @throws ContinuumException
+     * @throws XmlRpcException
+     */
+    List getBuildDefinitionsForProjectGroup( int projectGroupId )
+        throws ContinuumException, XmlRpcException;
+
+    // ----------------------------------------------------------------------
     // Building
     // ----------------------------------------------------------------------
 

Modified: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml?view=diff&rev=553918&r1=553917&r2=553918
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml
(original)
+++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml
Fri Jul  6 08:06:45 2007
@@ -906,12 +906,6 @@
             <type>Profile</type>
           </association>
         </field>
-        <field>
-          <name>latestBuildId</name>
-          <version>1.1.0+</version>
-          <type>int</type>
-          <defaultValue>0</defaultValue>
-        </field>
       </fields>
     </class>
 

Modified: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java?view=diff&rev=553918&r1=553917&r2=553918
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java
(original)
+++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java
Fri Jul  6 08:06:45 2007
@@ -269,6 +269,36 @@
     }
 
     // ----------------------------------------------------------------------
+    // Build Definitions
+    // ----------------------------------------------------------------------
+
+    public List getBuildDefinitionsForProject( int projectId )
+        throws ContinuumException
+    {
+        try
+        {
+            return continuum.getBuildDefinitionsForProject( projectId );
+        }
+        catch ( Exception e )
+        {
+            throw new ContinuumException( "The remote method failed.", e );
+        }
+    }
+
+    public List getBuildDefinitionsForProjectGroup( int projectGroupId )
+        throws ContinuumException
+    {
+        try
+        {
+            return continuum.getBuildDefinitionsForProjectGroup( projectGroupId );
+        }
+        catch ( Exception e )
+        {
+            throw new ContinuumException( "The remote method failed.", e );
+        }
+    }
+
+    // ----------------------------------------------------------------------
     // Building
     // ----------------------------------------------------------------------
 
@@ -283,7 +313,6 @@
         {
             throw new ContinuumException( "The remote method failed.", e );
         }
-
     }
 
     public int addProjectToBuildQueue( int projectId, int buildDefinitionId )
@@ -297,7 +326,6 @@
         {
             throw new ContinuumException( "The remote method failed.", e );
         }
-
     }
 
     public int buildProject( int projectId )

Modified: maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java?view=diff&rev=553918&r1=553917&r2=553918
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
(original)
+++ maven/continuum/trunk/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
Fri Jul  6 08:06:45 2007
@@ -24,6 +24,7 @@
 import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
 import org.apache.maven.continuum.xmlrpc.project.AddingResult;
+import org.apache.maven.continuum.xmlrpc.project.BuildDefinition;
 import org.apache.maven.continuum.xmlrpc.project.BuildResult;
 import org.apache.maven.continuum.xmlrpc.project.BuildResultSummary;
 import org.apache.maven.continuum.xmlrpc.project.Project;
@@ -39,7 +40,6 @@
 import org.apache.maven.continuum.xmlrpc.test.SuiteResult;
 import org.apache.maven.continuum.xmlrpc.test.TestCaseFailure;
 import org.apache.maven.continuum.xmlrpc.test.TestResult;
-import org.apache.xmlrpc.XmlRpcException;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -185,7 +185,7 @@
     }
 
     public ProjectGroupSummary updateProjectGroup( ProjectGroupSummary projectGroup )
-        throws ContinuumException, XmlRpcException
+        throws ContinuumException
     {
         checkModifyProjectGroupAuthorization( getProjectGroupName( projectGroup.getId() )
);
 
@@ -194,6 +194,46 @@
     }
 
     // ----------------------------------------------------------------------
+    // Build Definitions
+    // ----------------------------------------------------------------------
+
+    public List getBuildDefinitionsForProject( int projectId )
+        throws ContinuumException
+    {
+        ProjectSummary ps = getProjectSummary( projectId );
+
+        checkViewProjectGroupAuthorization( ps.getProjectGroup().getName() );
+
+        List bds = continuum.getBuildDefinitionsForProject( projectId );
+
+        List result = new ArrayList();
+        for ( Iterator i = bds.iterator(); i.hasNext(); )
+        {
+            result.add(
+                populateBuildDefinition( (org.apache.maven.continuum.model.project.BuildDefinition)
i.next() ) );
+        }
+        return result;
+    }
+
+    public List getBuildDefinitionsForProjectGroup( int projectGroupId )
+        throws ContinuumException
+    {
+        ProjectGroupSummary pgs = getProjectGroupSummary( projectGroupId );
+
+        checkViewProjectGroupAuthorization( pgs.getName() );
+
+        List bds = continuum.getBuildDefinitionsForProjectGroup( projectGroupId );
+
+        List result = new ArrayList();
+        for ( Iterator i = bds.iterator(); i.hasNext(); )
+        {
+            result.add(
+                populateBuildDefinition( (org.apache.maven.continuum.model.project.BuildDefinition)
i.next() ) );
+        }
+        return result;
+    }
+
+    // ----------------------------------------------------------------------
     // Building
     // ----------------------------------------------------------------------
 
@@ -833,5 +873,42 @@
         res.setException( failure.getException() );
         res.setName( failure.getName() );
         return res;
+    }
+
+    private BuildDefinition populateBuildDefinition( org.apache.maven.continuum.model.project.BuildDefinition
buildDef )
+    {
+        if ( buildDef == null )
+        {
+            return null;
+        }
+
+        BuildDefinition bd = new BuildDefinition();
+        bd.setArguments( buildDef.getArguments() );
+        bd.setBuildFile( buildDef.getBuildFile() );
+        bd.setBuildFresh( buildDef.isBuildFresh() );
+        bd.setDefaultForProject( buildDef.isDefaultForProject() );
+        bd.setGoals( buildDef.getGoals() );
+        //TODO: bd.setProfile( populateProfile( buildDef.getProfile() ) );
+        //TODO: bd.setSchedule( populateSchedule( buildDef.getSchedule() ) );
+        return bd;
+    }
+
+    private org.apache.maven.continuum.model.project.BuildDefinition populateBuildDefinition(
BuildDefinition buildDef )
+    {
+        if ( buildDef == null )
+        {
+            return null;
+        }
+
+        org.apache.maven.continuum.model.project.BuildDefinition bd =
+            new org.apache.maven.continuum.model.project.BuildDefinition();
+        bd.setArguments( buildDef.getArguments() );
+        bd.setBuildFile( buildDef.getBuildFile() );
+        bd.setBuildFresh( buildDef.isBuildFresh() );
+        bd.setDefaultForProject( buildDef.isDefaultForProject() );
+        bd.setGoals( buildDef.getGoals() );
+        //TODO: bd.setProfile( populateProfile( buildDef.getProfile() ) );
+        //TODO: bd.setSchedule( populateSchedule( buildDef.getSchedule() ) );
+        return bd;
     }
 }



Mime
View raw message