[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
This commit is contained in:
Maria Odea B. Ching 2008-09-03 07:20:15 +00:00
parent 1b9083f019
commit 0f5a5fd895
4 changed files with 19 additions and 45 deletions

View 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();
}
}

View 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();

View 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();

View 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();