mirror of https://github.com/apache/nifi.git
NIFI-9692 Upgraded Apache Commons Lang3 to 3.12.0
- Moved commons-lang3 version management to root Maven configuration - Refactored limited usage of StringUtils is nifi-reporting-utils to remove commons-lang3 - Refactored limited usage of StringUtils in nifi-websocket-processors to remove commons-lang3 Signed-off-by: Matthew Burgess <mattyb149@apache.org> This closes #5773
This commit is contained in:
parent
6788076536
commit
fe1139b8bb
|
@ -486,11 +486,6 @@ limitations under the License.
|
|||
<artifactId>commons-compress</artifactId>
|
||||
<version>1.21</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr-runtime</artifactId>
|
||||
|
|
|
@ -101,7 +101,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.11</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.cloud</groupId>
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.11</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
|
|
|
@ -54,7 +54,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.10</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish.jersey.core</groupId>
|
||||
|
|
|
@ -48,7 +48,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
|
|
|
@ -45,7 +45,6 @@ language governing permissions and limitations under the License. -->
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
|
|
|
@ -34,7 +34,6 @@ language governing permissions and limitations under the License. -->
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.avro</groupId>
|
||||
|
|
|
@ -76,7 +76,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
|
|
|
@ -50,6 +50,10 @@
|
|||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jcl-over-slf4j</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<!-- test dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
|
|
|
@ -88,11 +88,6 @@
|
|||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-text</artifactId>
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
|
|
|
@ -48,7 +48,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
|
|
|
@ -124,7 +124,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.avro</groupId>
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
|
|
|
@ -35,11 +35,6 @@
|
|||
<artifactId>nifi-utils</artifactId>
|
||||
<version>1.16.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.glassfish</groupId>
|
||||
<artifactId>javax.json</artifactId>
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<String, ProvenanceEventConsumer> 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<String, ProvenanceEventConsumer> 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()
|
||||
}
|
||||
}
|
|
@ -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());
|
||||
}
|
||||
}
|
|
@ -53,7 +53,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
|
@ -284,11 +284,6 @@
|
|||
<artifactId>jersey-hk2</artifactId>
|
||||
<version>${jersey.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
<artifactId>quartz</artifactId>
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
|
|
|
@ -43,7 +43,6 @@ language governing permissions and limitations under the License. -->
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.11</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
|
|
|
@ -121,6 +121,11 @@
|
|||
<artifactId>commons-lang</artifactId>
|
||||
<version>2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
<artifactId>nifi-properties</artifactId>
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
|
|
|
@ -158,7 +158,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.avro</groupId>
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.ignite</groupId>
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
|
|
|
@ -54,7 +54,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
|
|
|
@ -61,7 +61,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<name>nifi-kerberos-iaa-providers</name>
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Test dependencies -->
|
||||
|
|
|
@ -61,11 +61,6 @@
|
|||
<artifactId>lucene-backward-codecs</artifactId>
|
||||
<version>${lucene.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
</project>
|
||||
|
|
|
@ -48,7 +48,6 @@ language governing permissions and limitations under the License. -->
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
|
|
|
@ -99,7 +99,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
|
|
|
@ -57,7 +57,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
|
|
|
@ -174,11 +174,6 @@
|
|||
<artifactId>commons-compress</artifactId>
|
||||
<version>1.21</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
|
|
|
@ -108,7 +108,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
|
|
|
@ -105,7 +105,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
|
|
|
@ -58,7 +58,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.ben-manes.caffeine</groupId>
|
||||
|
|
|
@ -144,7 +144,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -22,11 +22,6 @@
|
|||
<groupId>org.apache.nifi</groupId>
|
||||
<artifactId>nifi-ssl-context-service-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
<artifactId>nifi-mock</artifactId>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -96,12 +96,6 @@
|
|||
<artifactId>apache-jstl</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- lib/shared -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.5</version>
|
||||
</dependency>
|
||||
<!-- lib/java11 -->
|
||||
<dependency>
|
||||
<groupId>jakarta.xml.bind</groupId>
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.9</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
|
6
pom.xml
6
pom.xml
|
@ -98,6 +98,7 @@
|
|||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<inceptionYear>2014</inceptionYear>
|
||||
<okhttp.version>4.9.3</okhttp.version>
|
||||
<org.apache.commons.lang3.version>3.12.0</org.apache.commons.lang3.version>
|
||||
<org.apache.httpcomponents.httpclient.version>4.5.13</org.apache.httpcomponents.httpclient.version>
|
||||
<org.apache.httpcomponents.httpcore.version>4.4.15</org.apache.httpcomponents.httpcore.version>
|
||||
<org.bouncycastle.version>1.70</org.bouncycastle.version>
|
||||
|
@ -264,6 +265,11 @@
|
|||
<artifactId>bcpg-jdk15on</artifactId>
|
||||
<version>${org.bouncycastle.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>${org.apache.commons.lang3.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
|
|
Loading…
Reference in New Issue