aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaria Odea B. Ching <oching@apache.org>2008-09-03 07:20:15 +0000
committerMaria Odea B. Ching <oching@apache.org>2008-09-03 07:20:15 +0000
commit0f5a5fd895451781358976a7cf1a8083df46abdb (patch)
tree4df77f0e9406a5264013b9bef0901404fa3295c0
parent1b9083f0196774cc6f3851be76a27f13c0caf724 (diff)
downloadarchiva-0f5a5fd895451781358976a7cf1a8083df46abdb.tar.gz
archiva-0f5a5fd895451781358976a7cf1a8083df46abdb.zip
[MRM-841]
changed registry trigger condition for repo-purge, auto-remove, create-missing-checksums and index-content consumers git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@691527 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java20
-rw-r--r--archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRemoveConsumer.java20
-rw-r--r--archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumer.java10
-rw-r--r--archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexContentConsumer.java14
4 files changed, 19 insertions, 45 deletions
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java
index 553289929..7ce2db144 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java
@@ -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();
}
}
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRemoveConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRemoveConsumer.java
index 618b91f21..a5112272b 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRemoveConsumer.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRemoveConsumer.java
@@ -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();
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumer.java
index dacee4891..ad13411bb 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumer.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumer.java
@@ -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();
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexContentConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexContentConsumer.java
index 3bb2b8677..1cdcb6033 100644
--- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexContentConsumer.java
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexContentConsumer.java
@@ -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();