continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r705113 [1/2] - in /continuum/branches/continuum-1.2.x: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-api/src/main/java/org/apache/maven/continuum/configuration/ continuum-commons/src/main/java/org/apache/maven/continuum...
Date Thu, 16 Oct 2008 01:08:37 GMT
Author: ctan
Date: Wed Oct 15 18:08:36 2008
New Revision: 705113

URL: http://svn.apache.org/viewvc?rev=705113&view=rev
Log:
[CONTINUUM-1933] added new methods in webservices

Modified:
    continuum/branches/continuum-1.2.x/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    continuum/branches/continuum-1.2.x/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
    continuum/branches/continuum-1.2.x/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
    continuum/branches/continuum-1.2.x/continuum-core/src/main/java/org/apache/continuum/repository/DefaultRepositoryService.java
    continuum/branches/continuum-1.2.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    continuum/branches/continuum-1.2.x/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java
    continuum/branches/continuum-1.2.x/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java
    continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-api/pom.xml
    continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java
    continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml
    continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-backup/src/main/java/org/apache/maven/continuum/xmlrpc/backup/Backup.java
    continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-client/pom.xml
    continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java
    continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/SampleClient.java
    continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/AbstractContinuumSecureService.java
    continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
    continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-server/src/main/resources/dozerBeanMapping.xml

Modified: continuum/branches/continuum-1.2.x/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.2.x/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=705113&r1=705112&r2=705113&view=diff
==============================================================================
--- continuum/branches/continuum-1.2.x/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java (original)
+++ continuum/branches/continuum-1.2.x/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java Wed Oct 15 18:08:36 2008
@@ -26,6 +26,7 @@
 
 import org.apache.continuum.model.release.ContinuumReleaseResult;
 import org.apache.continuum.purge.ContinuumPurgeManager;
+import org.apache.continuum.purge.PurgeConfigurationService;
 import org.apache.continuum.repository.RepositoryService;
 import org.apache.maven.continuum.builddefinition.BuildDefinitionService;
 import org.apache.maven.continuum.buildqueue.BuildProjectTask;
@@ -189,6 +190,9 @@
     void removeTasksFromCheckoutQueueWithHashCodes( int[] hashCodes )
         throws ContinuumException;
 
+    boolean cancelCurrentBuild()
+        throws ContinuumException;
+    
     // ----------------------------------------------------------------------
     // Building
     // ----------------------------------------------------------------------
@@ -638,6 +642,8 @@
     // Continuum Purge
     // ----------------------------------------------------------------------
     ContinuumPurgeManager getPurgeManager();
+
+    PurgeConfigurationService getPurgeConfigurationService();
     
     // ----------------------------------------------------------------------
     // Repository Service
@@ -662,4 +668,7 @@
 
     ContinuumReleaseResult getContinuumReleaseResult( int projectId, String releaseGoal, long startTime, long endTime )
         throws ContinuumException;
+    
+    String getReleaseOutput( int releaseResultId )
+        throws ContinuumException;
 }

Modified: continuum/branches/continuum-1.2.x/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.2.x/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java?rev=705113&r1=705112&r2=705113&view=diff
==============================================================================
--- continuum/branches/continuum-1.2.x/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java (original)
+++ continuum/branches/continuum-1.2.x/continuum-api/src/main/java/org/apache/maven/continuum/configuration/ConfigurationService.java Wed Oct 15 18:08:36 2008
@@ -81,6 +81,9 @@
     File getReleaseOutputFile( int projectGroupId, String releaseName )
         throws ConfigurationException;
 
+    String getReleaseOutput( int projectGroupId, String releaseName )
+        throws ConfigurationException;
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------

Modified: continuum/branches/continuum-1.2.x/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.2.x/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java?rev=705113&r1=705112&r2=705113&view=diff
==============================================================================
--- continuum/branches/continuum-1.2.x/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java (original)
+++ continuum/branches/continuum-1.2.x/continuum-commons/src/main/java/org/apache/maven/continuum/configuration/DefaultConfigurationService.java Wed Oct 15 18:08:36 2008
@@ -358,6 +358,29 @@
         return new File( dir, name + ".log.txt" );
     }
 
+    public String getReleaseOutput( int projectGroupId, String name )
+        throws ConfigurationException
+    {
+        File file = getReleaseOutputFile( projectGroupId, name );
+
+        try
+        {
+            if ( file.exists() )
+            {
+                return FileUtils.fileRead( file.getAbsolutePath() );
+            }
+            else
+            {
+                return "There are no output for this release.";
+            }
+        }
+        catch ( IOException e )
+        {
+            log.warn( "Error reading release output for release '" + name + "'.", e );
+            return null;
+        }
+    }
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------

Modified: continuum/branches/continuum-1.2.x/continuum-core/src/main/java/org/apache/continuum/repository/DefaultRepositoryService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.2.x/continuum-core/src/main/java/org/apache/continuum/repository/DefaultRepositoryService.java?rev=705113&r1=705112&r2=705113&view=diff
==============================================================================
--- continuum/branches/continuum-1.2.x/continuum-core/src/main/java/org/apache/continuum/repository/DefaultRepositoryService.java (original)
+++ continuum/branches/continuum-1.2.x/continuum-core/src/main/java/org/apache/continuum/repository/DefaultRepositoryService.java Wed Oct 15 18:08:36 2008
@@ -72,6 +72,20 @@
 
         try
         {
+            List<LocalRepository> repos = getAllLocalRepositories();
+            for ( LocalRepository repo : repos )
+            {
+                if ( repo.getName().equals( localRepository.getName() ) )
+                {
+                    throw new RepositoryServiceException( "Local repository name must be unique" );
+                }
+                
+                if ( repo.getLocation().equals( localRepository.getLocation() ) )
+                {
+                    throw new RepositoryServiceException( "Local repository location must be unique" );
+                }
+            }
+
             localRepository.setName( localRepository.getName().trim() );
             localRepository.setLocation( localRepository.getLocation().trim() );
 

Modified: continuum/branches/continuum-1.2.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.2.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=705113&r1=705112&r2=705113&view=diff
==============================================================================
--- continuum/branches/continuum-1.2.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original)
+++ continuum/branches/continuum-1.2.x/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Wed Oct 15 18:08:36 2008
@@ -45,6 +45,7 @@
 import org.apache.continuum.dao.ScheduleDao;
 import org.apache.continuum.model.release.ContinuumReleaseResult;
 import org.apache.continuum.purge.ContinuumPurgeManager;
+import org.apache.continuum.purge.PurgeConfigurationService;
 import org.apache.continuum.repository.RepositoryService;
 import org.apache.maven.continuum.build.settings.SchedulesActivationException;
 import org.apache.maven.continuum.build.settings.SchedulesActivator;
@@ -245,6 +246,11 @@
      */
     private RepositoryService repositoryService;
 
+    /**
+     * @plexus.requirement
+     */
+    private PurgeConfigurationService purgeConfigurationService;
+
     public DefaultContinuum()
     {
         Runtime.getRuntime().addShutdownHook( new Thread()
@@ -288,6 +294,11 @@
         return repositoryService;
     }
 
+    public PurgeConfigurationService getPurgeConfigurationService()
+    {
+        return purgeConfigurationService;
+    }
+
     // ----------------------------------------------------------------------
     // Project Groups
     // ----------------------------------------------------------------------
@@ -789,6 +800,30 @@
         }
     }
 
+    public boolean cancelCurrentBuild()
+        throws ContinuumException
+    {
+        Task task = getBuildTaskQueueExecutor().getCurrentTask();
+        
+        if ( task != null )
+        {
+            if ( task instanceof BuildProjectTask )
+            {
+                getLogger().info( "Cancelling current build task" );
+                return getBuildTaskQueueExecutor().cancelTask( task );
+            }
+            else
+            {
+                getLogger().warn( "Current task not a BuildProjectTask - not cancelling" );
+            }
+        }
+        else
+        {
+            getLogger().warn( "No task running - not cancelling" );
+        }
+        return false;
+    }
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
@@ -3390,4 +3425,21 @@
             throw new ContinuumException( "Error while retrieving continuumReleaseResult of projectId " + projectId + " with releaseGoal: " + releaseGoal, e);
         }
     }
+
+    public String getReleaseOutput( int releaseResultId )
+        throws ContinuumException
+    {
+        ContinuumReleaseResult releaseResult = getContinuumReleaseResult( releaseResultId );
+
+        ProjectGroup projectGroup = releaseResult.getProjectGroup();
+
+        try
+        {
+            return configurationService.getReleaseOutput( projectGroup.getId(), "releases-" + releaseResult.getStartTime() );
+        }
+        catch ( ConfigurationException e )
+        {
+            throw new ContinuumException( "Error while retrieving release output for release: " + releaseResultId );
+        }
+    }
 }

Modified: continuum/branches/continuum-1.2.x/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.2.x/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java?rev=705113&r1=705112&r2=705113&view=diff
==============================================================================
--- continuum/branches/continuum-1.2.x/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java (original)
+++ continuum/branches/continuum-1.2.x/continuum-test/src/main/java/org/apache/maven/continuum/configuration/ConfigurationServiceMock.java Wed Oct 15 18:08:36 2008
@@ -235,5 +235,9 @@
     {
     }
 
+    public String getReleaseOutput( int projectGroupId, String name )
+    {
+        return null;
+    }
 
 }

Modified: continuum/branches/continuum-1.2.x/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.2.x/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java?rev=705113&r1=705112&r2=705113&view=diff
==============================================================================
--- continuum/branches/continuum-1.2.x/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java (original)
+++ continuum/branches/continuum-1.2.x/continuum-webapp/src/main/java/org/apache/continuum/web/action/ReleaseResultAction.java Wed Oct 15 18:08:36 2008
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.continuum.model.release.ContinuumReleaseResult;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.configuration.ConfigurationException;
@@ -26,6 +27,7 @@
 import org.apache.maven.continuum.web.action.ContinuumConfirmAction;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
 import org.apache.maven.shared.release.ReleaseResult;
+import org.codehaus.plexus.util.FileUtils;
 
 import java.io.BufferedReader;
 import java.io.File;
@@ -141,20 +143,13 @@
 
         try
         {
-            File logFile = getContinuum().getConfiguration().getReleaseOutputFile( projectGroupId, "releases-" + releaseResult.getStartTime() );
-            StringBuilder output = new StringBuilder();
-            
-            BufferedReader reader = new BufferedReader( new FileReader( logFile ) );
-            char[] buf = new char[1024];
-            int numRead=0;
-            
-            while( ( numRead = reader.read( buf ) ) != -1 )
+            File releaseOutputFile = getContinuum().getConfiguration().getReleaseOutputFile( projectGroupId, "releases-" + releaseResult.getStartTime() );
+
+            if ( releaseOutputFile.exists() )
             {
-                output.append( buf, 0, numRead );
+                String str = StringEscapeUtils.escapeHtml( FileUtils.fileRead( releaseOutputFile ) );
+                result.appendOutput( str );
             }
-            reader.close();
-            
-            result.appendOutput( output.toString() );
         }
         catch ( ConfigurationException e )
         {

Modified: continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-api/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-api/pom.xml?rev=705113&r1=705112&r2=705113&view=diff
==============================================================================
--- continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-api/pom.xml (original)
+++ continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-api/pom.xml Wed Oct 15 18:08:36 2008
@@ -52,7 +52,7 @@
           </execution>
         </executions>
         <configuration>
-          <version>1.1.0</version>
+          <version>1.1.1</version>
           <packageWithVersion>false</packageWithVersion>
         </configuration>
       </plugin>

Modified: continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java?rev=705113&r1=705112&r2=705113&view=diff
==============================================================================
--- continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java (original)
+++ continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-api/src/main/java/org/apache/maven/continuum/xmlrpc/ContinuumService.java Wed Oct 15 18:08:36 2008
@@ -22,6 +22,10 @@
 import java.util.List;
 import java.util.Map;
 
+import org.apache.continuum.xmlrpc.repository.DirectoryPurgeConfiguration;
+import org.apache.continuum.xmlrpc.repository.LocalRepository;
+import org.apache.continuum.xmlrpc.repository.RepositoryPurgeConfiguration;
+import org.apache.continuum.xmlrpc.release.ContinuumReleaseResult;
 import org.apache.maven.continuum.xmlrpc.project.AddingResult;
 import org.apache.maven.continuum.xmlrpc.project.BuildDefinition;
 import org.apache.maven.continuum.xmlrpc.project.BuildDefinitionTemplate;
@@ -528,6 +532,7 @@
      */
     int buildGroup( int projectGroupId, int buildDefinitionId )
         throws Exception;
+
     // ----------------------------------------------------------------------
     // Build Results
     // ----------------------------------------------------------------------
@@ -1041,6 +1046,25 @@
     public List<BuildProjectTask> getProjectsInBuildQueue()
         throws Exception;    
 
+    /**
+     * Remove projects from build queue
+     * 
+     * @param projectsId project id to be removed from the building queue
+     * @return
+     * @throws Exception
+     */
+    int removeProjectsFromBuildingQueue( int[] projectsId )
+        throws Exception;
+
+    /**
+     * Cancel the current project build
+     * 
+     * @return
+     * @throws Exception
+     */
+    boolean cancelCurrentBuild()
+        throws Exception;
+
     // ----------------------------------------------------------------------
     // TODO:Users
     // ----------------------------------------------------------------------
@@ -1051,4 +1075,356 @@
 
     boolean ping()
         throws Exception;
+
+    // ----------------------------------------------------------------------
+    // Local Repository
+    // ----------------------------------------------------------------------
+
+    /**
+     * Add a local repository
+     * 
+     * @param repository the local repository to add
+     * @return
+     * @throws Exception
+     */
+    LocalRepository addLocalRepository( LocalRepository repository )
+        throws Exception;
+
+    /**
+     * Same method but compatible with the standard XMLRPC
+     * 
+     * @param repository the local repository to add
+     * @return
+     * @throws Exception
+     */
+    Map<String, Object> addLocalRepositoryRPC( Map<String, Object> repository )
+        throws Exception;
+
+    /**
+     * Update the local repository
+     * 
+     * @param repository the local repository to update
+     * @return
+     * @throws Exception
+     */
+    int updateLocalRepository( LocalRepository repository )
+        throws Exception;
+
+    /**
+     * Same method but compatible with the standard XMLRPC
+     * 
+     * @param repository the local repository to update
+     * @return
+     * @throws Exception
+     */
+    int updateLocalRepositoryRPC( Map<String, Object> repository )
+        throws Exception;
+
+    /**
+     * Remove the local repository
+     * 
+     * @param repositoryId
+     * @return
+     * @throws Exception
+     */
+    int removeLocalRepository( int repositoryId )
+        throws Exception;
+
+    /**
+     * Returns the local repository
+     * 
+     * @param repositoryId the local repository id
+     * @return
+     * @throws Exception
+     */
+    LocalRepository getLocalRepository( int repositoryId )
+        throws Exception;
+
+    /**
+     * Same method but compatible with the standard XMLRPC
+     * 
+     * @param repositoryId
+     * @return
+     * @throws Exception
+     */
+    Map<String, Object> getLocalRepositoryRPC( int repositoryId )
+        throws Exception;
+
+    /**
+     * Returns all local repositories
+     * 
+     * @return
+     * @throws Exception
+     */
+    List<LocalRepository> getAllLocalRepositories()
+        throws Exception;
+
+    /**
+     * Same method but compatible with the standard XMLRPC
+     * 
+     * @return
+     * @throws Exception
+     */
+    List<Object> getAllLocalRepositoriesRPC()
+        throws Exception;
+
+    // ----------------------------------------------------------------------
+    // Purging
+    // ----------------------------------------------------------------------
+
+    /**
+     * Add a repository purge configuration
+     * 
+     * @param repoPurge the repository purge configuration
+     * @return
+     * @throws Exception
+     */
+    RepositoryPurgeConfiguration addRepositoryPurgeConfiguration( RepositoryPurgeConfiguration repoPurge )
+        throws Exception;
+
+    /**
+     * Same method but compatible with the standard XMLRPC
+     * 
+     * @param repoPurge the repository purge configuration
+     * @return
+     * @throws Exception
+     */
+    Map<String, Object> addRepositoryPurgeConfigurationRPC( Map<String, Object> repoPurge )
+        throws Exception;
+
+    /**
+     * Update the repository purge configuration
+     * 
+     * @param repoPurge the repository purge configuration
+     * @return
+     * @throws Exception
+     */
+    int updateRepositoryPurgeConfiguration( RepositoryPurgeConfiguration repoPurge )
+        throws Exception;
+
+    /**
+     * Same method but compatible with the standard XMLRPC
+     * 
+     * @param repoPurge the repository purge configuration
+     * @return
+     * @throws Exception
+     */
+    int updateRepositoryPurgeConfigurationRPC( Map<String, Object> repoPurge )
+        throws Exception;
+
+    /**
+     * Remove repository purge configuration
+     * 
+     * @param repoPurgeId the repository purge configuration id
+     * @return
+     * @throws Exception
+     */
+    int removeRepositoryPurgeConfiguration( int repoPurgeId )
+        throws Exception;
+
+    /**
+     * Returns the repository purge configuration
+     * 
+     * @param purgeConfigId the repository purge configuration id
+     * @return the repository purge configuration
+     * @throws Exception
+     */
+    RepositoryPurgeConfiguration getRepositoryPurgeConfiguration( int repoPurgeId )
+        throws Exception;
+
+    /**
+     * Same method but compatible with standard XMLRPC
+     * 
+     * @param purgeConfigId the repository purge configuration id
+     * @return the repository purge configuration
+     * @throws Exception
+     */
+    Map<String, Object> getRepositoryPurgeConfigurationRPC( int purgeConfigId )
+        throws Exception;
+
+    /**
+     * Returns repository purge configurations list
+     * 
+     * @return list of repository purge configurations
+     * @throws Exception
+     */
+    List<RepositoryPurgeConfiguration> getAllRepositoryPurgeConfigurations()
+        throws Exception;
+
+    /**
+     * Same method but compatible with standard XMLRPC
+     * 
+     * @return list of repository purge configurations
+     * @throws Exception
+     */
+    List<Object> getAllRepositoryPurgeConfigurationsRPC()
+        throws Exception;
+
+    /**
+     * Add a directory purge configuration
+     * 
+     * @param dirPurge the directory purge configuration
+     * @return
+     * @throws Exception
+     */
+    DirectoryPurgeConfiguration addDirectoryPurgeConfiguration( DirectoryPurgeConfiguration dirPurge )
+        throws Exception;
+
+    /**
+     * Same method but compatible with the standard XMLRPC
+     * 
+     * @param dirPurge the directory purge configuration
+     * @return
+     * @throws Exception
+     */
+    Map<String, Object> addDirectoryPurgeConfigurationRPC( Map<String, Object> dirPurge )
+        throws Exception;
+
+    /**
+     * Update the directory purge configuration
+     * 
+     * @param dirPurge the directory purge configuration
+     * @return
+     * @throws Exception
+     */
+    int updateDirectoryPurgeConfiguration( DirectoryPurgeConfiguration dirPurge )
+        throws Exception;
+
+    /**
+     * Same method but compatible with the standard XMLRPC
+     * 
+     * @param dirPurge the directory purge configuration
+     * @return
+     * @throws Exception
+     */
+    int updateDirectoryPurgeConfigurationRPC( Map<String, Object> dirPurge )
+        throws Exception;
+
+    /**
+     * Removes the directory purge configuration
+     * 
+     * @param dirPurgeId the directory purge configuration id
+     * @return
+     * @throws Exception
+     */
+    int removeDirectoryPurgeConfiguration( int dirPurgeId )
+        throws Exception;
+
+    /**
+     * Returns the directory purge configuration
+     * 
+     * @param purgeConfigId the directory purge configuration id
+     * @return the directory purge configuration
+     * @throws Exception
+     */
+    DirectoryPurgeConfiguration getDirectoryPurgeConfiguration( int purgeConfigId )
+        throws Exception;
+
+    /**
+     * Same method but compatible with standard XMLRPC
+     * 
+     * @param purgeConfigId the directory purge configuration id
+     * @return the directory purge configuration
+     * @throws Exception
+     */
+    Map<String, Object> getDirectoryPurgeConfigurationRPC( int purgeConfigId )
+        throws Exception;
+
+    /**
+     * Returns directory purge configurations list
+     * 
+     * @return list of directory purge configurations
+     * @throws Exception
+     */
+    List<DirectoryPurgeConfiguration> getAllDirectoryPurgeConfigurations()
+        throws Exception;
+
+    /**
+     * Same method but compatible with standard XMLRPC
+     * 
+     * @return list of directory purge configurations
+     * @throws Exception
+     */
+    List<Object> getAllDirectoryPurgeConfigurationsRPC()
+        throws Exception;
+
+    void purgeLocalRepository( int repoPurgeId )
+        throws Exception;
+
+    void purgeDirectory( int dirPurgeId )
+        throws Exception;
+
+    // ----------------------------------------------------------------------
+    // Release Results
+    // ----------------------------------------------------------------------
+
+    /**
+     * Returns the release result.
+     *
+     * @param releaseId The release id
+     * @return The release result
+     * @throws Exception
+     */
+    ContinuumReleaseResult getReleaseResult( int releaseId )
+        throws Exception;
+
+    /**
+     * Same method but compatible with standard XMLRPC
+     *
+     * @param releaseId   The release id
+     * @return The release result as RPC value
+     * @throws Exception
+     */
+    Map<String,Object> getReleaseResultRPC( int releaseId )
+        throws Exception;
+    
+    /**
+     * Returns the project group release result list.
+     *
+     * @param projectGroupId The project group id
+     * @return The release result list
+     * @throws Exception
+     */
+    List<ContinuumReleaseResult> getReleaseResultsForProjectGroup( int projectGroupId )
+        throws Exception;
+
+    /**
+     * Same method but compatible with standard XMLRPC
+     *
+     * @param projectGroupId The project group id
+     * @return The release result list as RPC value
+     * @throws Exception
+     */
+    List<Object> getReleaseResultsForProjectGroupRPC( int projectGroupId )
+        throws Exception;
+
+    /**
+     * Remove the project release result.
+     *
+     * @param releaseResult The project release result
+     * @return 0
+     * @throws Exception
+     */
+    int removeReleaseResult( ContinuumReleaseResult releaseResult )
+        throws Exception;
+
+    /**
+     * Same method but compatible with standard XMLRPC
+     *
+     * @param rr The project release result
+     * @return 0
+     * @throws Exception
+     */
+    int removeReleaseResultRPC( Map<String,Object> rr )
+        throws Exception;
+    
+    /**
+     * Returns the release output.
+     *
+     * @param releaseId The release id
+     * @return The release output
+     * @throws Exception
+     */
+    String getReleaseOutput( int releaseId )
+        throws Exception;
 }

Modified: continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml?rev=705113&r1=705112&r2=705113&view=diff
==============================================================================
--- continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml (original)
+++ continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-api/src/main/mdo/continuum-service.xml Wed Oct 15 18:08:36 2008
@@ -55,6 +55,13 @@
           <version>1.1.0+</version>
           <type>String</type>
         </field>
+        <field>
+          <name>localRepository</name>
+          <version>1.1.1+</version>
+          <association>
+            <type>LocalRepository</type>
+          </association>
+        </field>
       </fields>
     </class>
 
@@ -1201,6 +1208,204 @@
         </field>
       </fields>
     </class>    
+
+    <class>
+      <name>LocalRepository</name>
+      <version>1.1.1+</version>
+      <packageName>org.apache.continuum.xmlrpc.repository</packageName>
+      <fields>
+        <field>
+          <name>id</name>
+          <version>1.1.1+</version>
+          <type>int</type>
+          <identifier>true</identifier>
+        </field>
+        <field>
+          <name>name</name>
+          <version>1.1.1+</version>
+          <type>String</type>
+          <required>true</required>
+        </field>
+        <field jpox.column="repoLocation">
+          <name>location</name>
+          <version>1.1.1+</version>
+          <type>String</type>
+          <required>true</required>
+          <description>
+          The file system location for this repository
+          </description>
+        </field>
+        <field>
+          <name>layout</name>
+          <version>1.1.1+</version>
+          <type>String</type>
+          <defaultValue>default</defaultValue>
+          <description>
+          The layout of the repository. Valid values are "default" and "legacy"
+          </description>
+        </field>
+      </fields>
+    </class>
     
+    <class>
+      <name>AbstractPurgeConfiguration</name>
+      <version>1.1.1+</version>
+      <abstract>true</abstract>
+      <packageName>org.apache.continuum.xmlrpc.repository</packageName>
+      <fields>
+        <field>
+          <name>id</name>
+          <version>1.1.1+</version>
+          <identifier>true</identifier>
+          <type>int</type>
+        </field>
+        <field>
+          <name>description</name>
+          <version>1.1.1+</version>
+          <type>String</type>
+        </field>
+        <field>
+          <name>deleteAll</name>
+          <version>1.1.1+</version>
+          <type>boolean</type>
+          <defaultValue>false</defaultValue>
+        </field>
+        <field>
+          <name>retentionCount</name>
+          <version>1.1.1+</version>
+          <type>int</type>
+          <defaultValue>2</defaultValue>
+          <description>
+          The total count of the artifact for each snapshot or the release/build output folder to be retained.
+          </description>
+        </field>
+        <field>
+          <name>daysOlder</name>
+          <version>1.1.1+</version>
+          <type>int</type>
+          <defaultValue>100</defaultValue>
+          <description>
+          The number of days old which will be the basis for removing a snapshot or a folder.
+          </description>
+        </field>
+        <field>
+          <name>enabled</name>
+          <version>1.1.1+</version>
+          <type>boolean</type>
+          <defaultValue>true</defaultValue>
+        </field>
+        <field>
+          <name>schedule</name>
+          <version>1.1.1+</version>
+          <association xml.reference="true" stash.part="true" jpox.dependent="false">
+            <type>Schedule</type>
+          </association>
+        </field>
+        <field>
+          <name>defaultPurge</name>
+          <version>1.1.1+</version>
+          <type>boolean</type>
+          <defaultValue>false</defaultValue>
+        </field>
+      </fields>
+    </class>
+    <class>
+      <name>RepositoryPurgeConfiguration</name>
+      <version>1.1.1+</version>
+      <superClass>AbstractPurgeConfiguration</superClass>
+      <packageName>org.apache.continuum.xmlrpc.repository</packageName>
+      <fields>
+        <field>
+          <name>repository</name>
+          <version>1.1.1+</version>
+          <association xml.reference="true" stash.part="true" jpox.dependent="false">
+            <type>LocalRepository</type>
+          </association>
+          <required>true</required>
+        </field>
+        <field>
+          <name>deleteReleasedSnapshots</name>
+          <version>1.1.1+</version>
+          <type>boolean</type>
+          <defaultValue>false</defaultValue>
+          <description>
+            True if the released snapshots are to be removed from the repo during repository purge.
+          </description>
+        </field>
+      </fields>
+    </class>
+    <class>
+      <name>DirectoryPurgeConfiguration</name>
+      <version>1.1.1+</version>
+      <superClass>AbstractPurgeConfiguration</superClass>
+      <packageName>org.apache.continuum.xmlrpc.repository</packageName>
+      <fields>
+        <field jpox.column="directoryLocation">
+          <name>location</name>
+          <version>1.1.1+</version>
+          <type>String</type>
+          <description>
+            The file system path for this directory
+          </description>
+          <required>true</required>
+        </field>
+        <field>
+          <name>directoryType</name>
+          <version>1.1.1+</version>
+          <type>String</type>
+          <description>
+            The type of directory. Valid values are "releases" and "buildOutput"
+          </description>
+        </field>
+      </fields>
+    </class>
+       
+    <class>
+      <name>ContinuumReleaseResult</name>
+      <version>1.1.1+</version>
+      <packageName>org.apache.continuum.xmlrpc.release</packageName>
+      <fields>
+        <field>
+          <name>id</name>
+          <version>1.1.1+</version>
+          <identifier>true</identifier>
+          <type>int</type>
+        </field>
+        <field>
+          <name>startTime</name>
+          <version>1.1.1+</version>
+          <type>long</type>
+        </field>
+        <field>
+          <name>endTime</name>
+          <version>1.1.1+</version>
+          <type>long</type>
+        </field>
+        <field>
+          <name>resultCode</name>
+          <version>1.1.1+</version>
+          <type>int</type>
+        </field>
+        <field>
+          <name>projectGroup</name>
+          <version>1.1.1+</version>
+          <association xml.reference="true" stash.part="true" jpox.dependent="false">
+            <type>ProjectGroup</type>
+          </association>
+        </field>
+        <field>
+          <name>project</name>
+          <version>1.1.1+</version>
+          <association xml.reference="true" stash.part="true" jpox.dependent="false">
+            <type>Project</type>
+          </association>
+        </field>
+        <field>
+          <name>releaseGoal</name>
+          <version>1.1.1+</version>
+          <type>String</type>
+        </field>
+      </fields>
+    </class> 
   </classes>
 </model>

Modified: continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-backup/src/main/java/org/apache/maven/continuum/xmlrpc/backup/Backup.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-backup/src/main/java/org/apache/maven/continuum/xmlrpc/backup/Backup.java?rev=705113&r1=705112&r2=705113&view=diff
==============================================================================
--- continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-backup/src/main/java/org/apache/maven/continuum/xmlrpc/backup/Backup.java (original)
+++ continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-backup/src/main/java/org/apache/maven/continuum/xmlrpc/backup/Backup.java Wed Oct 15 18:08:36 2008
@@ -24,6 +24,10 @@
 import org.apache.log4j.BasicConfigurator;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
+import org.apache.continuum.xmlrpc.release.ContinuumReleaseResult;
+import org.apache.continuum.xmlrpc.repository.DirectoryPurgeConfiguration;
+import org.apache.continuum.xmlrpc.repository.LocalRepository;
+import org.apache.continuum.xmlrpc.repository.RepositoryPurgeConfiguration;
 import org.apache.maven.continuum.xmlrpc.client.ContinuumXmlRpcClient;
 import org.apache.maven.continuum.xmlrpc.project.BuildDefinition;
 import org.apache.maven.continuum.xmlrpc.project.BuildDefinitionTemplate;
@@ -149,6 +153,9 @@
         backupAllProfiles();
         backupAllBuildDefinitionTemplates();
         backupAllProjectGroup();
+        backupAllLocalRepositories();
+        backupAllRepositoryPurgeConfigurations();
+        backupAllDirectoryPurgeConfigurations();
         endTag( "continuumDatabase", true );
         writer.close();
         LOGGER.info( "Done." );
@@ -339,6 +346,7 @@
             endTag( "notifiers", true );
         }
 
+        backupContinuumReleaseResultsForProjectGroup( pg.getId() );
         endTag( "projectGroup", true );
     }
 
@@ -667,4 +675,132 @@
 
         return fields;
     }
+
+    private static void backupAllLocalRepositories()
+        throws Exception
+    {
+        LOGGER.info( "Backup local repositories" );
+        List<LocalRepository> repos = client.getAllLocalRepositories();
+        if ( repos != null && !repos.isEmpty() )
+        {
+            startTag( "localRepositories", true );
+            for ( LocalRepository repo : repos )
+            {
+                LOGGER.debug( "Backup local repository " + repo.getName() );
+                writeObject( repo, "localRepository", true );
+            }
+            endTag( "localRepositories", true );
+        }
+    }
+
+    private static void backupAllRepositoryPurgeConfigurations()
+        throws Exception
+    {
+        LOGGER.info( "Backup repository purge configurations" );
+        List<RepositoryPurgeConfiguration> purgeConfigs = client.getAllRepositoryPurgeConfigurations();
+        if ( purgeConfigs != null && !purgeConfigs.isEmpty() )
+        {
+            startTag( "repositoryPurgeConfigurations", true );
+            for ( RepositoryPurgeConfiguration purgeConfig : purgeConfigs )
+            {
+                LOGGER.debug( "Backup repository purge configuration" );
+                backupRepositoryPurgeConfiguration( purgeConfig );
+            }
+            endTag( "repositoryPurgeConfigurations", true );
+        }
+    }
+
+    private static void backupRepositoryPurgeConfiguration( RepositoryPurgeConfiguration repoPurge )
+        throws Exception
+    {
+        if ( repoPurge == null )
+        {
+            return;
+        }
+        startTag( "repositoryPurgeConfiguration", true );
+        writeSimpleFields( repoPurge );
+        
+        if ( repoPurge.getRepository() != null )
+        {
+            writeTagWithParameter( "repository", "id", String.valueOf( repoPurge.getRepository().getId() ) );
+        }
+
+        if ( repoPurge.getSchedule() != null )
+        {
+            writeTagWithParameter( "schedule", "id", String.valueOf( repoPurge.getSchedule().getId() ) );
+        }
+        endTag( "repositoryPurgeConfiguration", true );
+    }
+
+    private static void backupAllDirectoryPurgeConfigurations()
+        throws Exception
+    {
+        LOGGER.info( "Backup repository purge configurations" );
+        List<DirectoryPurgeConfiguration> purgeConfigs = client.getAllDirectoryPurgeConfigurations();
+        if ( purgeConfigs != null && !purgeConfigs.isEmpty() )
+        {
+            startTag( "directoryPurgeConfigurations", true );
+            for ( DirectoryPurgeConfiguration purgeConfig : purgeConfigs )
+            {
+                LOGGER.debug( "Backup directory purge configuration" );
+                backupDirectoryPurgeConfiguration( purgeConfig );
+            }
+            endTag( "directoryPurgeConfigurations", true );
+        }
+    }
+
+    private static void backupDirectoryPurgeConfiguration( DirectoryPurgeConfiguration dirPurge )
+        throws Exception
+    {
+        if ( dirPurge == null )
+        {
+            return;
+        }
+        startTag( "directoryPurgeConfiguration", true);
+        writeSimpleFields( dirPurge );
+
+        if ( dirPurge.getSchedule() != null )
+        {
+            writeTagWithParameter( "schedule", "id", String.valueOf( dirPurge.getSchedule().getId() ) );
+        }
+        endTag( "directoryPurgeConfiguration", true );
+    }
+
+    private static void backupContinuumReleaseResultsForProjectGroup( int projectGroupId )
+        throws Exception
+    {
+        LOGGER.info( "Backup release results" );
+        List<ContinuumReleaseResult> results = client.getReleaseResultsForProjectGroup( projectGroupId );
+        if ( results != null && !results.isEmpty() )
+        {
+            startTag( "continuumReleaseResults", true );
+            for ( ContinuumReleaseResult result : results )
+            {
+                LOGGER.debug( "Backup release result" );
+                backupContinuumReleaseResult( result );
+            }
+            endTag( "continuumReleaseResults", true );
+        }
+    }
+
+    private static void backupContinuumReleaseResult( ContinuumReleaseResult result )
+        throws Exception
+    {
+        if ( result == null )
+        {
+            return;
+        }
+        startTag( "continuumReleaseResult", true );
+        writeSimpleFields( result );
+
+        if ( result.getProjectGroup() != null )
+        {
+            writeTagWithParameter( "projectGroup", "id", String.valueOf( result.getProjectGroup().getId() ) );
+        }
+        if ( result.getProject() != null )
+        {
+            writeTagWithParameter( "project", "id", String.valueOf( result.getProject().getId() ) );
+        }
+        endTag( "continuumReleaseResult", true );
+    }
 }

Modified: continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-client/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-client/pom.xml?rev=705113&r1=705112&r2=705113&view=diff
==============================================================================
--- continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-client/pom.xml (original)
+++ continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-client/pom.xml Wed Oct 15 18:08:36 2008
@@ -52,7 +52,7 @@
             <!-- automatically creates the classpath using all project dependencies, 
                  also adding the project build directory -->
             <classpath />
-            <argument>org.apache.continuum.xmlrpc.client.SampleClient</argument>
+            <argument>org.apache.maven.continuum.xmlrpc.client.SampleClient</argument>
           </arguments>
         </configuration>
       </plugin>

Modified: continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java?rev=705113&r1=705112&r2=705113&view=diff
==============================================================================
--- continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java (original)
+++ continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/ContinuumXmlRpcClient.java Wed Oct 15 18:08:36 2008
@@ -19,6 +19,10 @@
  * under the License.
  */
 
+import org.apache.continuum.xmlrpc.release.ContinuumReleaseResult;
+import org.apache.continuum.xmlrpc.repository.DirectoryPurgeConfiguration;
+import org.apache.continuum.xmlrpc.repository.LocalRepository;
+import org.apache.continuum.xmlrpc.repository.RepositoryPurgeConfiguration;
 import org.apache.maven.continuum.xmlrpc.ContinuumService;
 import org.apache.maven.continuum.xmlrpc.project.AddingResult;
 import org.apache.maven.continuum.xmlrpc.project.BuildDefinition;
@@ -525,6 +529,156 @@
         return continuum.isProjectInBuildingQueue( projectId );
     }
 
+    public int removeProjectsFromBuildingQueue( int[] projectsId )
+        throws Exception
+    {
+        return continuum.removeProjectsFromBuildingQueue( projectsId );
+    }
+
+    public boolean cancelCurrentBuild()
+        throws Exception
+    {
+        return continuum.cancelCurrentBuild();
+    }
+
+    // ----------------------------------------------------------------------
+    // Release Result
+    // ----------------------------------------------------------------------
+
+    public ContinuumReleaseResult getReleaseResult( int releaseId )
+        throws Exception
+    {
+        return continuum.getReleaseResult( releaseId );
+    }
+
+    public List<ContinuumReleaseResult> getReleaseResultsForProjectGroup( int projectGroupId )
+        throws Exception
+    {
+        return continuum.getReleaseResultsForProjectGroup( projectGroupId );
+    }
+
+    public int removeReleaseResult( ContinuumReleaseResult releaseResult )
+        throws Exception
+    {
+        return continuum.removeReleaseResult( releaseResult );
+    }
+
+    public String getReleaseOutput( int releaseId )
+        throws Exception
+    {
+        return continuum.getReleaseOutput( releaseId );
+    }
+
+    // ----------------------------------------------------------------------
+    // Purge Configuration
+    // ----------------------------------------------------------------------
+
+    public RepositoryPurgeConfiguration addRepositoryPurgeConfiguration( RepositoryPurgeConfiguration repoPurge )
+        throws Exception
+    {
+        return continuum.addRepositoryPurgeConfiguration( repoPurge );
+    }
+
+    public int updateRepositoryPurgeConfiguration( RepositoryPurgeConfiguration repoPurge )
+        throws Exception
+    {
+        return continuum.updateRepositoryPurgeConfiguration( repoPurge );
+    }
+
+    public int removeRepositoryPurgeConfiguration( int repoPurgeId )
+        throws Exception
+    {
+        return continuum.removeRepositoryPurgeConfiguration( repoPurgeId );
+    }
+
+    public RepositoryPurgeConfiguration getRepositoryPurgeConfiguration( int repoPurgeId )
+        throws Exception
+    {
+        return continuum.getRepositoryPurgeConfiguration( repoPurgeId );
+    }
+
+    public List<RepositoryPurgeConfiguration> getAllRepositoryPurgeConfigurations()
+        throws Exception
+    {
+        return continuum.getAllRepositoryPurgeConfigurations();
+    }
+
+    public DirectoryPurgeConfiguration addDirectoryPurgeConfiguration( DirectoryPurgeConfiguration dirPurge )
+        throws Exception
+    {
+        return continuum.addDirectoryPurgeConfiguration( dirPurge );
+    }
+
+    public int updateDirectoryPurgeConfiguration( DirectoryPurgeConfiguration dirPurge )
+        throws Exception
+    {
+        return continuum.updateDirectoryPurgeConfiguration( dirPurge );
+    }
+
+    public int removeDirectoryPurgeConfiguration( int dirPurgeId )
+        throws Exception
+    {
+        return continuum.removeDirectoryPurgeConfiguration( dirPurgeId );
+    }
+
+    public DirectoryPurgeConfiguration getDirectoryPurgeConfiguration( int dirPurgeId )
+        throws Exception
+    {
+        return continuum.getDirectoryPurgeConfiguration( dirPurgeId );
+    }
+
+    public List<DirectoryPurgeConfiguration> getAllDirectoryPurgeConfigurations()
+        throws Exception
+    {
+        return continuum.getAllDirectoryPurgeConfigurations();
+    }
+
+    public void purgeLocalRepository( int repoPurgeId )
+        throws Exception
+    {
+        continuum.purgeLocalRepository( repoPurgeId );
+    }
+
+    public void purgeDirectory( int dirPurgeId )
+        throws Exception
+    {
+        continuum.purgeDirectory( dirPurgeId );
+    }
+
+    // ----------------------------------------------------------------------
+    // Local Repository
+    // ----------------------------------------------------------------------
+
+    public LocalRepository addLocalRepository( LocalRepository repository )
+        throws Exception
+    {
+        return continuum.addLocalRepository( repository );
+    }
+
+    public int updateLocalRepository( LocalRepository repository )
+        throws Exception
+    {
+        return continuum.updateLocalRepository( repository );
+    }
+
+    public int removeLocalRepository( int repositoryId )
+        throws Exception
+    {
+        return continuum.removeLocalRepository( repositoryId );
+    }
+
+    public LocalRepository getLocalRepository( int repositoryId )
+        throws Exception
+    {
+        return continuum.getLocalRepository( repositoryId );
+    }
+
+    public List<LocalRepository> getAllLocalRepositories()
+        throws Exception
+    {
+        return continuum.getAllLocalRepositories();
+    }
+
     public Map<String, Object> addAntProjectRPC( Map<String, Object> project )
         throws Exception
     {
@@ -916,4 +1070,94 @@
     {
         return continuum.updateProfileRPC( profile );
     }
+
+    public Map<String, Object> getReleaseResultRPC( int releaseId )
+        throws Exception
+    {
+        return continuum.getReleaseResultRPC( releaseId );
+    }
+
+    public List<Object> getReleaseResultsForProjectGroupRPC( int projectGroupId )
+        throws Exception
+    {
+        return continuum.getReleaseResultsForProjectGroupRPC( projectGroupId );
+    }
+
+    public int removeReleaseResultRPC( Map<String, Object> rr )
+        throws Exception
+    {
+        return continuum.removeReleaseResultRPC( rr );
+    }
+
+    public Map<String, Object> addRepositoryPurgeConfigurationRPC( Map<String, Object> repoPurge )
+        throws Exception
+    {
+        return continuum.addRepositoryPurgeConfigurationRPC( repoPurge );
+    }
+
+    public int updateRepositoryPurgeConfigurationRPC( Map<String, Object> repoPurge )
+        throws Exception
+    {
+        return continuum.updateRepositoryPurgeConfigurationRPC( repoPurge );
+    }
+
+    public Map<String, Object> getRepositoryPurgeConfigurationRPC( int repoPurgeId )
+        throws Exception
+    {
+        return continuum.getRepositoryPurgeConfigurationRPC( repoPurgeId );
+    }
+
+    public List<Object> getAllRepositoryPurgeConfigurationsRPC()
+        throws Exception
+    {
+        return continuum.getAllRepositoryPurgeConfigurationsRPC();
+    }
+
+    public Map<String, Object> addDirectoryPurgeConfigurationRPC( Map<String, Object> dirPurge )
+        throws Exception
+    {
+        return continuum.addDirectoryPurgeConfigurationRPC( dirPurge );
+    }
+
+    public int updateDirectoryPurgeConfigurationRPC( Map<String, Object> dirPurge )
+        throws Exception
+    {
+        return continuum.updateDirectoryPurgeConfigurationRPC( dirPurge );
+    }
+
+    public Map<String, Object> getDirectoryPurgeConfigurationRPC( int dirPurgeId )
+        throws Exception
+    {
+        return continuum.getDirectoryPurgeConfigurationRPC( dirPurgeId );
+    }
+
+    public List<Object> getAllDirectoryPurgeConfigurationsRPC()
+        throws Exception
+    {
+        return continuum.getAllDirectoryPurgeConfigurationsRPC();
+    }
+
+    public Map<String, Object> addLocalRepositoryRPC( Map<String, Object> repository )
+        throws Exception
+    {
+        return continuum.addLocalRepositoryRPC( repository );
+    }
+
+    public int updateLocalRepositoryRPC( Map<String, Object> repository )
+        throws Exception
+    {
+        return continuum.updateLocalRepositoryRPC( repository );
+    }
+
+    public Map<String, Object> getLocalRepositoryRPC( int repositoryId )
+        throws Exception
+    {
+        return continuum.getLocalRepositoryRPC( repositoryId );
+    }
+
+    public List<Object> getAllLocalRepositoriesRPC()
+        throws Exception
+    {
+        return continuum.getAllLocalRepositoriesRPC();
+    }
 }

Modified: continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/SampleClient.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/SampleClient.java?rev=705113&r1=705112&r2=705113&view=diff
==============================================================================
--- continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/SampleClient.java (original)
+++ continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-client/src/main/java/org/apache/maven/continuum/xmlrpc/client/SampleClient.java Wed Oct 15 18:08:36 2008
@@ -19,6 +19,9 @@
  * under the License.
  */
 
+import org.apache.continuum.xmlrpc.repository.DirectoryPurgeConfiguration;
+import org.apache.continuum.xmlrpc.repository.LocalRepository;
+import org.apache.continuum.xmlrpc.repository.RepositoryPurgeConfiguration;
 import org.apache.maven.continuum.xmlrpc.project.AddingResult;
 import org.apache.maven.continuum.xmlrpc.project.BuildDefinition;
 import org.apache.maven.continuum.xmlrpc.project.BuildResult;
@@ -60,10 +63,7 @@
         {
             ProjectGroupSummary pg = (ProjectGroupSummary) i.next();
             projectGroupId = pg.getId();
-            System.out.println( "Id: " + pg.getId() );
-            System.out.println( "Group Id" + pg.getGroupId() );
-            System.out.println( "Name: " + pg.getName() );
-            System.out.println( "Description:" + pg.getDescription() );
+            printProjectGroupSummary( client.getProjectGroupSummary( projectGroupId ) );
         }
 
         System.out.println();
@@ -170,6 +170,70 @@
             "Removing Project Group '" + pg.getName() + "' - " + pg.getGroupId() + " (" + pg.getId() + ")'..." );
         client.removeProjectGroup( pg.getId() );
         System.out.println( "Done." );
+        System.out.println();
+
+        LocalRepository repository = new LocalRepository();
+        repository.setLocation( "/home/marica/repository" );
+        repository.setName( "Repository" );
+        repository.setLayout( "default" );
+        System.out.println( "Adding local repository..." );
+        repository = client.addLocalRepository( repository );
+        System.out.println();
+
+        System.out.println( "Repository list" );
+        System.out.println( "=====================" );
+        List<LocalRepository> repositories = client.getAllLocalRepositories();
+        for ( LocalRepository repo : repositories )
+        {
+            printLocalRepository( repo );
+            System.out.println();
+        }
+
+        DirectoryPurgeConfiguration dirPurgeConfig = new DirectoryPurgeConfiguration();
+        dirPurgeConfig.setDirectoryType( "buildOutput" );
+        System.out.println( "Adding Directory Purge Configuration..." );
+        dirPurgeConfig = client.addDirectoryPurgeConfiguration( dirPurgeConfig );
+        System.out.println();
+        
+        RepositoryPurgeConfiguration purgeConfig = new RepositoryPurgeConfiguration();
+        purgeConfig.setDeleteAll( true );
+        purgeConfig.setRepository( repository );
+        purgeConfig.setDescription( "Delete all artifacts from repository" );
+        System.out.println( "Adding Repository Purge Configuration..." );
+        purgeConfig = client.addRepositoryPurgeConfiguration( purgeConfig );
+        System.out.println();
+
+        System.out.println( "Repository Purge list" );
+        System.out.println( "=====================" );
+        List<RepositoryPurgeConfiguration> repoPurges = client.getAllRepositoryPurgeConfigurations();
+        for ( RepositoryPurgeConfiguration repoPurge : repoPurges )
+        {
+            printRepositoryPurgeConfiguration( repoPurge );
+        }
+        System.out.println();
+
+        System.out.println( "Remove local repository" );
+        System.out.println( "=====================" );
+        System.out.println( "Removing Local Repository '" + repository.getName() + "' (" + 
+                            repository.getId() + ")..." );
+        client.removeLocalRepository( repository.getId() );
+        System.out.println( "Done." );
+    }
+
+    public static void printProjectGroupSummary( ProjectGroupSummary pg )
+    {
+        System.out.println( "Id: " + pg.getId() );
+        System.out.println( "Group Id" + pg.getGroupId() );
+        System.out.println( "Name: " + pg.getName() );
+        System.out.println( "Description:" + pg.getDescription() );
+        if ( pg.getLocalRepository() != null )
+        {
+            System.out.println( "Local Repository:" + pg.getLocalRepository().getName() );
+        }
+        else
+        {
+            System.out.println( "Local Repository:" );
+        }
     }
 
     public static void printProjectSummary( ProjectSummary project )
@@ -262,4 +326,23 @@
         System.out.println( buildDef.isDefaultForProject() );
     }
 
+    public static void printLocalRepository( LocalRepository repo )
+    {
+        System.out.println( "Id: " +repo.getId() );
+        System.out.println( "Layout: " + repo.getLayout() );
+        System.out.println( "Location: " + repo.getLocation() );
+        System.out.println( "Name: " + repo.getName() );
+    }
+
+    public static void printRepositoryPurgeConfiguration( RepositoryPurgeConfiguration repoPurge )
+    {
+        System.out.println( "Id: " + repoPurge.getId() );
+        System.out.println( "Description: " + repoPurge.getDescription() );
+        System.out.println( "Local Repository: " + repoPurge.getRepository().getName() );
+        System.out.println( "Days Older: " + repoPurge.getDaysOlder() );
+        System.out.println( "Retention Count: " + repoPurge.getRetentionCount() );
+        System.out.println( "Delete All: " + repoPurge.isDeleteAll() );
+        System.out.println( "Delete Released Snapshots: " + repoPurge.isDeleteReleasedSnapshots() );
+        System.out.println( "Default Purge: " + repoPurge.isDefaultPurge() );
+    }
 }

Modified: continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/AbstractContinuumSecureService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/AbstractContinuumSecureService.java?rev=705113&r1=705112&r2=705113&view=diff
==============================================================================
--- continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/AbstractContinuumSecureService.java (original)
+++ continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/AbstractContinuumSecureService.java Wed Oct 15 18:08:36 2008
@@ -501,4 +501,51 @@
 
         checkAuthorization( ContinuumRoleConstants.CONTINUUM_MANAGE_BUILD_TEMPLATES );
     }
+
+    protected void checkManageQueuesAuthorization()
+        throws ContinuumException
+    {
+        if ( !isAuthenticated() )
+        {
+            throw new ContinuumException( "Authentication required." );
+        }
+
+        checkAuthorization( ContinuumRoleConstants.CONTINUUM_MANAGE_QUEUES );
+    }
+
+    protected void checkManagePurgingAuthorization()
+        throws ContinuumException
+    {
+        if ( !isAuthenticated() )
+        {
+            throw new ContinuumException( "Authentication required." );
+        }
+
+        try
+        {
+            checkAuthorization( ContinuumRoleConstants.SYSTEM_ADMINISTRATOR_ROLE );
+        }
+        catch ( ContinuumException e )
+        {
+            checkAuthorization( ContinuumRoleConstants.CONTINUUM_MANAGE_PURGING );
+        }
+    }
+
+    protected void checkManageRepositoriesAuthorization()
+        throws ContinuumException
+    {
+        if ( !isAuthenticated() )
+        {
+            throw new ContinuumException( "Authentication required." );
+        }
+    
+        try
+        {
+            checkAuthorization( ContinuumRoleConstants.SYSTEM_ADMINISTRATOR_ROLE );
+        }
+        catch ( ContinuumException e )
+        {
+            checkAuthorization( ContinuumRoleConstants.CONTINUUM_MANAGE_REPOSITORIES );
+        }
+    }
 }

Modified: continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java?rev=705113&r1=705112&r2=705113&view=diff
==============================================================================
--- continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java (original)
+++ continuum/branches/continuum-1.2.x/continuum-xmlrpc/continuum-xmlrpc-server/src/main/java/org/apache/maven/continuum/xmlrpc/server/ContinuumServiceImpl.java Wed Oct 15 18:08:36 2008
@@ -22,6 +22,13 @@
 import net.sf.dozer.util.mapping.DozerBeanMapperSingletonWrapper;
 import net.sf.dozer.util.mapping.MapperIF;
 import org.apache.continuum.dao.SystemConfigurationDao;
+import org.apache.continuum.purge.ContinuumPurgeManagerException;
+import org.apache.continuum.purge.PurgeConfigurationServiceException;
+import org.apache.continuum.repository.RepositoryServiceException;
+import org.apache.continuum.xmlrpc.release.ContinuumReleaseResult;
+import org.apache.continuum.xmlrpc.repository.DirectoryPurgeConfiguration;
+import org.apache.continuum.xmlrpc.repository.LocalRepository;
+import org.apache.continuum.xmlrpc.repository.RepositoryPurgeConfiguration;
 import org.apache.maven.continuum.Continuum;
 import org.apache.maven.continuum.ContinuumException;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
@@ -331,6 +338,10 @@
 
         pg.setDescription( projectGroup.getDescription() );
 
+        org.apache.continuum.model.repository.LocalRepository repo = 
+            new org.apache.continuum.model.repository.LocalRepository();
+        pg.setLocalRepository( populateLocalRepository( projectGroup.getLocalRepository(), repo ) );
+        
         continuum.updateProjectGroup( pg );
         return getProjectGroupSummary( projectGroup.getId() );
     }
@@ -1034,6 +1045,378 @@
         return populateBuildProjectTaskList( continuum.getProjectsInBuildQueue() );
     }
 
+    public int removeProjectsFromBuildingQueue( int[] projectsId )
+        throws ContinuumException
+    {
+        checkManageQueuesAuthorization();
+        continuum.removeProjectsFromBuildingQueue( projectsId );
+        return 0;
+    }
+
+    public boolean cancelCurrentBuild()
+        throws ContinuumException
+    {
+        checkManageQueuesAuthorization();
+        return continuum.cancelCurrentBuild();
+    }
+
+    // ----------------------------------------------------------------------
+    // Release Results
+    // ----------------------------------------------------------------------
+
+    public ContinuumReleaseResult getReleaseResult( int releaseId )
+        throws ContinuumException
+    {
+        org.apache.continuum.model.release.ContinuumReleaseResult releaseResult = continuum.getContinuumReleaseResult( releaseId );
+        checkViewProjectGroupAuthorization( getProjectGroupName( releaseResult.getProjectGroup().getId() ) );
+        return populateReleaseResult( releaseResult );
+    }
+
+    public List<ContinuumReleaseResult> getReleaseResultsForProjectGroup( int projectGroupId )
+        throws ContinuumException
+    {
+        checkViewProjectGroupAuthorization( getProjectGroupName( projectGroupId ) );
+        Collection releaseResults = continuum.getContinuumReleaseResultsByProjectGroup( projectGroupId );
+        
+        List<ContinuumReleaseResult> r = new ArrayList<ContinuumReleaseResult>();
+        for ( Object releaseResult : releaseResults )
+        {
+            r.add( populateReleaseResult( (org.apache.continuum.model.release.ContinuumReleaseResult) releaseResult ) );
+        }
+        return r;
+    }
+
+    public int removeReleaseResult( ContinuumReleaseResult releaseResult )
+        throws ContinuumException
+    {
+        checkModifyProjectGroupAuthorization( getProjectGroupName( releaseResult.getProjectGroup().getId() ) );
+        continuum.removeContinuumReleaseResult( releaseResult.getId() );
+        return 0;
+    }
+
+    public String getReleaseOutput( int releaseId )
+        throws ContinuumException
+    {
+        org.apache.continuum.model.release.ContinuumReleaseResult releaseResult = continuum.getContinuumReleaseResult( releaseId );
+        checkViewProjectGroupAuthorization( getProjectGroupName( releaseResult.getProjectGroup().getId() ) );
+
+        return continuum.getReleaseOutput( releaseId );
+    }
+
+    // ----------------------------------------------------------------------
+    // Purge Configuration
+    // ----------------------------------------------------------------------
+
+    public RepositoryPurgeConfiguration addRepositoryPurgeConfiguration( RepositoryPurgeConfiguration repoPurge )
+        throws ContinuumException
+    {
+        checkManagePurgingAuthorization();
+        
+        try
+        {
+            org.apache.continuum.model.repository.RepositoryPurgeConfiguration newPurge = 
+                new org.apache.continuum.model.repository.RepositoryPurgeConfiguration();
+            return populateRepositoryPurgeConfiguration( continuum.getPurgeConfigurationService().
+                                                         addRepositoryPurgeConfiguration( populateRepositoryPurgeConfiguration( repoPurge, newPurge ) ) );
+        }
+        catch ( RepositoryServiceException e )
+        {
+            throw new ContinuumException( "Error while converting repository purge configuration", e );
+        }
+        catch ( PurgeConfigurationServiceException e )
+        {
+            throw new ContinuumException( "Can't add repositoryPurgeConfiguration", e );
+        }
+    }
+
+    public int updateRepositoryPurgeConfiguration( RepositoryPurgeConfiguration repoPurge )
+        throws ContinuumException
+    {
+        checkManagePurgingAuthorization();
+        
+        try
+        {
+            org.apache.continuum.model.repository.RepositoryPurgeConfiguration purge = 
+                new org.apache.continuum.model.repository.RepositoryPurgeConfiguration();
+            continuum.getPurgeConfigurationService().updateRepositoryPurgeConfiguration( populateRepositoryPurgeConfiguration( repoPurge, purge ) );
+            return 0;
+        }
+        catch ( RepositoryServiceException e )
+        {
+            throw new ContinuumException( "Error while converting repository purge configuration", e );
+        }
+        catch ( PurgeConfigurationServiceException e )
+        {
+            throw new ContinuumException( "Cant' update repository PurgeException", e );
+        }
+    }
+
+    public int removeRepositoryPurgeConfiguration( int repoPurgeId )
+        throws ContinuumException
+    {
+        checkManagePurgingAuthorization();
+
+        try
+        {
+            org.apache.continuum.model.repository.RepositoryPurgeConfiguration repoPurge = 
+                continuum.getPurgeConfigurationService().getRepositoryPurgeConfiguration( repoPurgeId );
+            continuum.getPurgeConfigurationService().removeRepositoryPurgeConfiguration( repoPurge );
+            return 0;
+        }
+        catch ( PurgeConfigurationServiceException e )
+        {
+            throw new ContinuumException( "Can't delete repository purge configuration", e );
+        }
+    }
+
+    public RepositoryPurgeConfiguration getRepositoryPurgeConfiguration( int repoPurgeId )
+        throws ContinuumException
+    {
+        checkManagePurgingAuthorization();
+
+        try
+        {
+            org.apache.continuum.model.repository.RepositoryPurgeConfiguration repoPurgeConfig = 
+                continuum.getPurgeConfigurationService().getRepositoryPurgeConfiguration( repoPurgeId );
+            return populateRepositoryPurgeConfiguration( repoPurgeConfig );
+        }
+        catch ( PurgeConfigurationServiceException e )
+        {
+            throw new ContinuumException( "Error while retrieving repository purge configuration", e );
+        }
+    }
+
+    public List<RepositoryPurgeConfiguration> getAllRepositoryPurgeConfigurations()
+        throws ContinuumException
+    {
+        checkManagePurgingAuthorization();
+        Collection repoPurgeConfigs = continuum.getPurgeConfigurationService().getAllRepositoryPurgeConfigurations();
+        
+        List<RepositoryPurgeConfiguration> r = new ArrayList<RepositoryPurgeConfiguration>();
+        for ( Object repoPurgeConfig : repoPurgeConfigs )
+        {
+            r.add( populateRepositoryPurgeConfiguration( ( org.apache.continuum.model.repository.RepositoryPurgeConfiguration ) repoPurgeConfig ) );
+        }
+        return r;
+    }
+
+    public DirectoryPurgeConfiguration addDirectoryPurgeConfiguration( DirectoryPurgeConfiguration dirPurge )
+        throws ContinuumException
+    {
+        checkManagePurgingAuthorization();
+
+        try
+        {
+            org.apache.continuum.model.repository.DirectoryPurgeConfiguration newPurge =
+                new org.apache.continuum.model.repository.DirectoryPurgeConfiguration();
+            return populateDirectoryPurgeConfiguration( continuum.getPurgeConfigurationService().
+                                                        addDirectoryPurgeConfiguration( populateDirectoryPurgeConfiguration( dirPurge, newPurge ) ) );
+        }
+        catch ( RepositoryServiceException e )
+        {
+            throw new ContinuumException( "Error while converting directory purge configuration", e );
+        }
+        catch ( PurgeConfigurationServiceException e )
+        {
+            throw new ContinuumException( "Can't add directory purge configuration", e );
+        }
+    }
+
+    public int updateDirectoryPurgeConfiguration( DirectoryPurgeConfiguration dirPurge )
+        throws ContinuumException
+    {
+        checkManagePurgingAuthorization();
+
+        try
+        {
+            org.apache.continuum.model.repository.DirectoryPurgeConfiguration purge =
+                new org.apache.continuum.model.repository.DirectoryPurgeConfiguration();
+            continuum.getPurgeConfigurationService().updateDirectoryPurgeConfiguration( populateDirectoryPurgeConfiguration( dirPurge, purge ) );
+            return 0;
+        }
+        catch ( RepositoryServiceException e )
+        {
+            throw new ContinuumException( "Error while converting directory purge configuration", e );
+        }
+        catch ( PurgeConfigurationServiceException e )
+        {
+            throw new ContinuumException( "Can't add directory purge configuration", e );
+        }
+    }
+
+    public int removeDirectoryPurgeConfiguration( int dirPurgeId )
+        throws ContinuumException
+    {
+        checkManagePurgingAuthorization();
+        
+        try
+        {
+            org.apache.continuum.model.repository.DirectoryPurgeConfiguration dirPurge =
+                continuum.getPurgeConfigurationService().getDirectoryPurgeConfiguration( dirPurgeId );
+            continuum.getPurgeConfigurationService().removeDirectoryPurgeConfiguration( dirPurge );
+            return 0;
+        }
+        catch ( PurgeConfigurationServiceException e )
+        {
+            throw new ContinuumException( "Can't delete directory purge configuration", e );
+        }
+    }
+
+    public DirectoryPurgeConfiguration getDirectoryPurgeConfiguration( int dirPurgeId )
+        throws ContinuumException
+    {
+        checkManagePurgingAuthorization();
+
+        try
+        {
+            org.apache.continuum.model.repository.DirectoryPurgeConfiguration dirPurgeConfig = continuum.getPurgeConfigurationService().getDirectoryPurgeConfiguration( dirPurgeId );
+            return populateDirectoryPurgeConfiguration( dirPurgeConfig );
+        }
+        catch ( PurgeConfigurationServiceException e )
+        {
+            throw new ContinuumException( "Error while retrieving directory purge configuration", e );
+        }
+    }
+
+    public List<DirectoryPurgeConfiguration> getAllDirectoryPurgeConfigurations()
+        throws ContinuumException
+    {
+        checkManagePurgingAuthorization();
+        Collection dirPurgeConfigs = continuum.getPurgeConfigurationService().getAllDirectoryPurgeConfigurations();
+
+        List<DirectoryPurgeConfiguration> d = new ArrayList<DirectoryPurgeConfiguration>();
+        for ( Object dirPurgeConfig : dirPurgeConfigs )
+        {
+            d.add( populateDirectoryPurgeConfiguration( ( org.apache.continuum.model.repository.DirectoryPurgeConfiguration ) dirPurgeConfig ) );
+        }
+        return d;
+    }
+    
+    public void purgeLocalRepository( int repoPurgeId )
+        throws ContinuumException
+    {
+        checkManagePurgingAuthorization();
+
+        try
+        {
+            org.apache.continuum.model.repository.RepositoryPurgeConfiguration repoPurgeConfig = continuum.getPurgeConfigurationService().getRepositoryPurgeConfiguration( repoPurgeId );
+            continuum.getPurgeManager().purgeRepository( repoPurgeConfig );
+        }
+        catch ( PurgeConfigurationServiceException e )
+        {
+            throw new ContinuumException( "Error while retrieving repository purge configuration", e );
+        }
+        catch ( ContinuumPurgeManagerException e )
+        {
+            throw new ContinuumException( "Error while purging local repository", e );
+        }
+    }
+
+    public void purgeDirectory( int dirPurgeId )
+        throws ContinuumException
+    {
+        checkManagePurgingAuthorization();
+
+        try
+        {
+            org.apache.continuum.model.repository.DirectoryPurgeConfiguration dirPurgeConfig = continuum.getPurgeConfigurationService().getDirectoryPurgeConfiguration( dirPurgeId );
+            continuum.getPurgeManager().purgeDirectory( dirPurgeConfig );
+        }
+        catch ( PurgeConfigurationServiceException e )
+        {
+            throw new ContinuumException( "Error while retrieving directory purge configuration", e );
+        }
+        catch ( ContinuumPurgeManagerException e )
+        {
+            throw new ContinuumException( "Error while purging directory", e );
+        }
+    }
+
+    // ----------------------------------------------------------------------
+    // Local Repository
+    // ----------------------------------------------------------------------
+
+    public LocalRepository addLocalRepository( LocalRepository repository )
+        throws ContinuumException
+    {
+        checkManageRepositoriesAuthorization();
+
+        try
+        {
+            org.apache.continuum.model.repository.LocalRepository newRepository =
+                        new org.apache.continuum.model.repository.LocalRepository();
+            return populateLocalRepository( continuum.getRepositoryService().addLocalRepository(
+                                           populateLocalRepository( repository, newRepository ) ) );
+        }
+        catch ( RepositoryServiceException e )
+        {
+            throw new ContinuumException( "Unable to add repository", e );
+        }
+    }
+
+    public int updateLocalRepository( LocalRepository repository )
+        throws ContinuumException
+    {
+        checkManageRepositoriesAuthorization();
+
+        try
+        {
+            final org.apache.continuum.model.repository.LocalRepository newRepo =
+                            continuum.getRepositoryService().getLocalRepository( repository.getId() );
+            continuum.getRepositoryService().updateLocalRepository( populateLocalRepository( repository, newRepo ) );
+            return 0;
+        }
+        catch ( RepositoryServiceException e )
+        {
+            throw new ContinuumException( "Can't update repository", e );
+        }
+    }
+
+    public int removeLocalRepository( int repositoryId )
+        throws ContinuumException
+    {
+        checkManageRepositoriesAuthorization();
+
+        try
+        {
+            continuum.getRepositoryService().removeLocalRepository( repositoryId );
+            return 0;
+        }
+        catch ( RepositoryServiceException e)
+        {
+            throw new ContinuumException( "Can't delete repository", e );
+        }
+    }
+
+    public LocalRepository getLocalRepository( int repositoryId )
+        throws ContinuumException
+    {
+        checkManageRepositoriesAuthorization();
+        
+        try
+        {
+            return populateLocalRepository( continuum.getRepositoryService().getLocalRepository( repositoryId ) );
+        }
+        catch ( RepositoryServiceException e )
+        {
+            throw new ContinuumException( "Error while retrieving repository.", e);
+        }
+    }
+
+    public List<LocalRepository> getAllLocalRepositories()
+        throws ContinuumException
+    {
+        checkManageRepositoriesAuthorization();
+        Collection repos = continuum.getRepositoryService().getAllLocalRepositories();
+
+        List<LocalRepository> r = new ArrayList<LocalRepository>();
+        for ( Object repo : repos )
+        {
+            r.add( populateLocalRepository( (org.apache.continuum.model.repository.LocalRepository) repo ) );
+        }
+        return r;
+    }
+
     // ----------------------------------------------------------------------
     // Converters
     // ----------------------------------------------------------------------
@@ -1119,6 +1502,9 @@
         g.setGroupId( group.getGroupId() );
         g.setId( group.getId() );
         g.setName( group.getName() );
+        org.apache.continuum.model.repository.LocalRepository repo =
+            new org.apache.continuum.model.repository.LocalRepository();
+        g.setLocalRepository( populateLocalRepository( group.getLocalRepository(), repo ) );
         return g;
     }
 
@@ -1341,6 +1727,120 @@
         return (SystemConfiguration) mapper.map( sysConf, SystemConfiguration.class );
     }
 
+    private ContinuumReleaseResult populateReleaseResult( org.apache.continuum.model.release.ContinuumReleaseResult releaseResult )
+    {
+        return (ContinuumReleaseResult) mapper.map( releaseResult, ContinuumReleaseResult.class );
+    }
+
+    private RepositoryPurgeConfiguration populateRepositoryPurgeConfiguration( org.apache.continuum.model.repository.RepositoryPurgeConfiguration repoPurgeConfig )
+    {
+        return (RepositoryPurgeConfiguration) mapper.map( repoPurgeConfig, RepositoryPurgeConfiguration.class );
+    }
+
+    private org.apache.continuum.model.repository.RepositoryPurgeConfiguration populateRepositoryPurgeConfiguration( RepositoryPurgeConfiguration repoPurgeConfig,
+                                                                                                                     org.apache.continuum.model.repository.RepositoryPurgeConfiguration repoPurge )
+        throws RepositoryServiceException, ContinuumException
+    {
+        if ( repoPurgeConfig == null )
+        {
+            return null;
+        }
+
+        repoPurge.setDaysOlder( repoPurgeConfig.getDaysOlder() );
+        repoPurge.setDefaultPurge( repoPurgeConfig.isDefaultPurge() );
+        repoPurge.setDeleteAll( repoPurgeConfig.isDeleteAll() );
+        repoPurge.setDeleteReleasedSnapshots( repoPurgeConfig.isDeleteReleasedSnapshots() );
+        repoPurge.setDescription( repoPurgeConfig.getDescription() );
+        repoPurge.setEnabled( repoPurgeConfig.isEnabled() );
+        repoPurge.setRetentionCount( repoPurgeConfig.getRetentionCount() );
+        if ( repoPurgeConfig.getRepository() != null )
+        {
+            repoPurge.setRepository( populateLocalRepository( repoPurgeConfig.getRepository(), continuum.getRepositoryService().
+                                                              getLocalRepository( repoPurgeConfig.getRepository().getId() ) ) );
+        }
+        else
+        {
+            repoPurge.setRepository( null );
+        }
+        if ( repoPurgeConfig.getSchedule() != null )
+        {
+            repoPurge.setSchedule( populateSchedule( repoPurgeConfig.getSchedule(), continuum.getSchedule( repoPurgeConfig.getSchedule()
+                            .getId() ) ) );
+        }
+        else
+        {
+            repoPurge.setSchedule( null );
+        }
+
+        return repoPurge;
+    }
+
+    private DirectoryPurgeConfiguration populateDirectoryPurgeConfiguration( org.apache.continuum.model.repository.DirectoryPurgeConfiguration dirPurgeConfig )
+    {
+        return (DirectoryPurgeConfiguration) mapper.map( dirPurgeConfig, DirectoryPurgeConfiguration.class );
+    }
+
+    private org.apache.continuum.model.repository.DirectoryPurgeConfiguration populateDirectoryPurgeConfiguration( DirectoryPurgeConfiguration dirPurgeConfig, 
+                                                                                                                   org.apache.continuum.model.repository.DirectoryPurgeConfiguration dirPurge )
+        throws RepositoryServiceException, ContinuumException
+    {
+        if ( dirPurgeConfig == null )
+        {
+            return null;
+        }
+
+        dirPurge.setDaysOlder( dirPurgeConfig.getDaysOlder() );
+        dirPurge.setDefaultPurge( dirPurgeConfig.isDefaultPurge() );
+        dirPurge.setDeleteAll( dirPurgeConfig.isDeleteAll() );
+        dirPurge.setDescription( dirPurgeConfig.getDescription() );
+        dirPurge.setDirectoryType( dirPurgeConfig.getDirectoryType() );
+        dirPurge.setEnabled( dirPurgeConfig.isEnabled() );
+
+        String path = "";
+
+        if ( dirPurge.getDirectoryType().equals( "releases" ) )
+        {
+            path = continuum.getConfiguration().getWorkingDirectory().getAbsolutePath();
+        }
+        else if ( dirPurge.getDirectoryType().equals( "buildOutput" ) )
+        {
+            path = continuum.getConfiguration().getBuildOutputDirectory().getAbsolutePath();
+        }
+        
+        dirPurge.setLocation( path );
+        dirPurge.setRetentionCount( dirPurgeConfig.getRetentionCount() );
+        if ( dirPurgeConfig.getSchedule() != null )
+        {
+            dirPurge.setSchedule( populateSchedule( dirPurgeConfig.getSchedule(), continuum.getSchedule( dirPurgeConfig.getSchedule()
+                            .getId() ) ) );
+        }
+        else
+        {
+            dirPurge.setSchedule( null );
+        }
+
+        return dirPurge;
+    }
+
+    private LocalRepository populateLocalRepository( org.apache.continuum.model.repository.LocalRepository localRepository )
+    {
+        return (LocalRepository) mapper.map( localRepository, LocalRepository.class );
+    }
+
+    private org.apache.continuum.model.repository.LocalRepository populateLocalRepository( LocalRepository repository,
+                                                                                           org.apache.continuum.model.repository.LocalRepository repo )
+    {
+        if ( repository == null )
+        {
+            return null;
+        }
+
+        repo.setLayout( repository.getLayout() );
+        repo.setLocation( repository.getLocation() );
+        repo.setName( repository.getName() );
+        return repo;
+    }
+
     private Map<String, Object> serializeObject( Object o, final String ... ignore )
     {
         if ( o != null )
@@ -2039,4 +2539,94 @@
     {
         return this.updateProfile( (Profile) unserializeObject( profile ) );
     }
+
+    public Map<String,Object> getReleaseResultRPC( int releaseId )
+        throws Exception
+    {
+        return serializeObject( this.getReleaseResult( releaseId ) );
+    }
+
+    public List<Object> getReleaseResultsForProjectGroupRPC( int projectGroupId )
+        throws Exception
+    {
+        return serializeObject( this.getReleaseResultsForProjectGroup( projectGroupId ) );
+    }
+
+    public int removeReleaseResultRPC( Map<String, Object> rr )
+        throws Exception
+    {
+        return serializeObject( this.removeReleaseResult( (ContinuumReleaseResult) unserializeObject( rr ) ) );
+    }
+
+    public Map<String, Object> addRepositoryPurgeConfigurationRPC( Map<String, Object> repoPurge )
+        throws Exception
+    {
+        return serializeObject( this.addRepositoryPurgeConfiguration( (RepositoryPurgeConfiguration) unserializeObject( repoPurge ) ) );
+    }
+
+    public int updateRepositoryPurgeConfigurationRPC( Map<String, Object> repoPurge )
+        throws Exception
+    {
+        return serializeObject( this.updateRepositoryPurgeConfiguration( (RepositoryPurgeConfiguration) unserializeObject( repoPurge ) ) );
+    }
+
+    public Map<String, Object> getRepositoryPurgeConfigurationRPC( int repoPurgeId )
+        throws Exception
+    {
+        return serializeObject( this.getRepositoryPurgeConfiguration( repoPurgeId ) );
+    }
+
+    public List<Object> getAllRepositoryPurgeConfigurationsRPC()
+        throws Exception
+    {
+        return serializeObject( this.getAllDirectoryPurgeConfigurations() );
+    }
+
+    public Map<String, Object> addDirectoryPurgeConfigurationRPC( Map<String, Object> dirPurge )
+        throws Exception
+    {
+        return serializeObject( this.addDirectoryPurgeConfiguration( (DirectoryPurgeConfiguration) unserializeObject( dirPurge ) ) );
+    }
+
+    public int updateDirectoryPurgeConfigurationRPC( Map<String, Object> dirPurge )
+        throws Exception
+    {
+        return serializeObject( this.updateDirectoryPurgeConfiguration( (DirectoryPurgeConfiguration) unserializeObject( dirPurge ) ) );
+    }
+
+    public Map<String, Object> getDirectoryPurgeConfigurationRPC( int dirPurgeId )
+        throws Exception
+    {
+        return serializeObject( this.getDirectoryPurgeConfiguration( dirPurgeId ) );
+    }
+
+    public List<Object> getAllDirectoryPurgeConfigurationsRPC()
+        throws Exception
+    {
+        return serializeObject( this.getAllRepositoryPurgeConfigurations() );
+    }
+
+    public Map<String, Object> addLocalRepositoryRPC( Map<String, Object> repository )
+        throws Exception
+    {
+        return serializeObject( this.addLocalRepository( (LocalRepository) unserializeObject( repository ) ) );
+    }
+
+    public int updateLocalRepositoryRPC( Map<String, Object> repository )
+        throws Exception
+    {
+        return serializeObject( this.updateLocalRepository( (LocalRepository) unserializeObject( repository ) ) );
+    }
+
+    public Map<String, Object> getLocalRepositoryRPC( int repositoryId )
+        throws Exception
+    {
+        return serializeObject( this.getLocalRepository( repositoryId ) );
+    }
+
+    public List<Object> getAllLocalRepositoriesRPC()
+        throws Exception
+    {
+        return serializeObject( this.getAllLocalRepositories() );
+    }
 }



Mime
View raw message