From: Eric Barboni Date: Fri, 10 Oct 2014 20:41:59 +0000 (+0200) Subject: MRM-1865 remove isPermanent flag X-Git-Tag: archiva-2.2.0~84 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c2f9100ddaaa842f4aadd11943d27b5d1142c0e0;p=archiva.git MRM-1865 remove isPermanent flag --- diff --git a/archiva-cli/src/main/java/org/apache/archiva/cli/ArtifactCountConsumer.java b/archiva-cli/src/main/java/org/apache/archiva/cli/ArtifactCountConsumer.java index 6ac24d5ce..583add4f7 100644 --- a/archiva-cli/src/main/java/org/apache/archiva/cli/ArtifactCountConsumer.java +++ b/archiva-cli/src/main/java/org/apache/archiva/cli/ArtifactCountConsumer.java @@ -79,12 +79,6 @@ public class ArtifactCountConsumer return id; } - @Override - public boolean isPermanent() - { - return false; - } - @Override public List getExcludes() { diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/archiva/consumers/Consumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/archiva/consumers/Consumer.java index 103f85a63..b393ec3c3 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/archiva/consumers/Consumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/archiva/consumers/Consumer.java @@ -40,13 +40,6 @@ public abstract interface Consumer */ String getDescription(); - /** - * Flag indicating permanance of consumer. (if it can be disabled or not) - * - * @return true indicating that consumer is permanent and cannot be disabled. - */ - boolean isPermanent(); - /** * Add a consumer monitor to the consumer. * diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/archiva/consumers/functors/PermanentConsumerPredicate.java b/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/archiva/consumers/functors/PermanentConsumerPredicate.java deleted file mode 100644 index af76c4556..000000000 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/src/main/java/org/apache/archiva/consumers/functors/PermanentConsumerPredicate.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.apache.archiva.consumers.functors; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import org.apache.commons.collections.Predicate; -import org.apache.archiva.consumers.Consumer; - -/** - * Selects Consumers that are flaged as 'permanent'. - * - * - */ -public class PermanentConsumerPredicate - implements Predicate -{ - - @Override - public boolean evaluate( Object object ) - { - boolean satisfies = false; - - if ( object instanceof Consumer ) - { - Consumer consumer = (Consumer) object; - satisfies = consumer.isPermanent(); - } - - return satisfies; - } - -} diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java index e04d74422..70fb11933 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java @@ -23,13 +23,10 @@ import org.apache.archiva.admin.model.beans.ManagedRepository; import org.apache.archiva.checksum.ChecksumAlgorithm; import org.apache.archiva.checksum.ChecksummedFile; import org.apache.archiva.configuration.ArchivaConfiguration; -import org.apache.archiva.configuration.ConfigurationNames; import org.apache.archiva.configuration.FileTypes; import org.apache.archiva.consumers.AbstractMonitoredConsumer; import org.apache.archiva.consumers.ConsumerException; import org.apache.archiva.consumers.KnownRepositoryContentConsumer; -import org.apache.archiva.redback.components.registry.Registry; -import org.apache.archiva.redback.components.registry.RegistryListener; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Service; import org.slf4j.Logger; @@ -101,13 +98,7 @@ public class ArtifactMissingChecksumsConsumer { return this.description; } - - @Override - public boolean isPermanent() - { - return false; - } - + @Override public void beginScan( ManagedRepository repo, Date whenGathered ) throws ConsumerException diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRemoveConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRemoveConsumer.java index 3c9c7507c..b323e0190 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRemoveConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRemoveConsumer.java @@ -92,12 +92,6 @@ public class AutoRemoveConsumer return this.description; } - @Override - public boolean isPermanent() - { - return false; - } - @Override public void beginScan( ManagedRepository repository, Date whenGathered ) throws ConsumerException diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRenameConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRenameConsumer.java index d42cbcff7..9445bc98e 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRenameConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/AutoRenameConsumer.java @@ -86,12 +86,6 @@ public class AutoRenameConsumer return this.description; } - @Override - public boolean isPermanent() - { - return false; - } - @Override public void beginScan( ManagedRepository repository, Date whenGathered ) throws ConsumerException diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java index 2f2ca6d29..fe158db9f 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/MetadataUpdaterConsumer.java @@ -296,12 +296,6 @@ public class MetadataUpdaterConsumer } } - @Override - public boolean isPermanent() - { - return false; - } - /* @Override public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue ) diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/ValidateChecksumConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/ValidateChecksumConsumer.java index 35e8bd5f9..4f7de3755 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/ValidateChecksumConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/ValidateChecksumConsumer.java @@ -94,12 +94,6 @@ public class ValidateChecksumConsumer return this.description; } - @Override - public boolean isPermanent() - { - return false; - } - @Override public void beginScan( ManagedRepository repository, Date whenGathered ) throws ConsumerException diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RepositoryPurgeConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RepositoryPurgeConsumer.java index 53c6f12c5..41e4761f9 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RepositoryPurgeConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/archiva/consumers/core/repository/RepositoryPurgeConsumer.java @@ -122,12 +122,6 @@ public class RepositoryPurgeConsumer return this.description; } - @Override - public boolean isPermanent() - { - return false; - } - @Override public List getExcludes() { diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java index 4e6df8cdb..aa999bd6f 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/archiva/consumers/lucene/NexusIndexerConsumer.java @@ -112,12 +112,6 @@ public class NexusIndexerConsumer return "index-content"; } - @Override - public boolean isPermanent() - { - return false; - } - @Override public void beginScan( ManagedRepository repository, Date whenGathered ) throws ConsumerException diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java b/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java index 280a9dc17..a25457cb3 100644 --- a/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java +++ b/archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/src/main/java/org/apache/archiva/consumers/metadata/ArchivaMetadataCreationConsumer.java @@ -106,12 +106,6 @@ public class ArchivaMetadataCreationConsumer return this.description; } - @Override - public boolean isPermanent() - { - return true; - } - @Override public List getExcludes() { diff --git a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java index dc1b08126..1dc82a50d 100644 --- a/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java +++ b/archiva-modules/archiva-base/archiva-converter/src/main/java/org/apache/archiva/converter/legacy/LegacyConverterArtifactConsumer.java @@ -164,12 +164,6 @@ public class LegacyConverterArtifactConsumer return "artifact-legacy-to-default-converter"; } - @Override - public boolean isPermanent() - { - return false; - } - public void setExcludes( List excludes ) { this.excludes = excludes; diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryContentConsumers.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryContentConsumers.java index 4c6077a69..507400eba 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryContentConsumers.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/main/java/org/apache/archiva/repository/scanner/RepositoryContentConsumers.java @@ -175,7 +175,7 @@ public class RepositoryContentConsumers for ( KnownRepositoryContentConsumer consumer : getAvailableKnownConsumers() ) { - if ( knownSelected.contains( consumer.getId() ) || consumer.isPermanent() ) + if ( knownSelected.contains( consumer.getId() ) ) { ret.add( consumer ); } @@ -222,7 +222,7 @@ public class RepositoryContentConsumers for ( InvalidRepositoryContentConsumer consumer : getAvailableInvalidConsumers() ) { - if ( invalidSelected.contains( consumer.getId() ) || consumer.isPermanent() ) + if ( invalidSelected.contains( consumer.getId() ) ) { ret.add( consumer ); } diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/InvalidScanConsumer.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/InvalidScanConsumer.java index 6632c0ff6..cee2d72ec 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/InvalidScanConsumer.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/InvalidScanConsumer.java @@ -118,12 +118,6 @@ public class InvalidScanConsumer return id; } - @Override - public boolean isPermanent() - { - return false; - } - public int getProcessCount() { return processCount; diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/KnownScanConsumer.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/KnownScanConsumer.java index 77c7258ee..f494bf4ec 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/KnownScanConsumer.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/KnownScanConsumer.java @@ -126,12 +126,6 @@ public class KnownScanConsumer this.processCount = processCount; } - @Override - public boolean isPermanent() - { - return false; - } - @Override public boolean isProcessUnmodified() { diff --git a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/SampleKnownConsumer.java b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/SampleKnownConsumer.java index 17138f732..ab9a3c8df 100644 --- a/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/SampleKnownConsumer.java +++ b/archiva-modules/archiva-base/archiva-repository-scanner/src/test/java/org/apache/archiva/repository/scanner/SampleKnownConsumer.java @@ -105,12 +105,6 @@ public class SampleKnownConsumer return id; } - @Override - public boolean isPermanent() - { - return false; - } - public void setId( String id ) { this.id = id; diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/TestConsumer.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/TestConsumer.java index 773c8c536..2de47a1c3 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/TestConsumer.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/test/java/org/apache/archiva/scheduler/repository/TestConsumer.java @@ -62,12 +62,6 @@ public class TestConsumer return null; } - @Override - public boolean isPermanent() - { - return false; - } - @Override public List getIncludes() { diff --git a/archiva-modules/archiva-web/archiva-test-mocks/src/main/java/org/apache/archiva/web/mocks/MockInvalidRepositoryContentConsumer.java b/archiva-modules/archiva-web/archiva-test-mocks/src/main/java/org/apache/archiva/web/mocks/MockInvalidRepositoryContentConsumer.java index b7415874e..e3981bcbd 100644 --- a/archiva-modules/archiva-web/archiva-test-mocks/src/main/java/org/apache/archiva/web/mocks/MockInvalidRepositoryContentConsumer.java +++ b/archiva-modules/archiva-web/archiva-test-mocks/src/main/java/org/apache/archiva/web/mocks/MockInvalidRepositoryContentConsumer.java @@ -46,12 +46,6 @@ public class MockInvalidRepositoryContentConsumer return "the foo"; } - @Override - public boolean isPermanent() - { - return false; - } - @Override public void addConsumerMonitor( ConsumerMonitor monitor ) { diff --git a/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumer.java b/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumer.java index 5cabece94..498300404 100644 --- a/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumer.java +++ b/archiva-modules/plugins/problem-reports/src/main/java/org/apache/archiva/reports/consumers/DuplicateArtifactsConsumer.java @@ -110,12 +110,6 @@ public class DuplicateArtifactsConsumer return description; } - @Override - public boolean isPermanent() - { - return false; - } - @Override public List getIncludes() {