continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r554962 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ con...
Date Tue, 10 Jul 2007 14:36:50 GMT
Author: evenisse
Date: Tue Jul 10 07:36:49 2007
New Revision: 554962

URL: http://svn.apache.org/viewvc?view=rev&rev=554962
Log:
Add more methods

Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    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-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-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?view=diff&rev=554962&r1=554961&r2=554962
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
Tue Jul 10 07:36:49 2007
@@ -475,6 +475,9 @@
     // Schedule
     // ----------------------------------------------------------------------
 
+    Schedule getScheduleByName( String scheduleName )
+        throws ContinuumException;
+
     Schedule getSchedule( int id )
         throws ContinuumException;
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?view=diff&rev=554962&r1=554961&r2=554962
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Tue Jul 10 07:36:49 2007
@@ -299,15 +299,7 @@
 
             ProjectGroup new_pg = store.addProjectGroup( projectGroup );
 
-            try
-            {
-                addBuildDefinitionToProjectGroup( new_pg.getId(), getDefaultBuildDefinition()
);
-            }
-            catch ( ContinuumStoreException e )
-            {
-                throw new ContinuumException( "Error adding default build definition to the
requested project group",
-                                              e );
-            }
+            addBuildDefinitionToProjectGroup( new_pg.getId(), getDefaultBuildDefinition()
);
 
             Map context = new HashMap();
             context.put( AbstractContinuumAction.KEY_PROJECT_GROUP_ID, new Integer( new_pg.getId()
) );
@@ -322,7 +314,7 @@
     }
 
     private BuildDefinition getDefaultBuildDefinition()
-        throws ContinuumStoreException
+        throws ContinuumException
     {
         BuildDefinition bd = new BuildDefinition();
 
@@ -334,7 +326,7 @@
 
         bd.setBuildFile( "pom.xml" );
 
-        bd.setSchedule( store.getScheduleByName( DefaultContinuumInitializer.DEFAULT_SCHEDULE_NAME
) );
+        bd.setSchedule( getScheduleByName( DefaultContinuumInitializer.DEFAULT_SCHEDULE_NAME
) );
 
         return bd;
     }
@@ -1984,6 +1976,19 @@
         }
     }
 
+    public Schedule getScheduleByName( String scheduleName )
+        throws ContinuumException
+    {
+        try
+        {
+            return store.getScheduleByName( scheduleName );
+        }
+        catch ( ContinuumStoreException e )
+        {
+            throw logAndCreateException( "Error while accessing the store.", e );
+        }
+    }
+
     public Collection getSchedules()
         throws ContinuumException
     {
@@ -1995,22 +2000,14 @@
     {
         Schedule s;
 
-        try
-        {
-            s = store.getScheduleByName( schedule.getName() );
+        s = getScheduleByName( schedule.getName() );
 
-            if ( s != null )
-            {
-                throw logAndCreateException( "Can't create schedule. A schedule with the
same name already exists.",
-                                             null );
-            }
-
-            s = store.addSchedule( schedule );
-        }
-        catch ( ContinuumStoreException e )
+        if ( s != null )
         {
-            throw logAndCreateException( "Error while accessing the store.", e );
+            throw logAndCreateException( "Can't create schedule. A schedule with the same
name already exists.", null );
         }
+
+        s = store.addSchedule( schedule );
 
         try
         {

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=554962&r1=554961&r2=554962
==============================================================================
--- 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
Tue Jul 10 07:36:49 2007
@@ -469,6 +469,28 @@
     Schedule getSchedule( int scheduleId )
         throws ContinuumException, XmlRpcException;
 
+    /**
+     * Add the schedule.
+     *
+     * @param schedule The schedule
+     * @return The schedule.
+     * @throws ContinuumException
+     * @throws XmlRpcException
+     */
+    Schedule addSchedule( Schedule schedule )
+        throws ContinuumException, XmlRpcException;
+
+    /**
+     * Update the schedule.
+     *
+     * @param schedule The schedule
+     * @return The schedule.
+     * @throws ContinuumException
+     * @throws XmlRpcException
+     */
+    Schedule updateSchedule( Schedule schedule )
+        throws ContinuumException, XmlRpcException;
+
     // ----------------------------------------------------------------------
     // Profiles
     // ----------------------------------------------------------------------

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=554962&r1=554961&r2=554962
==============================================================================
--- 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
Tue Jul 10 07:36:49 2007
@@ -31,7 +31,6 @@
 import org.apache.maven.continuum.xmlrpc.project.ProjectSummary;
 import org.apache.maven.continuum.xmlrpc.project.Schedule;
 import org.apache.maven.continuum.xmlrpc.system.Profile;
-import org.apache.xmlrpc.XmlRpcException;
 import org.apache.xmlrpc.client.XmlRpcClient;
 import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
 import org.apache.xmlrpc.client.util.ClientFactory;
@@ -641,11 +640,38 @@
         }
     }
 
+    public Schedule addSchedule( Schedule schedule )
+        throws ContinuumException
+    {
+        try
+        {
+            return continuum.addSchedule( schedule );
+        }
+        catch ( Exception e )
+        {
+            throw new ContinuumException( "The remote method failed.", e );
+        }
+    }
+
+    public Schedule updateSchedule( Schedule schedule )
+        throws ContinuumException
+    {
+        try
+        {
+            return continuum.updateSchedule( schedule );
+        }
+        catch ( Exception e )
+        {
+            throw new ContinuumException( "The remote method failed.", e );
+        }
+    }
+
     // ----------------------------------------------------------------------
     // Profiles
     // ----------------------------------------------------------------------
+
     public List getProfiles()
-        throws ContinuumException, XmlRpcException
+        throws ContinuumException
     {
         try
         {
@@ -658,7 +684,7 @@
     }
 
     public Profile getProfile( int profileId )
-        throws ContinuumException, XmlRpcException
+        throws ContinuumException
     {
         try
         {

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=554962&r1=554961&r2=554962
==============================================================================
--- 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
Tue Jul 10 07:36:49 2007
@@ -604,6 +604,26 @@
         return populateSchedule( continuum.getSchedule( scheduleId ) );
     }
 
+    public Schedule updateSchedule( Schedule schedule )
+        throws ContinuumException
+    {
+        checkManageSchedulesAuthorization();
+
+        continuum.updateSchedule( populateSchedule( schedule ) );
+
+        return populateSchedule( continuum.getScheduleByName( schedule.getName() ) );
+    }
+
+    public Schedule addSchedule( Schedule schedule )
+        throws ContinuumException
+    {
+        checkManageSchedulesAuthorization();
+
+        continuum.addSchedule( populateSchedule( schedule ) );
+
+        return populateSchedule( continuum.getScheduleByName( schedule.getName() ) );
+    }
+
     // ----------------------------------------------------------------------
     // Profiles
     // ----------------------------------------------------------------------



Mime
View raw message