mirror of https://github.com/apache/archiva.git
[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:
parent
1b9083f019
commit
0f5a5fd895
|
@ -19,7 +19,10 @@ package org.apache.maven.archiva.consumers.core;
|
||||||
* under the License.
|
* 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.ArchivaConfiguration;
|
||||||
|
import org.apache.maven.archiva.configuration.ConfigurationNames;
|
||||||
import org.apache.maven.archiva.configuration.FileTypes;
|
import org.apache.maven.archiva.configuration.FileTypes;
|
||||||
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
|
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
|
||||||
import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
|
import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
|
||||||
|
@ -95,8 +98,6 @@ public class ArtifactMissingChecksumsConsumer
|
||||||
|
|
||||||
private File repositoryDir;
|
private File repositoryDir;
|
||||||
|
|
||||||
private List<String> propertyNameTriggers = new ArrayList<String>();
|
|
||||||
|
|
||||||
private List<String> includes = new ArrayList<String>();
|
private List<String> includes = new ArrayList<String>();
|
||||||
|
|
||||||
public String getId()
|
public String getId()
|
||||||
|
@ -173,7 +174,7 @@ public class ArtifactMissingChecksumsConsumer
|
||||||
|
|
||||||
public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
|
public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
|
||||||
{
|
{
|
||||||
if ( propertyNameTriggers.contains( propertyName ) )
|
if ( ConfigurationNames.isRepositoryScanning( propertyName ) )
|
||||||
{
|
{
|
||||||
initIncludes();
|
initIncludes();
|
||||||
}
|
}
|
||||||
|
@ -194,13 +195,6 @@ public class ArtifactMissingChecksumsConsumer
|
||||||
public void initialize()
|
public void initialize()
|
||||||
throws InitializationException
|
throws InitializationException
|
||||||
{
|
{
|
||||||
propertyNameTriggers = new ArrayList<String>();
|
|
||||||
propertyNameTriggers.add( "repositoryScanning" );
|
|
||||||
propertyNameTriggers.add( "fileTypes" );
|
|
||||||
propertyNameTriggers.add( "fileType" );
|
|
||||||
propertyNameTriggers.add( "patterns" );
|
|
||||||
propertyNameTriggers.add( "pattern" );
|
|
||||||
|
|
||||||
configuration.addChangeListener( this );
|
configuration.addChangeListener( this );
|
||||||
|
|
||||||
initIncludes();
|
initIncludes();
|
||||||
|
|
|
@ -19,7 +19,10 @@ package org.apache.maven.archiva.consumers.core;
|
||||||
* under the License.
|
* 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.ArchivaConfiguration;
|
||||||
|
import org.apache.maven.archiva.configuration.ConfigurationNames;
|
||||||
import org.apache.maven.archiva.configuration.FileTypes;
|
import org.apache.maven.archiva.configuration.FileTypes;
|
||||||
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
|
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
|
||||||
import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
|
import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
|
||||||
|
@ -70,8 +73,6 @@ public class AutoRemoveConsumer
|
||||||
|
|
||||||
private File repositoryDir;
|
private File repositoryDir;
|
||||||
|
|
||||||
private List<String> propertyNameTriggers = new ArrayList<String>();
|
|
||||||
|
|
||||||
private List<String> includes = new ArrayList<String>();
|
private List<String> includes = new ArrayList<String>();
|
||||||
|
|
||||||
public String getId()
|
public String getId()
|
||||||
|
@ -123,7 +124,7 @@ public class AutoRemoveConsumer
|
||||||
|
|
||||||
public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
|
public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
|
||||||
{
|
{
|
||||||
if ( propertyNameTriggers.contains( propertyName ) )
|
if ( ConfigurationNames.isRepositoryScanning( propertyName ) )
|
||||||
{
|
{
|
||||||
initIncludes();
|
initIncludes();
|
||||||
}
|
}
|
||||||
|
@ -144,13 +145,6 @@ public class AutoRemoveConsumer
|
||||||
public void initialize()
|
public void initialize()
|
||||||
throws InitializationException
|
throws InitializationException
|
||||||
{
|
{
|
||||||
propertyNameTriggers = new ArrayList<String>();
|
|
||||||
propertyNameTriggers.add( "repositoryScanning" );
|
|
||||||
propertyNameTriggers.add( "fileTypes" );
|
|
||||||
propertyNameTriggers.add( "fileType" );
|
|
||||||
propertyNameTriggers.add( "patterns" );
|
|
||||||
propertyNameTriggers.add( "pattern" );
|
|
||||||
|
|
||||||
configuration.addChangeListener( this );
|
configuration.addChangeListener( this );
|
||||||
|
|
||||||
initIncludes();
|
initIncludes();
|
||||||
|
|
|
@ -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.ArchivaConfiguration;
|
||||||
|
import org.apache.maven.archiva.configuration.ConfigurationNames;
|
||||||
import org.apache.maven.archiva.configuration.FileTypes;
|
import org.apache.maven.archiva.configuration.FileTypes;
|
||||||
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
|
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
|
||||||
import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
|
import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
|
||||||
|
@ -198,7 +199,7 @@ public class RepositoryPurgeConsumer
|
||||||
|
|
||||||
public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
|
public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
|
||||||
{
|
{
|
||||||
if ( propertyNameTriggers.contains( propertyName ) )
|
if ( ConfigurationNames.isRepositoryScanning( propertyName ) )
|
||||||
{
|
{
|
||||||
initIncludes();
|
initIncludes();
|
||||||
}
|
}
|
||||||
|
@ -219,13 +220,6 @@ public class RepositoryPurgeConsumer
|
||||||
public void initialize()
|
public void initialize()
|
||||||
throws InitializationException
|
throws InitializationException
|
||||||
{
|
{
|
||||||
propertyNameTriggers = new ArrayList<String>();
|
|
||||||
propertyNameTriggers.add( "repositoryScanning" );
|
|
||||||
propertyNameTriggers.add( "fileTypes" );
|
|
||||||
propertyNameTriggers.add( "fileType" );
|
|
||||||
propertyNameTriggers.add( "patterns" );
|
|
||||||
propertyNameTriggers.add( "pattern" );
|
|
||||||
|
|
||||||
configuration.addChangeListener( this );
|
configuration.addChangeListener( this );
|
||||||
|
|
||||||
initIncludes();
|
initIncludes();
|
||||||
|
|
|
@ -21,6 +21,7 @@ package org.apache.maven.archiva.consumers.lucene;
|
||||||
|
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.apache.maven.archiva.configuration.ArchivaConfiguration;
|
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.FileTypes;
|
||||||
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
|
import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
|
||||||
import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
|
import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
|
||||||
|
@ -99,8 +100,6 @@ public class IndexContentConsumer
|
||||||
*/
|
*/
|
||||||
private RepositoryContentIndexFactory indexFactory;
|
private RepositoryContentIndexFactory indexFactory;
|
||||||
|
|
||||||
private List<String> propertyNameTriggers = new ArrayList<String>();
|
|
||||||
|
|
||||||
private List<String> includes = new ArrayList<String>();
|
private List<String> includes = new ArrayList<String>();
|
||||||
|
|
||||||
private RepositoryContentIndex index;
|
private RepositoryContentIndex index;
|
||||||
|
@ -198,7 +197,7 @@ public class IndexContentConsumer
|
||||||
|
|
||||||
public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
|
public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
|
||||||
{
|
{
|
||||||
if ( propertyNameTriggers.contains( propertyName ) )
|
if ( ConfigurationNames.isRepositoryScanning( propertyName ) )
|
||||||
{
|
{
|
||||||
initIncludes();
|
initIncludes();
|
||||||
}
|
}
|
||||||
|
@ -219,13 +218,6 @@ public class IndexContentConsumer
|
||||||
public void initialize()
|
public void initialize()
|
||||||
throws InitializationException
|
throws InitializationException
|
||||||
{
|
{
|
||||||
propertyNameTriggers = new ArrayList<String>();
|
|
||||||
propertyNameTriggers.add( "repositoryScanning" );
|
|
||||||
propertyNameTriggers.add( "fileTypes" );
|
|
||||||
propertyNameTriggers.add( "fileType" );
|
|
||||||
propertyNameTriggers.add( "patterns" );
|
|
||||||
propertyNameTriggers.add( "pattern" );
|
|
||||||
|
|
||||||
configuration.addChangeListener( this );
|
configuration.addChangeListener( this );
|
||||||
|
|
||||||
initIncludes();
|
initIncludes();
|
||||||
|
|
Loading…
Reference in New Issue