diff --git a/minifi/pom.xml b/minifi/pom.xml index 6e78269756..bd2583f118 100644 --- a/minifi/pom.xml +++ b/minifi/pom.xml @@ -486,11 +486,6 @@ limitations under the License. commons-compress 1.21 - - org.apache.commons - commons-lang3 - 3.9 - org.antlr antlr-runtime diff --git a/nifi-commons/nifi-expression-language/pom.xml b/nifi-commons/nifi-expression-language/pom.xml index 266c7bfd4d..d451a33b82 100644 --- a/nifi-commons/nifi-expression-language/pom.xml +++ b/nifi-commons/nifi-expression-language/pom.xml @@ -101,7 +101,6 @@ org.apache.commons commons-lang3 - 3.9 commons-codec diff --git a/nifi-commons/nifi-flowfile-packager/pom.xml b/nifi-commons/nifi-flowfile-packager/pom.xml index 73f98ca98b..540f0a9227 100644 --- a/nifi-commons/nifi-flowfile-packager/pom.xml +++ b/nifi-commons/nifi-flowfile-packager/pom.xml @@ -30,7 +30,6 @@ org.apache.commons commons-lang3 - 3.9 org.apache.commons diff --git a/nifi-commons/nifi-property-encryptor/pom.xml b/nifi-commons/nifi-property-encryptor/pom.xml index 19e0ae677b..fc727b0f01 100644 --- a/nifi-commons/nifi-property-encryptor/pom.xml +++ b/nifi-commons/nifi-property-encryptor/pom.xml @@ -34,7 +34,6 @@ org.apache.commons commons-lang3 - 3.11 commons-codec diff --git a/nifi-commons/nifi-property-protection-aws/pom.xml b/nifi-commons/nifi-property-protection-aws/pom.xml index 973d89d1f9..fab0806b28 100644 --- a/nifi-commons/nifi-property-protection-aws/pom.xml +++ b/nifi-commons/nifi-property-protection-aws/pom.xml @@ -38,7 +38,6 @@ org.apache.commons commons-lang3 - 3.12.0 com.fasterxml.jackson.core diff --git a/nifi-commons/nifi-property-protection-gcp/pom.xml b/nifi-commons/nifi-property-protection-gcp/pom.xml index dd054008b4..c7e7388dc2 100644 --- a/nifi-commons/nifi-property-protection-gcp/pom.xml +++ b/nifi-commons/nifi-property-protection-gcp/pom.xml @@ -49,7 +49,6 @@ org.apache.commons commons-lang3 - 3.12.0 com.google.cloud diff --git a/nifi-commons/nifi-property-protection-hashicorp/pom.xml b/nifi-commons/nifi-property-protection-hashicorp/pom.xml index 5abaacabc0..6c6fff11b1 100644 --- a/nifi-commons/nifi-property-protection-hashicorp/pom.xml +++ b/nifi-commons/nifi-property-protection-hashicorp/pom.xml @@ -35,7 +35,6 @@ org.apache.commons commons-lang3 - 3.12.0 org.springframework diff --git a/nifi-commons/nifi-rocksdb-utils/pom.xml b/nifi-commons/nifi-rocksdb-utils/pom.xml index e404ec409f..bd72ea3ce5 100644 --- a/nifi-commons/nifi-rocksdb-utils/pom.xml +++ b/nifi-commons/nifi-rocksdb-utils/pom.xml @@ -42,7 +42,6 @@ org.apache.commons commons-lang3 - 3.9 test diff --git a/nifi-commons/nifi-schema-utils/pom.xml b/nifi-commons/nifi-schema-utils/pom.xml index 9f06eb0311..2fcd9238ad 100644 --- a/nifi-commons/nifi-schema-utils/pom.xml +++ b/nifi-commons/nifi-schema-utils/pom.xml @@ -24,7 +24,6 @@ org.apache.commons commons-lang3 - 3.9 test diff --git a/nifi-commons/nifi-security-kerberos/pom.xml b/nifi-commons/nifi-security-kerberos/pom.xml index 0a3233a953..9a8d1c55ec 100644 --- a/nifi-commons/nifi-security-kerberos/pom.xml +++ b/nifi-commons/nifi-security-kerberos/pom.xml @@ -35,7 +35,6 @@ org.apache.commons commons-lang3 - 3.11 org.slf4j diff --git a/nifi-commons/nifi-security-utils/pom.xml b/nifi-commons/nifi-security-utils/pom.xml index 2f16d4e17e..db5818b2cf 100644 --- a/nifi-commons/nifi-security-utils/pom.xml +++ b/nifi-commons/nifi-security-utils/pom.xml @@ -50,7 +50,6 @@ org.apache.commons commons-lang3 - 3.12.0 commons-codec diff --git a/nifi-commons/nifi-site-to-site-client/pom.xml b/nifi-commons/nifi-site-to-site-client/pom.xml index b6232fc315..582026daee 100644 --- a/nifi-commons/nifi-site-to-site-client/pom.xml +++ b/nifi-commons/nifi-site-to-site-client/pom.xml @@ -54,7 +54,6 @@ org.apache.commons commons-lang3 - 3.9 com.fasterxml.jackson.core diff --git a/nifi-commons/nifi-socket-utils/pom.xml b/nifi-commons/nifi-socket-utils/pom.xml index 2169e32a55..52ce5aeeb0 100644 --- a/nifi-commons/nifi-socket-utils/pom.xml +++ b/nifi-commons/nifi-socket-utils/pom.xml @@ -45,7 +45,6 @@ org.apache.commons commons-lang3 - 3.9 commons-io diff --git a/nifi-commons/nifi-uuid5/pom.xml b/nifi-commons/nifi-uuid5/pom.xml index b86c1752b9..9a2d12566b 100644 --- a/nifi-commons/nifi-uuid5/pom.xml +++ b/nifi-commons/nifi-uuid5/pom.xml @@ -19,7 +19,6 @@ org.apache.commons commons-lang3 - 3.10 compile diff --git a/nifi-commons/nifi-web-utils/pom.xml b/nifi-commons/nifi-web-utils/pom.xml index 535e750132..c5e3bb4fae 100644 --- a/nifi-commons/nifi-web-utils/pom.xml +++ b/nifi-commons/nifi-web-utils/pom.xml @@ -25,7 +25,6 @@ org.apache.commons commons-lang3 - 3.9 org.glassfish.jersey.core diff --git a/nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-processors/pom.xml b/nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-processors/pom.xml index 2b4b4ee38f..3ea1dbf388 100644 --- a/nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-processors/pom.xml +++ b/nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-processors/pom.xml @@ -48,7 +48,6 @@ org.apache.commons commons-lang3 - 3.9 org.apache.nifi diff --git a/nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-services-api/pom.xml b/nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-services-api/pom.xml index 5a3da1e419..1274ba8b40 100644 --- a/nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-services-api/pom.xml +++ b/nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-services-api/pom.xml @@ -41,7 +41,6 @@ org.apache.commons commons-lang3 - 3.9 org.apache.nifi diff --git a/nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-services/pom.xml b/nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-services/pom.xml index ed198c4e95..fa2351b6c3 100644 --- a/nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-services/pom.xml +++ b/nifi-nar-bundles/nifi-accumulo-bundle/nifi-accumulo-services/pom.xml @@ -33,7 +33,6 @@ org.apache.commons commons-lang3 - 3.9 org.apache.nifi diff --git a/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/pom.xml b/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/pom.xml index a835bf1862..93ecd9975b 100644 --- a/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/pom.xml +++ b/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/pom.xml @@ -45,7 +45,6 @@ language governing permissions and limitations under the License. --> org.apache.commons commons-lang3 - 3.12.0 org.apache.nifi diff --git a/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/pom.xml b/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/pom.xml index 34df22134b..f0bab5354e 100644 --- a/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/pom.xml +++ b/nifi-nar-bundles/nifi-avro-bundle/nifi-avro-processors/pom.xml @@ -34,7 +34,6 @@ language governing permissions and limitations under the License. --> org.apache.commons commons-lang3 - 3.9 org.apache.avro diff --git a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/pom.xml b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/pom.xml index 7e8be20377..101c492be3 100644 --- a/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/pom.xml +++ b/nifi-nar-bundles/nifi-aws-bundle/nifi-aws-abstract-processors/pom.xml @@ -76,7 +76,6 @@ org.apache.commons commons-lang3 - 3.9 org.apache.nifi diff --git a/nifi-nar-bundles/nifi-azure-bundle/nifi-azure-reporting-task/pom.xml b/nifi-nar-bundles/nifi-azure-bundle/nifi-azure-reporting-task/pom.xml index a6a68b5f0a..4a529f30e7 100644 --- a/nifi-nar-bundles/nifi-azure-bundle/nifi-azure-reporting-task/pom.xml +++ b/nifi-nar-bundles/nifi-azure-bundle/nifi-azure-reporting-task/pom.xml @@ -50,6 +50,10 @@ org.slf4j jcl-over-slf4j + + org.apache.commons + commons-lang3 + org.mockito diff --git a/nifi-nar-bundles/nifi-azure-bundle/pom.xml b/nifi-nar-bundles/nifi-azure-bundle/pom.xml index 2caac11e70..469445c38f 100644 --- a/nifi-nar-bundles/nifi-azure-bundle/pom.xml +++ b/nifi-nar-bundles/nifi-azure-bundle/pom.xml @@ -88,11 +88,6 @@ jackson-datatype-jsr310 ${jackson.version} - - org.apache.commons - commons-lang3 - 3.9 - org.apache.commons commons-text diff --git a/nifi-nar-bundles/nifi-ccda-bundle/nifi-ccda-processors/pom.xml b/nifi-nar-bundles/nifi-ccda-bundle/nifi-ccda-processors/pom.xml index 472e5d2656..ef42299cc1 100644 --- a/nifi-nar-bundles/nifi-ccda-bundle/nifi-ccda-processors/pom.xml +++ b/nifi-nar-bundles/nifi-ccda-bundle/nifi-ccda-processors/pom.xml @@ -38,7 +38,6 @@ org.apache.commons commons-lang3 - 3.12.0 org.apache.commons diff --git a/nifi-nar-bundles/nifi-cdc/nifi-cdc-api/pom.xml b/nifi-nar-bundles/nifi-cdc/nifi-cdc-api/pom.xml index ae74d579b0..b2cd314509 100644 --- a/nifi-nar-bundles/nifi-cdc/nifi-cdc-api/pom.xml +++ b/nifi-nar-bundles/nifi-cdc/nifi-cdc-api/pom.xml @@ -34,7 +34,6 @@ org.apache.commons commons-lang3 - 3.9 com.fasterxml.jackson.core diff --git a/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/pom.xml b/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/pom.xml index f089b5a339..1a4c21da72 100644 --- a/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/pom.xml +++ b/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/pom.xml @@ -48,7 +48,6 @@ org.apache.commons commons-lang3 - 3.9 org.apache.nifi diff --git a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/pom.xml b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/pom.xml index 4a2ff4efaf..0f97fa9ef7 100644 --- a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/pom.xml +++ b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/pom.xml @@ -124,7 +124,6 @@ org.apache.commons commons-lang3 - 3.12.0 org.slf4j diff --git a/nifi-nar-bundles/nifi-enrich-bundle/nifi-enrich-processors/pom.xml b/nifi-nar-bundles/nifi-enrich-bundle/nifi-enrich-processors/pom.xml index 9d01316899..1f5da46cee 100644 --- a/nifi-nar-bundles/nifi-enrich-bundle/nifi-enrich-processors/pom.xml +++ b/nifi-nar-bundles/nifi-enrich-bundle/nifi-enrich-processors/pom.xml @@ -32,7 +32,6 @@ org.apache.commons commons-lang3 - 3.9 org.apache.nifi diff --git a/nifi-nar-bundles/nifi-extension-utils/nifi-database-utils/pom.xml b/nifi-nar-bundles/nifi-extension-utils/nifi-database-utils/pom.xml index 329f0e9efe..b674d4c511 100644 --- a/nifi-nar-bundles/nifi-extension-utils/nifi-database-utils/pom.xml +++ b/nifi-nar-bundles/nifi-extension-utils/nifi-database-utils/pom.xml @@ -53,7 +53,6 @@ org.apache.commons commons-lang3 - 3.9 org.apache.avro diff --git a/nifi-nar-bundles/nifi-extension-utils/nifi-event-listen/pom.xml b/nifi-nar-bundles/nifi-extension-utils/nifi-event-listen/pom.xml index c92f7d3a04..ce42ed0a84 100644 --- a/nifi-nar-bundles/nifi-extension-utils/nifi-event-listen/pom.xml +++ b/nifi-nar-bundles/nifi-extension-utils/nifi-event-listen/pom.xml @@ -50,7 +50,6 @@ org.apache.commons commons-lang3 - 3.12.0 org.apache.nifi diff --git a/nifi-nar-bundles/nifi-extension-utils/nifi-hadoop-utils/pom.xml b/nifi-nar-bundles/nifi-extension-utils/nifi-hadoop-utils/pom.xml index 9e76a7f745..e7443d1886 100644 --- a/nifi-nar-bundles/nifi-extension-utils/nifi-hadoop-utils/pom.xml +++ b/nifi-nar-bundles/nifi-extension-utils/nifi-hadoop-utils/pom.xml @@ -50,7 +50,6 @@ org.apache.commons commons-lang3 - 3.9 org.slf4j diff --git a/nifi-nar-bundles/nifi-extension-utils/nifi-reporting-utils/pom.xml b/nifi-nar-bundles/nifi-extension-utils/nifi-reporting-utils/pom.xml index f8233a65ee..848662ecda 100644 --- a/nifi-nar-bundles/nifi-extension-utils/nifi-reporting-utils/pom.xml +++ b/nifi-nar-bundles/nifi-extension-utils/nifi-reporting-utils/pom.xml @@ -35,11 +35,6 @@ nifi-utils 1.16.0-SNAPSHOT - - org.apache.commons - commons-lang3 - 3.9 - org.glassfish javax.json diff --git a/nifi-nar-bundles/nifi-extension-utils/nifi-reporting-utils/src/main/java/org/apache/nifi/reporting/util/provenance/ProvenanceEventConsumer.java b/nifi-nar-bundles/nifi-extension-utils/nifi-reporting-utils/src/main/java/org/apache/nifi/reporting/util/provenance/ProvenanceEventConsumer.java index 02b37c0728..8adeec4b31 100644 --- a/nifi-nar-bundles/nifi-extension-utils/nifi-reporting-utils/src/main/java/org/apache/nifi/reporting/util/provenance/ProvenanceEventConsumer.java +++ b/nifi-nar-bundles/nifi-extension-utils/nifi-reporting-utils/src/main/java/org/apache/nifi/reporting/util/provenance/ProvenanceEventConsumer.java @@ -16,7 +16,6 @@ */ package org.apache.nifi.reporting.util.provenance; -import org.apache.commons.lang3.StringUtils; import org.apache.nifi.components.AllowableValue; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.components.state.Scope; @@ -92,25 +91,25 @@ public class ProvenanceEventConsumer { } public void setComponentTypeRegex(final String componentTypeRegex) { - if (!StringUtils.isBlank(componentTypeRegex)) { + if (isNotEmpty(componentTypeRegex)) { this.componentTypeRegex = Pattern.compile(componentTypeRegex); } } public void setComponentTypeRegexExclude(final String componentTypeRegex) { - if (!StringUtils.isBlank(componentTypeRegex)) { + if (isNotEmpty(componentTypeRegex)) { this.componentTypeRegexExclude = Pattern.compile(componentTypeRegex); } } public void setComponentNameRegex(final String componentNameRegex) { - if (!StringUtils.isBlank(componentNameRegex)) { + if (isNotEmpty(componentNameRegex)) { this.componentNameRegex = Pattern.compile(componentNameRegex); } } public void setComponentNameRegexExclude(final String componentNameRegexExclude) { - if (!StringUtils.isBlank(componentNameRegexExclude)) { + if (isNotEmpty(componentNameRegexExclude)) { this.componentNameRegexExclude = Pattern.compile(componentNameRegexExclude); } } @@ -255,12 +254,12 @@ public class ProvenanceEventConsumer { } - private boolean isFilteringEnabled() { + protected boolean isFilteringEnabled() { // Collect all non-blank patterns boolean anyPatternPresent = Stream.of(componentTypeRegex, componentTypeRegexExclude, componentNameRegex, componentNameRegexExclude) .filter(Objects::nonNull) .map(Pattern::toString) - .anyMatch(StringUtils::isNotBlank); + .anyMatch(this::isNotEmpty); // Collect all non-empty lists boolean anyListPresent = Stream.of(eventTypes, eventTypesExclude, componentIds, componentIdsExclude) @@ -296,7 +295,7 @@ public class ProvenanceEventConsumer { continue; } final String processGroupId = componentMapHolder.getProcessGroupId(componentId, provenanceEventRecord.getComponentType()); - if (!StringUtils.isEmpty(processGroupId)) { + if (!isEmpty(processGroupId)) { // Check if the process group or any parent process group is specified as a target component ID. if (componentIdsExclude.contains(processGroupId)) { @@ -319,7 +318,7 @@ public class ProvenanceEventConsumer { continue; } final String processGroupId = componentMapHolder.getProcessGroupId(componentId, provenanceEventRecord.getComponentType()); - if (StringUtils.isEmpty(processGroupId)) { + if (isEmpty(processGroupId)) { continue; } if (!componentIds.contains(processGroupId)) { @@ -359,4 +358,11 @@ public class ProvenanceEventConsumer { } } + private boolean isNotEmpty(final String string) { + return !isEmpty(string); + } + + private boolean isEmpty(final String string) { + return string == null || string.isEmpty(); + } } diff --git a/nifi-nar-bundles/nifi-extension-utils/nifi-reporting-utils/src/test/groovy/org/apache/nifi/reporting/util/provenance/ProvenanceEventConsumerTest.groovy b/nifi-nar-bundles/nifi-extension-utils/nifi-reporting-utils/src/test/groovy/org/apache/nifi/reporting/util/provenance/ProvenanceEventConsumerTest.groovy deleted file mode 100644 index 67811db330..0000000000 --- a/nifi-nar-bundles/nifi-extension-utils/nifi-reporting-utils/src/test/groovy/org/apache/nifi/reporting/util/provenance/ProvenanceEventConsumerTest.groovy +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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. - */ -package org.apache.nifi.reporting.util.provenance - - -import org.junit.After -import org.junit.Before -import org.junit.BeforeClass -import org.junit.Test -import org.junit.runner.RunWith -import org.junit.runners.JUnit4 -import org.slf4j.Logger -import org.slf4j.LoggerFactory - -@RunWith(JUnit4.class) -class ProvenanceEventConsumerTest extends GroovyTestCase { - private static final Logger logger = LoggerFactory.getLogger(ProvenanceEventConsumerTest.class) - - @BeforeClass - static void setUpOnce() { - logger.metaClass.methodMissing = { String name, args -> - logger.info("[${name?.toUpperCase()}] ${(args as List).join(" ")}") - } - } - - @Before - void setUp() { - super.setUp() - - } - - @After - void tearDown() { - - } - - @Test - void testIsFilteringEnabled() { - // Arrange - ProvenanceEventConsumer noFilterPopulated = new ProvenanceEventConsumer() - - Map patternFilteredConsumers = [:] - def regexProperties = ["componentTypeRegex", "componentTypeRegexExclude", "componentNameRegex", "componentNameRegexExclude"] - regexProperties.each { String prop -> - ProvenanceEventConsumer consumer = new ProvenanceEventConsumer() - consumer."${prop}" = prop - logger.info("Created regex-filtered PEC with ${prop} set") - patternFilteredConsumers[prop] = consumer - } - - Map listFilteredConsumers = [:] - def listProperties = ["eventTypes", "eventTypesExclude", "componentIds", "componentIdsExclude"] - listProperties.each { String prop -> - ProvenanceEventConsumer consumer = new ProvenanceEventConsumer() - consumer."${prop}" = [prop] - logger.info("Created list-filtered PEC with ${prop} set") - listFilteredConsumers[prop] = consumer - } - - def allFilteredConsumers = patternFilteredConsumers + listFilteredConsumers - logger.info("Created ${allFilteredConsumers.size()} filtered consumers") - - // Act - boolean unfilteredConsumerHasFilteringEnabled = noFilterPopulated.isFilteringEnabled() - logger.info("Unfiltered PEC has filtering enabled: ${unfilteredConsumerHasFilteringEnabled}") - - def filteredResults = allFilteredConsumers.collectEntries { prop, consumer -> - [prop, consumer.isFilteringEnabled()] - } - logger.info("Filtered PEC results: ${filteredResults}") - - // Assert - assert !unfilteredConsumerHasFilteringEnabled - assert filteredResults.every() - } -} diff --git a/nifi-nar-bundles/nifi-extension-utils/nifi-reporting-utils/src/test/java/org/apache/nifi/reporting/util/provenance/ProvenanceEventConsumerTest.java b/nifi-nar-bundles/nifi-extension-utils/nifi-reporting-utils/src/test/java/org/apache/nifi/reporting/util/provenance/ProvenanceEventConsumerTest.java new file mode 100644 index 0000000000..4566a2e650 --- /dev/null +++ b/nifi-nar-bundles/nifi-extension-utils/nifi-reporting-utils/src/test/java/org/apache/nifi/reporting/util/provenance/ProvenanceEventConsumerTest.java @@ -0,0 +1,124 @@ +/* + * 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. + */ +package org.apache.nifi.reporting.util.provenance; + +import org.apache.nifi.provenance.ProvenanceEventType; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class ProvenanceEventConsumerTest { + private static final String EMPTY = ""; + + private ProvenanceEventConsumer consumer; + + @BeforeEach + public void setConsumer() { + consumer = new ProvenanceEventConsumer(); + } + + @Test + public void testDefaultFilteringDisabled() { + assertFalse(consumer.isFilteringEnabled()); + } + + @Test + public void testComponentNameRegexEmptyFilteringDisabled() { + consumer.setComponentNameRegex(EMPTY); + + assertFalse(consumer.isFilteringEnabled()); + } + + @Test + public void testComponentNameRegexExcludeEmptyFilteringDisabled() { + consumer.setComponentNameRegexExclude(EMPTY); + + assertFalse(consumer.isFilteringEnabled()); + } + + @Test + public void testComponentNameRegexFilteringEnabled() { + consumer.setComponentNameRegex(String.class.getSimpleName()); + + assertTrue(consumer.isFilteringEnabled()); + } + + @Test + public void testComponentNameRegexExcludeFilteringEnabled() { + consumer.setComponentNameRegexExclude(String.class.getSimpleName()); + + assertTrue(consumer.isFilteringEnabled()); + } + + @Test + public void testComponentTypeRegexFilteringEnabled() { + consumer.setComponentTypeRegex(String.class.getSimpleName()); + + assertTrue(consumer.isFilteringEnabled()); + } + + @Test + public void testComponentTypeRegexExcludeFilteringEnabled() { + consumer.setComponentTypeRegexExclude(String.class.getSimpleName()); + + assertTrue(consumer.isFilteringEnabled()); + } + + @Test + public void testComponentTypeRegexEmptyFilteringDisabled() { + consumer.setComponentTypeRegex(EMPTY); + + assertFalse(consumer.isFilteringEnabled()); + } + + @Test + public void testComponentTypeRegexExcludeEmptyFilteringDisabled() { + consumer.setComponentTypeRegexExclude(EMPTY); + + assertFalse(consumer.isFilteringEnabled()); + } + + @Test + public void testTargetEventTypeFilteringEnabled() { + consumer.addTargetEventType(ProvenanceEventType.CREATE); + + assertTrue(consumer.isFilteringEnabled()); + } + + @Test + public void testTargetEventTypeExcludeFilteringEnabled() { + consumer.addTargetEventTypeExclude(ProvenanceEventType.CREATE); + + assertTrue(consumer.isFilteringEnabled()); + } + + @Test + public void testTargetComponentIdFilteringEnabled() { + consumer.addTargetComponentId(String.class.getSimpleName()); + + assertTrue(consumer.isFilteringEnabled()); + } + + @Test + public void testTargetComponentIdExcludeFilteringEnabled() { + consumer.addTargetComponentIdExclude(String.class.getSimpleName()); + + assertTrue(consumer.isFilteringEnabled()); + } +} diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-loading-utils/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-loading-utils/pom.xml index 9029630ddb..2c535be539 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-loading-utils/pom.xml +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-nar-loading-utils/pom.xml @@ -53,7 +53,6 @@ org.apache.commons commons-lang3 - 3.9 test diff --git a/nifi-nar-bundles/nifi-framework-bundle/pom.xml b/nifi-nar-bundles/nifi-framework-bundle/pom.xml index 228c9da051..9c67585b25 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/pom.xml +++ b/nifi-nar-bundles/nifi-framework-bundle/pom.xml @@ -284,11 +284,6 @@ jersey-hk2 ${jersey.version} - - org.apache.commons - commons-lang3 - 3.9 - org.quartz-scheduler quartz diff --git a/nifi-nar-bundles/nifi-graph-bundle/nifi-graph-processors/pom.xml b/nifi-nar-bundles/nifi-graph-bundle/nifi-graph-processors/pom.xml index 2ba31e82bc..989640e374 100644 --- a/nifi-nar-bundles/nifi-graph-bundle/nifi-graph-processors/pom.xml +++ b/nifi-nar-bundles/nifi-graph-bundle/nifi-graph-processors/pom.xml @@ -47,7 +47,6 @@ org.apache.commons commons-lang3 - 3.9 com.fasterxml.jackson.core diff --git a/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/pom.xml b/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/pom.xml index 7c31ecd3ea..d8ded2f223 100644 --- a/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/pom.xml +++ b/nifi-nar-bundles/nifi-grpc-bundle/nifi-grpc-processors/pom.xml @@ -43,7 +43,6 @@ language governing permissions and limitations under the License. --> org.apache.commons commons-lang3 - 3.11 commons-io diff --git a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/pom.xml b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/pom.xml index 0611270320..eaf8798823 100644 --- a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/pom.xml +++ b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/pom.xml @@ -121,6 +121,11 @@ commons-lang 2.6 + + org.apache.commons + commons-lang3 + provided + org.apache.nifi nifi-properties diff --git a/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/pom.xml b/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/pom.xml index 87a3860cb3..b1cc0462c4 100644 --- a/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/pom.xml +++ b/nifi-nar-bundles/nifi-hbase-bundle/nifi-hbase-processors/pom.xml @@ -58,7 +58,6 @@ org.apache.commons commons-lang3 - 3.9 com.fasterxml.jackson.core diff --git a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/pom.xml b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/pom.xml index 2126ce4623..c123042875 100644 --- a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/pom.xml +++ b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/pom.xml @@ -158,7 +158,6 @@ org.apache.commons commons-lang3 - 3.2 org.apache.avro diff --git a/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/pom.xml b/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/pom.xml index 005711de17..6f9a1fa825 100644 --- a/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/pom.xml +++ b/nifi-nar-bundles/nifi-hl7-bundle/nifi-hl7-processors/pom.xml @@ -52,7 +52,6 @@ org.apache.commons commons-lang3 - 3.9 org.apache.nifi diff --git a/nifi-nar-bundles/nifi-html-bundle/nifi-html-processors/pom.xml b/nifi-nar-bundles/nifi-html-bundle/nifi-html-processors/pom.xml index af131eea05..ff4c41fb4f 100644 --- a/nifi-nar-bundles/nifi-html-bundle/nifi-html-processors/pom.xml +++ b/nifi-nar-bundles/nifi-html-bundle/nifi-html-processors/pom.xml @@ -34,7 +34,6 @@ org.apache.commons commons-lang3 - 3.9 org.apache.nifi diff --git a/nifi-nar-bundles/nifi-ignite-bundle/nifi-ignite-processors/pom.xml b/nifi-nar-bundles/nifi-ignite-bundle/nifi-ignite-processors/pom.xml index d4f795b0a8..0d29599530 100644 --- a/nifi-nar-bundles/nifi-ignite-bundle/nifi-ignite-processors/pom.xml +++ b/nifi-nar-bundles/nifi-ignite-bundle/nifi-ignite-processors/pom.xml @@ -44,7 +44,6 @@ org.apache.commons commons-lang3 - 3.9 org.apache.ignite diff --git a/nifi-nar-bundles/nifi-influxdb-bundle/nifi-influxdb-processors/pom.xml b/nifi-nar-bundles/nifi-influxdb-bundle/nifi-influxdb-processors/pom.xml index 2c7459c758..adff68c01b 100644 --- a/nifi-nar-bundles/nifi-influxdb-bundle/nifi-influxdb-processors/pom.xml +++ b/nifi-nar-bundles/nifi-influxdb-bundle/nifi-influxdb-processors/pom.xml @@ -34,7 +34,6 @@ org.apache.commons commons-lang3 - 3.9 org.apache.nifi diff --git a/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/pom.xml b/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/pom.xml index 7dd9ec4b20..620ed46938 100644 --- a/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/pom.xml +++ b/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/pom.xml @@ -54,7 +54,6 @@ org.apache.commons commons-lang3 - 3.12.0 commons-io diff --git a/nifi-nar-bundles/nifi-kerberos-iaa-providers-bundle/nifi-kerberos-iaa-providers/pom.xml b/nifi-nar-bundles/nifi-kerberos-iaa-providers-bundle/nifi-kerberos-iaa-providers/pom.xml index 9748d87d63..de4d1cbfd6 100644 --- a/nifi-nar-bundles/nifi-kerberos-iaa-providers-bundle/nifi-kerberos-iaa-providers/pom.xml +++ b/nifi-nar-bundles/nifi-kerberos-iaa-providers-bundle/nifi-kerberos-iaa-providers/pom.xml @@ -61,7 +61,6 @@ org.apache.commons commons-lang3 - 3.12.0 nifi-kerberos-iaa-providers diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/pom.xml b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/pom.xml index c6cc8b90f0..6ff6ef7a82 100644 --- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/pom.xml +++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/pom.xml @@ -52,7 +52,6 @@ org.apache.commons commons-lang3 - 3.12.0 org.apache.nifi diff --git a/nifi-nar-bundles/nifi-mqtt-bundle/nifi-mqtt-processors/pom.xml b/nifi-nar-bundles/nifi-mqtt-bundle/nifi-mqtt-processors/pom.xml index 8f399c5aad..3f3cc5ac55 100644 --- a/nifi-nar-bundles/nifi-mqtt-bundle/nifi-mqtt-processors/pom.xml +++ b/nifi-nar-bundles/nifi-mqtt-bundle/nifi-mqtt-processors/pom.xml @@ -58,7 +58,6 @@ org.apache.commons commons-lang3 - 3.12.0 diff --git a/nifi-nar-bundles/nifi-provenance-repository-bundle/pom.xml b/nifi-nar-bundles/nifi-provenance-repository-bundle/pom.xml index efbfe140a0..421838e431 100644 --- a/nifi-nar-bundles/nifi-provenance-repository-bundle/pom.xml +++ b/nifi-nar-bundles/nifi-provenance-repository-bundle/pom.xml @@ -61,11 +61,6 @@ lucene-backward-codecs ${lucene.version} - - org.apache.commons - commons-lang3 - 3.9 - diff --git a/nifi-nar-bundles/nifi-registry-bundle/nifi-registry-service/pom.xml b/nifi-nar-bundles/nifi-registry-bundle/nifi-registry-service/pom.xml index c9541e72ad..b9f00b6d17 100644 --- a/nifi-nar-bundles/nifi-registry-bundle/nifi-registry-service/pom.xml +++ b/nifi-nar-bundles/nifi-registry-bundle/nifi-registry-service/pom.xml @@ -48,7 +48,6 @@ language governing permissions and limitations under the License. --> org.apache.commons commons-lang3 - 3.9 commons-io diff --git a/nifi-nar-bundles/nifi-rethinkdb-bundle/nifi-rethinkdb-processors/pom.xml b/nifi-nar-bundles/nifi-rethinkdb-bundle/nifi-rethinkdb-processors/pom.xml index aac0080df8..a8986ee4d4 100644 --- a/nifi-nar-bundles/nifi-rethinkdb-bundle/nifi-rethinkdb-processors/pom.xml +++ b/nifi-nar-bundles/nifi-rethinkdb-bundle/nifi-rethinkdb-processors/pom.xml @@ -49,7 +49,6 @@ org.apache.commons commons-lang3 - 3.9 com.google.code.gson diff --git a/nifi-nar-bundles/nifi-riemann-bundle/nifi-riemann-processors/pom.xml b/nifi-nar-bundles/nifi-riemann-bundle/nifi-riemann-processors/pom.xml index 894f7fc2d2..f34a4ea7d8 100644 --- a/nifi-nar-bundles/nifi-riemann-bundle/nifi-riemann-processors/pom.xml +++ b/nifi-nar-bundles/nifi-riemann-bundle/nifi-riemann-processors/pom.xml @@ -44,7 +44,6 @@ org.apache.commons commons-lang3 - 3.9 org.apache.nifi diff --git a/nifi-nar-bundles/nifi-rules-action-handler-bundle/nifi-rules-action-handler-service/pom.xml b/nifi-nar-bundles/nifi-rules-action-handler-bundle/nifi-rules-action-handler-service/pom.xml index 1e024c916b..ea1c9a63a2 100644 --- a/nifi-nar-bundles/nifi-rules-action-handler-bundle/nifi-rules-action-handler-service/pom.xml +++ b/nifi-nar-bundles/nifi-rules-action-handler-bundle/nifi-rules-action-handler-service/pom.xml @@ -51,7 +51,6 @@ org.apache.commons commons-lang3 - 3.9 org.apache.nifi diff --git a/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/pom.xml b/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/pom.xml index 2a8c3f9297..53f9eb883f 100644 --- a/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/pom.xml +++ b/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/pom.xml @@ -99,7 +99,6 @@ org.apache.commons commons-lang3 - 3.9 commons-io diff --git a/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-processors/pom.xml b/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-processors/pom.xml index 339833e385..a0dbb2d723 100644 --- a/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-processors/pom.xml +++ b/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-processors/pom.xml @@ -57,7 +57,6 @@ org.apache.commons commons-lang3 - 3.12.0 com.fasterxml.jackson.core diff --git a/nifi-nar-bundles/nifi-spring-bundle/nifi-spring-processors/pom.xml b/nifi-nar-bundles/nifi-spring-bundle/nifi-spring-processors/pom.xml index 20f9d03a04..18e8505e41 100644 --- a/nifi-nar-bundles/nifi-spring-bundle/nifi-spring-processors/pom.xml +++ b/nifi-nar-bundles/nifi-spring-bundle/nifi-spring-processors/pom.xml @@ -34,7 +34,6 @@ org.apache.commons commons-lang3 - 3.9 commons-io diff --git a/nifi-nar-bundles/nifi-standard-bundle/pom.xml b/nifi-nar-bundles/nifi-standard-bundle/pom.xml index a9f716e588..9bc6865292 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/pom.xml +++ b/nifi-nar-bundles/nifi-standard-bundle/pom.xml @@ -174,11 +174,6 @@ commons-compress 1.21 - - org.apache.commons - commons-lang3 - 3.9 - commons-codec commons-codec diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/pom.xml index e70b0ff886..e4f82c739e 100644 --- a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/pom.xml +++ b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_1_1_2-client-service-bundle/nifi-hbase_1_1_2-client-service/pom.xml @@ -108,7 +108,6 @@ org.apache.commons commons-lang3 - 3.9 org.slf4j diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_2-client-service-bundle/nifi-hbase_2-client-service/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_2-client-service-bundle/nifi-hbase_2-client-service/pom.xml index c764d0813d..fb81002417 100644 --- a/nifi-nar-bundles/nifi-standard-services/nifi-hbase_2-client-service-bundle/nifi-hbase_2-client-service/pom.xml +++ b/nifi-nar-bundles/nifi-standard-services/nifi-hbase_2-client-service-bundle/nifi-hbase_2-client-service/pom.xml @@ -105,7 +105,6 @@ org.apache.commons commons-lang3 - 3.9 org.slf4j diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-oauth2-provider-bundle/nifi-oauth2-provider-service/pom.xml b/nifi-nar-bundles/nifi-standard-services/nifi-oauth2-provider-bundle/nifi-oauth2-provider-service/pom.xml index e31d70766f..8f49533b53 100644 --- a/nifi-nar-bundles/nifi-standard-services/nifi-oauth2-provider-bundle/nifi-oauth2-provider-service/pom.xml +++ b/nifi-nar-bundles/nifi-standard-services/nifi-oauth2-provider-bundle/nifi-oauth2-provider-service/pom.xml @@ -58,7 +58,6 @@ org.apache.commons commons-lang3 - 3.9 org.slf4j diff --git a/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-processor/pom.xml b/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-processor/pom.xml index a580899940..7d94e4a5dc 100644 --- a/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-processor/pom.xml +++ b/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-processor/pom.xml @@ -35,7 +35,6 @@ org.apache.commons commons-lang3 - 3.9 com.github.ben-manes.caffeine diff --git a/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/pom.xml b/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/pom.xml index a96cf7df84..ab92e95d0c 100644 --- a/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/pom.xml +++ b/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-ui/pom.xml @@ -144,7 +144,6 @@ org.apache.commons commons-lang3 - 3.9 diff --git a/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-processors/src/main/java/org/apache/nifi/processors/websocket/AbstractWebSocketGatewayProcessor.java b/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-processors/src/main/java/org/apache/nifi/processors/websocket/AbstractWebSocketGatewayProcessor.java index d3ee282875..33129bfbc0 100644 --- a/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-processors/src/main/java/org/apache/nifi/processors/websocket/AbstractWebSocketGatewayProcessor.java +++ b/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-processors/src/main/java/org/apache/nifi/processors/websocket/AbstractWebSocketGatewayProcessor.java @@ -17,7 +17,7 @@ package org.apache.nifi.processors.websocket; -import org.apache.commons.lang3.StringUtils; +import org.apache.nifi.util.StringUtils; import org.apache.nifi.annotation.behavior.TriggerSerially; import org.apache.nifi.annotation.lifecycle.OnStopped; import org.apache.nifi.flowfile.FlowFile; diff --git a/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-processors/src/main/java/org/apache/nifi/processors/websocket/PutWebSocket.java b/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-processors/src/main/java/org/apache/nifi/processors/websocket/PutWebSocket.java index 0cb698dd88..e910ae3187 100644 --- a/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-processors/src/main/java/org/apache/nifi/processors/websocket/PutWebSocket.java +++ b/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-processors/src/main/java/org/apache/nifi/processors/websocket/PutWebSocket.java @@ -37,7 +37,7 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.atomic.AtomicReference; -import org.apache.commons.lang3.StringUtils; +import org.apache.nifi.util.StringUtils; import org.apache.nifi.annotation.behavior.SystemResourceConsideration; import org.apache.nifi.annotation.behavior.InputRequirement; import org.apache.nifi.annotation.behavior.SystemResource; diff --git a/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-api/pom.xml b/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-api/pom.xml index b0233f8981..6d4a23daa2 100644 --- a/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-api/pom.xml +++ b/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-api/pom.xml @@ -22,11 +22,6 @@ org.apache.nifi nifi-ssl-context-service-api - - org.apache.commons - commons-lang3 - 3.12.0 - org.apache.nifi nifi-mock diff --git a/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-api/src/main/java/org/apache/nifi/websocket/WebSocketMessageRouter.java b/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-api/src/main/java/org/apache/nifi/websocket/WebSocketMessageRouter.java index 0e8737a8f6..d917a7492c 100644 --- a/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-api/src/main/java/org/apache/nifi/websocket/WebSocketMessageRouter.java +++ b/nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-api/src/main/java/org/apache/nifi/websocket/WebSocketMessageRouter.java @@ -20,7 +20,6 @@ import java.io.IOException; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.apache.commons.lang3.StringUtils; import org.apache.nifi.processor.Processor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -102,10 +101,7 @@ public class WebSocketMessageRouter { } public void sendMessage(final String sessionId, final SendMessage sendMessage) throws IOException { - if (!StringUtils.isEmpty(sessionId)) { - final WebSocketSession session = getSessionOrFail(sessionId); - sendMessage.send(session); - } else { + if (sessionId == null || sessionId.isEmpty()) { //The sessionID is not specified so broadcast the message to all connected client sessions. sessions.keySet().forEach(itrSessionId -> { try { @@ -115,6 +111,9 @@ public class WebSocketMessageRouter { logger.warn("Failed to send message to session {} due to {}", itrSessionId, e, e); } }); + } else { + final WebSocketSession session = getSessionOrFail(sessionId); + sendMessage.send(session); } } diff --git a/nifi-registry/pom.xml b/nifi-registry/pom.xml index ee34b8e322..e3e01e7c00 100644 --- a/nifi-registry/pom.xml +++ b/nifi-registry/pom.xml @@ -96,12 +96,6 @@ apache-jstl compile - - - org.apache.commons - commons-lang3 - 3.5 - jakarta.xml.bind diff --git a/nifi-toolkit/nifi-toolkit-flowfile-repo/pom.xml b/nifi-toolkit/nifi-toolkit-flowfile-repo/pom.xml index 817b9e63ae..880905e6c5 100644 --- a/nifi-toolkit/nifi-toolkit-flowfile-repo/pom.xml +++ b/nifi-toolkit/nifi-toolkit-flowfile-repo/pom.xml @@ -26,7 +26,6 @@ org.apache.commons commons-lang3 - 3.9 test diff --git a/pom.xml b/pom.xml index bf4eb3aedc..5758d54810 100644 --- a/pom.xml +++ b/pom.xml @@ -98,6 +98,7 @@ UTF-8 2014 4.9.3 + 3.12.0 4.5.13 4.4.15 1.70 @@ -264,6 +265,11 @@ bcpg-jdk15on ${org.bouncycastle.version} + + org.apache.commons + commons-lang3 + ${org.apache.commons.lang3.version} + org.apache.httpcomponents httpclient