continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmora...@apache.org
Subject svn commit: r776907 - in /continuum/branches/continuum-1.3.x: continuum-api/src/main/java/org/apache/continuum/dao/ continuum-api/src/main/java/org/apache/continuum/purge/ continuum-core/src/main/java/org/apache/continuum/purge/ continuum-core/src/main...
Date Thu, 21 May 2009 01:01:43 GMT
Author: jmorales
Date: Thu May 21 01:01:43 2009
New Revision: 776907

URL: http://svn.apache.org/viewvc?rev=776907&view=rev
Log:
[CONTINUUM-2235] Only schedule enabled purgeConfiguration

Modified:
    continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDao.java
    continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDao.java
    continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/purge/PurgeConfigurationService.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/purge/DefaultContinuumPurgeManager.java
    continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/build/settings/DefaultSchedulesActivator.java
    continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/DefaultPurgeConfigurationService.java
    continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDaoImpl.java
    continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDaoImpl.java

Modified: continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDao.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDao.java?rev=776907&r1=776906&r2=776907&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDao.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDao.java
Thu May 21 01:01:43 2009
@@ -34,6 +34,8 @@
 
     List<DirectoryPurgeConfiguration> getDirectoryPurgeConfigurationsBySchedule( int
scheduleId );
 
+    List<DirectoryPurgeConfiguration> getEnableDirectoryPurgeConfigurationsBySchedule(
int scheduleId );
+    
     List<DirectoryPurgeConfiguration> getDirectoryPurgeConfigurationsByLocation( String
location );
 
     List<DirectoryPurgeConfiguration> getDirectoryPurgeConfigurationsByType( String
type );

Modified: continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDao.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDao.java?rev=776907&r1=776906&r2=776907&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDao.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDao.java
Thu May 21 01:01:43 2009
@@ -33,6 +33,8 @@
     List<RepositoryPurgeConfiguration> getAllRepositoryPurgeConfigurations();
 
     List<RepositoryPurgeConfiguration> getRepositoryPurgeConfigurationsBySchedule(
int scheduleId );
+    
+    List<RepositoryPurgeConfiguration> getEnableRepositoryPurgeConfigurationsBySchedule(
int scheduleId );
 
     List<RepositoryPurgeConfiguration> getRepositoryPurgeConfigurationsByLocalRepository(
int repositoryId );
 

Modified: continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/purge/PurgeConfigurationService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/purge/PurgeConfigurationService.java?rev=776907&r1=776906&r2=776907&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/purge/PurgeConfigurationService.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-api/src/main/java/org/apache/continuum/purge/PurgeConfigurationService.java
Thu May 21 01:01:43 2009
@@ -60,6 +60,8 @@
     
     List<RepositoryPurgeConfiguration> getRepositoryPurgeConfigurationsBySchedule(
int scheduleId );
     
+    List<RepositoryPurgeConfiguration> getEnableRepositoryPurgeConfigurationsBySchedule(
int scheduleId );
+    
     List<RepositoryPurgeConfiguration> getRepositoryPurgeConfigurationsByRepository(
int repositoryId );
     
     List<RepositoryPurgeConfiguration> getAllRepositoryPurgeConfigurations();
@@ -80,6 +82,8 @@
     
     List<DirectoryPurgeConfiguration> getDirectoryPurgeConfigurationsBySchedule( int
scheduleId );
     
+    List<DirectoryPurgeConfiguration> getEnableDirectoryPurgeConfigurationsBySchedule(
int scheduleId );
+    
     List<DirectoryPurgeConfiguration> getDirectoryPurgeConfigurationsByLocation( String
location );
     
     List<DirectoryPurgeConfiguration> getAllDirectoryPurgeConfigurations();

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/purge/DefaultContinuumPurgeManager.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/purge/DefaultContinuumPurgeManager.java?rev=776907&r1=776906&r2=776907&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/purge/DefaultContinuumPurgeManager.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/continuum/purge/DefaultContinuumPurgeManager.java
Thu May 21 01:01:43 2009
@@ -69,8 +69,8 @@
         List<RepositoryPurgeConfiguration> repoPurgeList = null;
         List<DirectoryPurgeConfiguration> dirPurgeList = null;
 
-        repoPurgeList = purgeConfigurationService.getRepositoryPurgeConfigurationsBySchedule(
schedule.getId() );
-        dirPurgeList = purgeConfigurationService.getDirectoryPurgeConfigurationsBySchedule(
schedule.getId() );
+        repoPurgeList = purgeConfigurationService.getEnableRepositoryPurgeConfigurationsBySchedule(
schedule.getId() );
+        dirPurgeList = purgeConfigurationService.getEnableDirectoryPurgeConfigurationsBySchedule(
schedule.getId() );
 
         if ( repoPurgeList != null && repoPurgeList.size() > 0 )
         {

Modified: continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/build/settings/DefaultSchedulesActivator.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/build/settings/DefaultSchedulesActivator.java?rev=776907&r1=776906&r2=776907&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/build/settings/DefaultSchedulesActivator.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-core/src/main/java/org/apache/maven/continuum/build/settings/DefaultSchedulesActivator.java
Thu May 21 01:01:43 2009
@@ -249,9 +249,9 @@
     private boolean isScheduleFromPurgeJob( Schedule schedule )
     {
         List<RepositoryPurgeConfiguration> repoPurgeConfigs =
-            repositoryPurgeConfigurationDao.getRepositoryPurgeConfigurationsBySchedule( schedule.getId()
);
+            repositoryPurgeConfigurationDao.getEnableRepositoryPurgeConfigurationsBySchedule(
schedule.getId() );
         List<DirectoryPurgeConfiguration> dirPurgeConfigs =
-            directoryPurgeConfigurationDao.getDirectoryPurgeConfigurationsBySchedule( schedule.getId()
);
+            directoryPurgeConfigurationDao.getEnableDirectoryPurgeConfigurationsBySchedule(
schedule.getId() );
 
         return repoPurgeConfigs.size() > 0 || dirPurgeConfigs.size() > 0;
 

Modified: continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/DefaultPurgeConfigurationService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/DefaultPurgeConfigurationService.java?rev=776907&r1=776906&r2=776907&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/DefaultPurgeConfigurationService.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-purge/src/main/java/org/apache/continuum/purge/DefaultPurgeConfigurationService.java
Thu May 21 01:01:43 2009
@@ -209,6 +209,11 @@
     {
         return directoryPurgeConfigurationDao.getDirectoryPurgeConfigurationsBySchedule(
scheduleId );
     }
+    
+    public List<DirectoryPurgeConfiguration> getEnableDirectoryPurgeConfigurationsBySchedule(
int scheduleId )
+    {
+        return directoryPurgeConfigurationDao.getEnableDirectoryPurgeConfigurationsBySchedule(
scheduleId );
+    }
 
     public List<RepositoryPurgeConfiguration> getRepositoryPurgeConfigurationsByRepository(
int repositoryId )
     {
@@ -219,6 +224,11 @@
     {
         return repositoryPurgeConfigurationDao.getRepositoryPurgeConfigurationsBySchedule(
scheduleId );
     }
+    
+    public List<RepositoryPurgeConfiguration> getEnableRepositoryPurgeConfigurationsBySchedule(
int scheduleId )
+    {
+        return repositoryPurgeConfigurationDao.getEnableRepositoryPurgeConfigurationsBySchedule(
scheduleId );
+    }
 
     public void removeDirectoryPurgeConfiguration( DirectoryPurgeConfiguration purgeConfig
)
         throws PurgeConfigurationServiceException

Modified: continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDaoImpl.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDaoImpl.java?rev=776907&r1=776906&r2=776907&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDaoImpl.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/DirectoryPurgeConfigurationDaoImpl.java
Thu May 21 01:01:43 2009
@@ -74,6 +74,36 @@
             rollback( tx );
         }
     }
+    
+    public List<DirectoryPurgeConfiguration> getEnableDirectoryPurgeConfigurationsBySchedule(
int scheduleId )
+    {
+        PersistenceManager pm = getPersistenceManager();
+
+        Transaction tx = pm.currentTransaction();
+
+        try
+        {
+            tx.begin();
+
+            Extent extent = pm.getExtent( DirectoryPurgeConfiguration.class, true );
+
+            Query query = pm.newQuery( extent );
+
+            query.declareParameters( "int scheduleId" );
+
+            query.setFilter( "this.schedule.id == scheduleId && this.enabled == true"
);
+
+            List result = (List) query.execute( scheduleId );
+
+            return result == null ? Collections.EMPTY_LIST : (List) pm.detachCopyAll( result
);
+        }
+        finally
+        {
+            tx.commit();
+
+            rollback( tx );
+        }
+    }
 
     public List<DirectoryPurgeConfiguration> getDirectoryPurgeConfigurationsByLocation(
String location )
     {

Modified: continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDaoImpl.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDaoImpl.java?rev=776907&r1=776906&r2=776907&view=diff
==============================================================================
--- continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDaoImpl.java
(original)
+++ continuum/branches/continuum-1.3.x/continuum-store/src/main/java/org/apache/continuum/dao/RepositoryPurgeConfigurationDaoImpl.java
Thu May 21 01:01:43 2009
@@ -75,6 +75,36 @@
             rollback( tx );
         }
     }
+    
+    public List<RepositoryPurgeConfiguration> getEnableRepositoryPurgeConfigurationsBySchedule(
int scheduleId )
+    {
+        PersistenceManager pm = getPersistenceManager();
+
+        Transaction tx = pm.currentTransaction();
+
+        try
+        {
+            tx.begin();
+
+            Extent extent = pm.getExtent( RepositoryPurgeConfiguration.class, true );
+
+            Query query = pm.newQuery( extent );
+
+            query.declareParameters( "int scheduleId" );
+
+            query.setFilter( "this.schedule.id == scheduleId  && this.enabled ==
true" );
+
+            List result = (List) query.execute( scheduleId );
+
+            return result == null ? Collections.EMPTY_LIST : (List) pm.detachCopyAll( result
);
+        }
+        finally
+        {
+            tx.commit();
+
+            rollback( tx );
+        }
+    }
 
     public List<RepositoryPurgeConfiguration> getRepositoryPurgeConfigurationsByLocalRepository(
int repositoryId )
     {



Mime
View raw message