]> source.dussan.org Git - archiva.git/commitdiff
merged -r691527 (MRM-841: changed registry trigger condition for repo-purge, auto...
authorMaria Odea B. Ching <oching@apache.org>
Thu, 4 Sep 2008 04:13:08 +0000 (04:13 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Thu, 4 Sep 2008 04:13:08 +0000 (04:13 +0000)
from trunk

git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-1.1.x@691867 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRemoveConsumer.java
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumer.java
archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexContentConsumer.java

index 5532899293704b912697f89858e46035bc2847f8..7ce2db1445632ec090270869b9a22500d2cb0a65 100644 (file)
@@ -19,7 +19,10 @@ package org.apache.maven.archiva.consumers.core;
  * under the License.
  */
 
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.configuration.ConfigurationNames;
 import org.apache.maven.archiva.configuration.FileTypes;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
@@ -94,9 +97,7 @@ public class ArtifactMissingChecksumsConsumer
     private static final String TYPE_CHECKSUM_CANNOT_CREATE = "checksum-create-failure";
 
     private File repositoryDir;
-
-    private List<String> propertyNameTriggers = new ArrayList<String>();
-
+    
     private List<String> includes = new ArrayList<String>();
 
     public String getId()
@@ -172,8 +173,8 @@ public class ArtifactMissingChecksumsConsumer
     }
 
     public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
-    {
-        if ( propertyNameTriggers.contains( propertyName ) )
+    {             
+        if ( ConfigurationNames.isRepositoryScanning( propertyName ) )
         {
             initIncludes();
         }
@@ -194,15 +195,8 @@ public class ArtifactMissingChecksumsConsumer
     public void initialize()
         throws InitializationException
     {
-        propertyNameTriggers = new ArrayList<String>();
-        propertyNameTriggers.add( "repositoryScanning" );
-        propertyNameTriggers.add( "fileTypes" );
-        propertyNameTriggers.add( "fileType" );
-        propertyNameTriggers.add( "patterns" );
-        propertyNameTriggers.add( "pattern" );
-
         configuration.addChangeListener( this );
-
+        
         initIncludes();
     }
 }
index 618b91f21b4aa76feb4fefbdd2b9df37cab4d2eb..a5112272be35b95892d46b791043b428c1ec0c28 100644 (file)
@@ -19,7 +19,10 @@ package org.apache.maven.archiva.consumers.core;
  * under the License.
  */
 
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.configuration.ConfigurationNames;
 import org.apache.maven.archiva.configuration.FileTypes;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
@@ -69,9 +72,7 @@ public class AutoRemoveConsumer
     private FileTypes filetypes;
 
     private File repositoryDir;
-
-    private List<String> propertyNameTriggers = new ArrayList<String>();
-
+    
     private List<String> includes = new ArrayList<String>();
 
     public String getId()
@@ -122,8 +123,8 @@ public class AutoRemoveConsumer
     }
 
     public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
-    {
-        if ( propertyNameTriggers.contains( propertyName ) )
+    {                
+        if ( ConfigurationNames.isRepositoryScanning( propertyName ) )
         {
             initIncludes();
         }
@@ -143,14 +144,7 @@ public class AutoRemoveConsumer
 
     public void initialize()
         throws InitializationException
-    {
-        propertyNameTriggers = new ArrayList<String>();
-        propertyNameTriggers.add( "repositoryScanning" );
-        propertyNameTriggers.add( "fileTypes" );
-        propertyNameTriggers.add( "fileType" );
-        propertyNameTriggers.add( "patterns" );
-        propertyNameTriggers.add( "pattern" );
-
+    {     
         configuration.addChangeListener( this );
 
         initIncludes();
index dacee4891db0151597bd5cf9f2e05540cf6ea58a..ad13411bbb14d96e82b35c9992a638f11aeef909 100644 (file)
@@ -20,6 +20,7 @@ package org.apache.maven.archiva.consumers.core.repository;
  */
 
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.configuration.ConfigurationNames;
 import org.apache.maven.archiva.configuration.FileTypes;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
@@ -198,7 +199,7 @@ public class RepositoryPurgeConsumer
 
     public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
     {
-        if ( propertyNameTriggers.contains( propertyName ) )
+        if ( ConfigurationNames.isRepositoryScanning( propertyName ) )
         {
             initIncludes();
         }
@@ -219,13 +220,6 @@ public class RepositoryPurgeConsumer
     public void initialize()
         throws InitializationException
     {
-        propertyNameTriggers = new ArrayList<String>();
-        propertyNameTriggers.add( "repositoryScanning" );
-        propertyNameTriggers.add( "fileTypes" );
-        propertyNameTriggers.add( "fileType" );
-        propertyNameTriggers.add( "patterns" );
-        propertyNameTriggers.add( "pattern" );
-
         configuration.addChangeListener( this );
 
         initIncludes();
index 3bb2b8677f862ddb528bef86456eddd729029019..1cdcb60339f3968c6e3f7ba209a2302fade545c6 100644 (file)
@@ -21,6 +21,7 @@ package org.apache.maven.archiva.consumers.lucene;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.configuration.ConfigurationNames;
 import org.apache.maven.archiva.configuration.FileTypes;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
@@ -98,9 +99,7 @@ public class IndexContentConsumer
      * @plexus.requirement role-hint="lucene"
      */
     private RepositoryContentIndexFactory indexFactory;
-
-    private List<String> propertyNameTriggers = new ArrayList<String>();
-
+    
     private List<String> includes = new ArrayList<String>();
 
     private RepositoryContentIndex index;
@@ -198,7 +197,7 @@ public class IndexContentConsumer
 
     public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
     {
-        if ( propertyNameTriggers.contains( propertyName ) )
+        if ( ConfigurationNames.isRepositoryScanning( propertyName ) )
         {
             initIncludes();
         }
@@ -219,13 +218,6 @@ public class IndexContentConsumer
     public void initialize()
         throws InitializationException
     {
-        propertyNameTriggers = new ArrayList<String>();
-        propertyNameTriggers.add( "repositoryScanning" );
-        propertyNameTriggers.add( "fileTypes" );
-        propertyNameTriggers.add( "fileType" );
-        propertyNameTriggers.add( "patterns" );
-        propertyNameTriggers.add( "pattern" );
-
         configuration.addChangeListener( this );
 
         initIncludes();