]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1513] Remove DatabaseScanningConfiguration fields
authorOlivier Lamy <olamy@apache.org>
Thu, 8 Sep 2011 15:13:58 +0000 (15:13 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 8 Sep 2011 15:13:58 +0000 (15:13 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1166734 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java
archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.java

index dab62ab34a4354809c367efcfe6eeef069b3cbac..7e68ff9c6725fbf121efe4e566d635210e95d8e0 100644 (file)
@@ -494,18 +494,7 @@ public class DefaultArchivaConfiguration
                 section.removeSubset( "repositoryScanning.invalidContentConsumers" );
             }
         }
-        if ( configuration.getDatabaseScanning() != null )
-        {
-            if ( configuration.getDatabaseScanning().getCleanupConsumers().isEmpty() && section != null )
-            {
-                section.removeSubset( "databaseScanning.cleanupConsumers" );
 
-            }
-            if ( configuration.getDatabaseScanning().getUnprocessedConsumers().isEmpty() && section != null )
-            {
-                section.removeSubset( "databaseScanning.unprocessedConsumers" );
-            }
-        }
 
         new ConfigurationRegistryWriter().write( configuration, section );
         section.save();
@@ -522,11 +511,7 @@ public class DefaultArchivaConfiguration
             c.setRefreshCronExpression( escapeCronExpression( c.getRefreshCronExpression() ) );
         }
 
-        DatabaseScanningConfiguration scanning = configuration.getDatabaseScanning();
-        if ( scanning != null )
-        {
-            scanning.setCronExpression( escapeCronExpression( scanning.getCronExpression() ) );
-        }
+
     }
 
     private Registry createDefaultConfigurationFile()
@@ -735,12 +720,7 @@ public class DefaultArchivaConfiguration
             c.setRefreshCronExpression( unescapeCronExpression( c.getRefreshCronExpression() ) );
         }
 
-        DatabaseScanningConfiguration databaseScanning = config.getDatabaseScanning();
-        if ( databaseScanning != null )
-        {
-            String cron = databaseScanning.getCronExpression();
-            databaseScanning.setCronExpression( unescapeCronExpression( cron ) );
-        }
+
 
         return config;
     }
index 4b3a74b888cf78eafa4e76db016240607bf558bb..c31a7e5314472ff1f3f5d0d83aae96eaaba2baff 100644 (file)
             The repository scanning configuration.
           </description>
         </field>
-        <field>
-          <name>databaseScanning</name>
-          <version>1.0.0+</version>
-          <association>
-            <type>DatabaseScanningConfiguration</type>
-            <multiplicity>1</multiplicity>
-          </association>
-          <description>
-            The database scanning configuration.
-          </description>
-        </field>
         <field>
           <name>webapp</name>
           <version>1.0.0+</version>
         </field>
       </fields>
     </class>
-    <class>
-      <name>DatabaseScanningConfiguration</name>
-      <version>1.0.0+</version>
-      <description>
-        The scanning configuration for unprocessed ArchivaArtifact database objects.
-      </description>
-      <fields>
-        <field>
-          <name>cronExpression</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-          <description>When to run the database scanning mechanism. Default is every two hours on the hour.
-          </description>
-          <defaultValue>0 0 0/2 * * ?</defaultValue>
-        </field>
-        <field>
-          <name>unprocessedConsumers</name>
-          <version>1.0.0+</version>
-          <required>true</required>
-          <association>
-            <type>String</type>
-            <multiplicity>*</multiplicity>
-          </association>
-          <description>
-            The list of consumers for the unprocessed ArchivaArtifact database objects.
-          </description>
-        </field>
-        <field>
-          <name>cleanupConsumers</name>
-          <version>1.0.0+</version>
-          <required>true</required>
-          <deprecated>true</deprecated>
-          <association>
-            <type>String</type>
-            <multiplicity>*</multiplicity>
-          </association>
-          <description>
-            The list of consumers for previously processed ArchivaArtifact database
-            objects that no longer exist on the filesystem, and might need to
-            undergo a cleanup.
-          </description>
-        </field>
-      </fields>
-    </class>
 
     <!--
     __        _______ ____    _    ____  ____
index 048544ece626c5156b3c3235bf4f89d98d3b198e..5587db04fc6ed65d99a204a76155b930fd6e541e 100644 (file)
@@ -174,11 +174,6 @@ public class ArchivaConfigurationTest
         assertNotNull( "check 'artifacts' file type", patterns );
         assertEquals( "check 'artifacts' patterns", 13, patterns.size() );
 
-        DatabaseScanningConfiguration dbScanning = configuration.getDatabaseScanning();
-        assertNotNull( "check database scanning", dbScanning );
-        assertEquals( "check unprocessed consumers", 6, dbScanning.getUnprocessedConsumers().size() );
-        assertEquals( "check cleanup consumers", 3, dbScanning.getCleanupConsumers().size() );
-
         WebappConfiguration webapp = configuration.getWebapp();
         assertNotNull( "check webapp", webapp );
 
@@ -731,7 +726,6 @@ public class ArchivaConfigurationTest
 
         assertEquals( "check cron expression", "0 0,30 * * * ?", repository.getRefreshCronExpression().trim() );
 
-        configuration.getDatabaseScanning().setCronExpression( "0 0,15 0 * * ?" );
 
         // add a test listener to confirm it doesn't see the escaped format. We don't need to test the number of calls,
         // etc. as it's done in other tests
@@ -741,10 +735,6 @@ public class ArchivaConfigurationTest
             {
                 assertEquals( ConfigurationEvent.SAVED, event.getType() );
 
-                Configuration configuration = archivaConfiguration.getConfiguration();
-
-                assertEquals( "check cron expression", "0 0,15 0 * * ?",
-                              configuration.getDatabaseScanning().getCronExpression() );
             }
         } );
 
@@ -752,9 +742,6 @@ public class ArchivaConfigurationTest
 
         configuration = archivaConfiguration.getConfiguration();
 
-        assertEquals( "check cron expression", "0 0,15 0 * * ?",
-                      configuration.getDatabaseScanning().getCronExpression() );
-
         // test for the escape character '\' showing up on repositories.jsp
         repository.setRefreshCronExpression( "0 0,20 0 * * ?" );
 
@@ -833,16 +820,6 @@ public class ArchivaConfigurationTest
         scanning.removeInvalidContentConsumer( consumer );
         assertTrue( scanning.getInvalidContentConsumers().isEmpty() );
 
-        DatabaseScanningConfiguration databaseScanning = configuration.getDatabaseScanning();
-        consumer = (String) databaseScanning.getCleanupConsumers().get( 0 );
-        assertNotNull( consumer );
-        databaseScanning.removeCleanupConsumer( consumer );
-        assertTrue( databaseScanning.getCleanupConsumers().isEmpty() );
-        consumer = (String) databaseScanning.getUnprocessedConsumers().get( 0 );
-        assertNotNull( consumer );
-        databaseScanning.removeUnprocessedConsumer( consumer );
-        assertTrue( databaseScanning.getUnprocessedConsumers().isEmpty() );
-
         archivaConfiguration.save( configuration );
 
         archivaConfiguration = (ArchivaConfiguration) lookup( ArchivaConfiguration.class, "test-read-saved" );
@@ -856,9 +833,6 @@ public class ArchivaConfigurationTest
         scanning = configuration.getRepositoryScanning();
         assertTrue( scanning.getKnownContentConsumers().isEmpty() );
         assertTrue( scanning.getInvalidContentConsumers().isEmpty() );
-        databaseScanning = configuration.getDatabaseScanning();
-        assertTrue( databaseScanning.getCleanupConsumers().isEmpty() );
-        assertTrue( databaseScanning.getUnprocessedConsumers().isEmpty() );
     }
 
     /**