diff --git a/nifi-api/src/main/java/org/apache/nifi/logging/ProcessorLog.java b/nifi-api/src/main/java/org/apache/nifi/logging/ProcessorLog.java deleted file mode 100644 index a90ee26cc9..0000000000 --- a/nifi-api/src/main/java/org/apache/nifi/logging/ProcessorLog.java +++ /dev/null @@ -1,30 +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.logging; - -/** - * The ProcessorLog is an extension of ComponentLog but provides no additional - * functionality. It exists because ProcessorLog was created first, but when - * Controller Services and Reporting Tasks began to be used more heavily loggers - * were needed for them as well. We did not want to return a ProcessorLog to a - * ControllerService or a ReportingTask, so all of the methods were moved to a - * higher interface named ComponentLog. However, we kept the ProcessorLog - * interface around in order to maintain backward compatibility. - */ -public interface ProcessorLog extends ComponentLog { - -} diff --git a/nifi-api/src/main/java/org/apache/nifi/processor/AbstractSessionFactoryProcessor.java b/nifi-api/src/main/java/org/apache/nifi/processor/AbstractSessionFactoryProcessor.java index cb9b188626..e257e472fc 100644 --- a/nifi-api/src/main/java/org/apache/nifi/processor/AbstractSessionFactoryProcessor.java +++ b/nifi-api/src/main/java/org/apache/nifi/processor/AbstractSessionFactoryProcessor.java @@ -24,7 +24,7 @@ import org.apache.nifi.annotation.lifecycle.OnScheduled; import org.apache.nifi.annotation.lifecycle.OnUnscheduled; import org.apache.nifi.components.AbstractConfigurableComponent; import org.apache.nifi.controller.ControllerServiceLookup; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; /** *

@@ -46,7 +46,7 @@ import org.apache.nifi.logging.ProcessorLog; public abstract class AbstractSessionFactoryProcessor extends AbstractConfigurableComponent implements Processor { private String identifier; - private ProcessorLog logger; + private ComponentLog logger; private volatile boolean scheduled = false; private volatile boolean configurationRestored = false; private ControllerServiceLookup serviceLookup; @@ -75,7 +75,7 @@ public abstract class AbstractSessionFactoryProcessor extends AbstractConfigurab return Collections.emptySet(); } - protected final ProcessorLog getLogger() { + protected final ComponentLog getLogger() { return logger; } diff --git a/nifi-api/src/main/java/org/apache/nifi/processor/ProcessorInitializationContext.java b/nifi-api/src/main/java/org/apache/nifi/processor/ProcessorInitializationContext.java index 779633ccea..8a04887ddc 100644 --- a/nifi-api/src/main/java/org/apache/nifi/processor/ProcessorInitializationContext.java +++ b/nifi-api/src/main/java/org/apache/nifi/processor/ProcessorInitializationContext.java @@ -17,7 +17,7 @@ package org.apache.nifi.processor; import org.apache.nifi.controller.ControllerServiceLookup; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; /** *

@@ -34,10 +34,10 @@ public interface ProcessorInitializationContext { String getIdentifier(); /** - * @return a {@link ProcessorLog} that is tied to this processor that can be + * @return a {@link ComponentLog} that is tied to this processor that can be * used to log events */ - ProcessorLog getLogger(); + ComponentLog getLogger(); /** * @return the {@link ControllerServiceLookup} which can be used to obtain diff --git a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/bin/BinFiles.java b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/bin/BinFiles.java index 46891a4238..a93550dd68 100644 --- a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/bin/BinFiles.java +++ b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/bin/BinFiles.java @@ -30,7 +30,7 @@ import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.components.ValidationContext; import org.apache.nifi.components.ValidationResult; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractSessionFactoryProcessor; import org.apache.nifi.processor.DataUnit; import org.apache.nifi.processor.ProcessContext; @@ -223,7 +223,7 @@ public abstract class BinFiles extends AbstractSessionFactoryProcessor { final List bins = new ArrayList<>(); bins.add(bin); - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final ProcessSession session = sessionFactory.createSession(); final List binCopy = new ArrayList<>(bin.getContents()); diff --git a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/dispatcher/DatagramChannelDispatcher.java b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/dispatcher/DatagramChannelDispatcher.java index 3fb9ba959f..69a19982ee 100644 --- a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/dispatcher/DatagramChannelDispatcher.java +++ b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/dispatcher/DatagramChannelDispatcher.java @@ -17,7 +17,7 @@ package org.apache.nifi.processor.util.listen.dispatcher; import org.apache.commons.io.IOUtils; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.util.listen.event.Event; import org.apache.nifi.processor.util.listen.event.EventFactory; import org.apache.nifi.processor.util.listen.event.EventFactoryUtil; @@ -45,7 +45,7 @@ public class DatagramChannelDispatcher> impleme private final EventFactory eventFactory; private final BlockingQueue bufferPool; private final EventQueue events; - private final ProcessorLog logger; + private final ComponentLog logger; private final String sendingHost; private final Integer sendingPort; @@ -56,14 +56,14 @@ public class DatagramChannelDispatcher> impleme public DatagramChannelDispatcher(final EventFactory eventFactory, final BlockingQueue bufferPool, final BlockingQueue events, - final ProcessorLog logger) { + final ComponentLog logger) { this(eventFactory, bufferPool, events, logger, null, null); } public DatagramChannelDispatcher(final EventFactory eventFactory, final BlockingQueue bufferPool, final BlockingQueue events, - final ProcessorLog logger, + final ComponentLog logger, final String sendingHost, final Integer sendingPort) { this.eventFactory = eventFactory; diff --git a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/dispatcher/SocketChannelDispatcher.java b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/dispatcher/SocketChannelDispatcher.java index 70b2bae0f3..b07fbb9bed 100644 --- a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/dispatcher/SocketChannelDispatcher.java +++ b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/dispatcher/SocketChannelDispatcher.java @@ -17,7 +17,7 @@ package org.apache.nifi.processor.util.listen.dispatcher; import org.apache.commons.io.IOUtils; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.util.listen.event.Event; import org.apache.nifi.processor.util.listen.event.EventFactory; import org.apache.nifi.processor.util.listen.handler.ChannelHandlerFactory; @@ -55,7 +55,7 @@ public class SocketChannelDispatcher> implements private final ChannelHandlerFactory handlerFactory; private final BlockingQueue bufferPool; private final BlockingQueue events; - private final ProcessorLog logger; + private final ComponentLog logger; private final int maxConnections; private final SSLContext sslContext; private final SslContextFactory.ClientAuth clientAuth; @@ -71,7 +71,7 @@ public class SocketChannelDispatcher> implements final ChannelHandlerFactory handlerFactory, final BlockingQueue bufferPool, final BlockingQueue events, - final ProcessorLog logger, + final ComponentLog logger, final int maxConnections, final SSLContext sslContext, final Charset charset) { @@ -82,7 +82,7 @@ public class SocketChannelDispatcher> implements final ChannelHandlerFactory handlerFactory, final BlockingQueue bufferPool, final BlockingQueue events, - final ProcessorLog logger, + final ComponentLog logger, final int maxConnections, final SSLContext sslContext, final SslContextFactory.ClientAuth clientAuth, diff --git a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/event/EventQueue.java b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/event/EventQueue.java index 4afaf40e8a..35e9ae0a12 100644 --- a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/event/EventQueue.java +++ b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/event/EventQueue.java @@ -17,8 +17,7 @@ package org.apache.nifi.processor.util.listen.event; import org.apache.commons.lang3.Validate; -import org.apache.nifi.logging.ProcessorLog; - +import org.apache.nifi.logging.ComponentLog; import java.util.concurrent.BlockingQueue; import java.util.concurrent.TimeUnit; @@ -36,13 +35,13 @@ public class EventQueue { private final long offerWaitMs; private final BlockingQueue events; - private final ProcessorLog logger; + private final ComponentLog logger; - public EventQueue(final BlockingQueue events, final ProcessorLog logger) { + public EventQueue(final BlockingQueue events, final ComponentLog logger) { this(events, DEFAULT_OFFER_WAIT_MS, logger); } - public EventQueue(final BlockingQueue events, final long offerWaitMs, final ProcessorLog logger) { + public EventQueue(final BlockingQueue events, final long offerWaitMs, final ComponentLog logger) { this.events = events; this.offerWaitMs = offerWaitMs; this.logger = logger; diff --git a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/ChannelHandler.java b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/ChannelHandler.java index 6307c7635a..84ef062f4f 100644 --- a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/ChannelHandler.java +++ b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/ChannelHandler.java @@ -16,7 +16,7 @@ */ package org.apache.nifi.processor.util.listen.handler; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.util.listen.dispatcher.ChannelDispatcher; import org.apache.nifi.processor.util.listen.event.Event; import org.apache.nifi.processor.util.listen.event.EventFactory; @@ -36,15 +36,14 @@ public abstract class ChannelHandler eventFactory; protected final EventQueue events; - protected final ProcessorLog logger; - + protected final ComponentLog logger; public ChannelHandler(final SelectionKey key, final D dispatcher, final Charset charset, final EventFactory eventFactory, final BlockingQueue events, - final ProcessorLog logger) { + final ComponentLog logger) { this.key = key; this.dispatcher = dispatcher; this.charset = charset; diff --git a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/ChannelHandlerFactory.java b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/ChannelHandlerFactory.java index d7916fdf64..9ca6bdd84f 100644 --- a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/ChannelHandlerFactory.java +++ b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/ChannelHandlerFactory.java @@ -16,7 +16,7 @@ */ package org.apache.nifi.processor.util.listen.handler; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.util.listen.dispatcher.ChannelDispatcher; import org.apache.nifi.processor.util.listen.event.Event; import org.apache.nifi.processor.util.listen.event.EventFactory; @@ -35,12 +35,12 @@ public interface ChannelHandlerFactory eventFactory, final BlockingQueue events, - final ProcessorLog logger); + final ComponentLog logger); ChannelHandler createSSLHandler(final SelectionKey key, final D dispatcher, final Charset charset, final EventFactory eventFactory, final BlockingQueue events, - final ProcessorLog logger); + final ComponentLog logger); } diff --git a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/socket/SSLSocketChannelHandler.java b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/socket/SSLSocketChannelHandler.java index d11cb02a90..951dc4b704 100644 --- a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/socket/SSLSocketChannelHandler.java +++ b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/socket/SSLSocketChannelHandler.java @@ -17,7 +17,7 @@ package org.apache.nifi.processor.util.listen.handler.socket; import org.apache.commons.io.IOUtils; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.util.listen.dispatcher.AsyncChannelDispatcher; import org.apache.nifi.processor.util.listen.dispatcher.SocketChannelAttachment; import org.apache.nifi.processor.util.listen.event.Event; @@ -51,7 +51,7 @@ public class SSLSocketChannelHandler> extends Soc final Charset charset, final EventFactory eventFactory, final BlockingQueue events, - final ProcessorLog logger) { + final ComponentLog logger) { super(key, dispatcher, charset, eventFactory, events, logger); } diff --git a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/socket/SocketChannelHandler.java b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/socket/SocketChannelHandler.java index d20aaa6d54..07b5dcce6b 100644 --- a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/socket/SocketChannelHandler.java +++ b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/socket/SocketChannelHandler.java @@ -16,7 +16,7 @@ */ package org.apache.nifi.processor.util.listen.handler.socket; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.util.listen.dispatcher.AsyncChannelDispatcher; import org.apache.nifi.processor.util.listen.event.Event; import org.apache.nifi.processor.util.listen.event.EventFactory; @@ -39,7 +39,7 @@ public abstract class SocketChannelHandler> exten final Charset charset, final EventFactory eventFactory, final BlockingQueue events, - final ProcessorLog logger) { + final ComponentLog logger) { super(key, dispatcher, charset, eventFactory, events, logger); } diff --git a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/socket/SocketChannelHandlerFactory.java b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/socket/SocketChannelHandlerFactory.java index cb189ba40e..9003f905fe 100644 --- a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/socket/SocketChannelHandlerFactory.java +++ b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/socket/SocketChannelHandlerFactory.java @@ -16,7 +16,7 @@ */ package org.apache.nifi.processor.util.listen.handler.socket; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.util.listen.dispatcher.AsyncChannelDispatcher; import org.apache.nifi.processor.util.listen.event.Event; import org.apache.nifi.processor.util.listen.event.EventFactory; @@ -39,7 +39,7 @@ public class SocketChannelHandlerFactory> impleme final Charset charset, final EventFactory eventFactory, final BlockingQueue events, - final ProcessorLog logger) { + final ComponentLog logger) { return new StandardSocketChannelHandler<>(key, dispatcher, charset, eventFactory, events, logger); } @@ -49,7 +49,7 @@ public class SocketChannelHandlerFactory> impleme final Charset charset, final EventFactory eventFactory, final BlockingQueue events, - final ProcessorLog logger) { + final ComponentLog logger) { return new SSLSocketChannelHandler<>(key, dispatcher, charset, eventFactory, events, logger); } } diff --git a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/socket/StandardSocketChannelHandler.java b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/socket/StandardSocketChannelHandler.java index 94e41eba05..1aac860de7 100644 --- a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/socket/StandardSocketChannelHandler.java +++ b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/listen/handler/socket/StandardSocketChannelHandler.java @@ -17,7 +17,7 @@ package org.apache.nifi.processor.util.listen.handler.socket; import org.apache.commons.io.IOUtils; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.util.listen.dispatcher.AsyncChannelDispatcher; import org.apache.nifi.processor.util.listen.dispatcher.SocketChannelAttachment; import org.apache.nifi.processor.util.listen.event.Event; @@ -50,7 +50,7 @@ public class StandardSocketChannelHandler> extend final Charset charset, final EventFactory eventFactory, final BlockingQueue events, - final ProcessorLog logger) { + final ComponentLog logger) { super(key, dispatcher, charset, eventFactory, events, logger); } diff --git a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/put/sender/ChannelSender.java b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/put/sender/ChannelSender.java index 8c92b1f6bf..d2daeb941d 100644 --- a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/put/sender/ChannelSender.java +++ b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/put/sender/ChannelSender.java @@ -16,8 +16,7 @@ */ package org.apache.nifi.processor.util.put.sender; -import org.apache.nifi.logging.ProcessorLog; - +import org.apache.nifi.logging.ComponentLog; import java.io.IOException; import java.nio.charset.Charset; @@ -29,12 +28,12 @@ public abstract class ChannelSender { protected final int port; protected final String host; protected final int maxSendBufferSize; - protected final ProcessorLog logger; + protected final ComponentLog logger; protected volatile int timeout = 10000; protected volatile long lastUsed; - public ChannelSender(final String host, final int port, final int maxSendBufferSize, final ProcessorLog logger) { + public ChannelSender(final String host, final int port, final int maxSendBufferSize, final ComponentLog logger) { this.port = port; this.host = host; this.maxSendBufferSize = maxSendBufferSize; diff --git a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/put/sender/DatagramChannelSender.java b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/put/sender/DatagramChannelSender.java index 632c6e5f59..0b2dfb83e9 100644 --- a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/put/sender/DatagramChannelSender.java +++ b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/put/sender/DatagramChannelSender.java @@ -17,8 +17,7 @@ package org.apache.nifi.processor.util.put.sender; import org.apache.commons.io.IOUtils; -import org.apache.nifi.logging.ProcessorLog; - +import org.apache.nifi.logging.ComponentLog; import java.io.IOException; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -33,7 +32,7 @@ public class DatagramChannelSender extends ChannelSender { private DatagramChannel channel; - public DatagramChannelSender(final String host, final int port, final int maxSendBufferSize, final ProcessorLog logger) { + public DatagramChannelSender(final String host, final int port, final int maxSendBufferSize, final ComponentLog logger) { super(host, port, maxSendBufferSize, logger); } diff --git a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/put/sender/SSLSocketChannelSender.java b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/put/sender/SSLSocketChannelSender.java index dc85d804c6..a70c9c5e97 100644 --- a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/put/sender/SSLSocketChannelSender.java +++ b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/put/sender/SSLSocketChannelSender.java @@ -17,7 +17,7 @@ package org.apache.nifi.processor.util.put.sender; import org.apache.commons.io.IOUtils; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.remote.io.socket.ssl.SSLSocketChannel; import javax.net.ssl.SSLContext; @@ -35,7 +35,7 @@ public class SSLSocketChannelSender extends SocketChannelSender { final int port, final int maxSendBufferSize, final SSLContext sslContext, - final ProcessorLog logger) { + final ComponentLog logger) { super(host, port, maxSendBufferSize, logger); this.sslContext = sslContext; } diff --git a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/put/sender/SocketChannelSender.java b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/put/sender/SocketChannelSender.java index fcf341abe0..9755af7be1 100644 --- a/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/put/sender/SocketChannelSender.java +++ b/nifi-commons/nifi-processor-utilities/src/main/java/org/apache/nifi/processor/util/put/sender/SocketChannelSender.java @@ -16,7 +16,7 @@ */package org.apache.nifi.processor.util.put.sender; import org.apache.commons.io.IOUtils; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.remote.io.socket.SocketChannelOutputStream; import java.io.IOException; @@ -34,7 +34,7 @@ public class SocketChannelSender extends ChannelSender { protected SocketChannel channel; protected SocketChannelOutputStream socketChannelOutput; - public SocketChannelSender(final String host, final int port, final int maxSendBufferSize, final ProcessorLog logger) { + public SocketChannelSender(final String host, final int port, final int maxSendBufferSize, final ComponentLog logger) { super(host, port, maxSendBufferSize, logger); } diff --git a/nifi-docs/src/main/asciidoc/developer-guide.adoc b/nifi-docs/src/main/asciidoc/developer-guide.adoc index bcdd6cda63..d7efde49c2 100644 --- a/nifi-docs/src/main/asciidoc/developer-guide.adoc +++ b/nifi-docs/src/main/asciidoc/developer-guide.adoc @@ -232,13 +232,13 @@ This object exposes configuration to the Processor that will not change throughout the life of the Processor, such as the unique identifier of the Processor. -[[ProcessorLog]] -==== ProcessorLog +[[ComponentLog]] +==== ComponentLog Processors are encouraged to perform their logging via the -`ProcessorLog` interface, rather than obtaining +`ComponentLog` interface, rather than obtaining a direct instance of a third-party logger. This is because logging via -the ProcessorLog allows the framework -to render log messages that exceed s a configurable severity level to +the ComponentLog allows the framework +to render log messages that exceeds a configurable severity level to the User Interface, allowing those who monitor the dataflow to be notified when important events occur. Additionally, it provides a consistent logging @@ -267,7 +267,7 @@ When a Processor is created, before any other methods are invoked, the AbstractProcessor will be invoked. The method takes a single argument, which is of type `ProcessorInitializationContext`. The context object supplies the -Processor with a ProcessorLog, +Processor with a ComponentLog, the Processor's unique identifier, and a ControllerServiceLookup that can be used to interact with the configured ControllerServices. Each of these objects is stored by the @@ -632,7 +632,7 @@ The `MockStateManager` also provides the ability to indicate that the unit test Processors are responsible for reporting their activity so that users are able to understand what happens -to their data. Processors should log events via the ProcessorLog, +to their data. Processors should log events via the ComponentLog, which is accessible via the InitializationContext or by calling the `getLogger` method of `AbstractProcessor`. diff --git a/nifi-mock/src/main/java/org/apache/nifi/util/MockProcessorLog.java b/nifi-mock/src/main/java/org/apache/nifi/util/MockComponentLog.java similarity index 98% rename from nifi-mock/src/main/java/org/apache/nifi/util/MockProcessorLog.java rename to nifi-mock/src/main/java/org/apache/nifi/util/MockComponentLog.java index cb87e507f7..0ed7e761d2 100644 --- a/nifi-mock/src/main/java/org/apache/nifi/util/MockProcessorLog.java +++ b/nifi-mock/src/main/java/org/apache/nifi/util/MockComponentLog.java @@ -18,17 +18,17 @@ package org.apache.nifi.util; import java.util.List; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.logging.LogLevel; -import org.apache.nifi.logging.ProcessorLog; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class MockProcessorLog implements ProcessorLog { +public class MockComponentLog implements ComponentLog { private final CapturingLogger logger; private final Object component; - public MockProcessorLog(final String componentId, final Object component) { + public MockComponentLog(final String componentId, final Object component) { this.logger = new CapturingLogger(LoggerFactory.getLogger(component.getClass())); this.component = component; } diff --git a/nifi-mock/src/main/java/org/apache/nifi/util/MockControllerServiceInitializationContext.java b/nifi-mock/src/main/java/org/apache/nifi/util/MockControllerServiceInitializationContext.java index 754bec0baa..f8f4f5995d 100644 --- a/nifi-mock/src/main/java/org/apache/nifi/util/MockControllerServiceInitializationContext.java +++ b/nifi-mock/src/main/java/org/apache/nifi/util/MockControllerServiceInitializationContext.java @@ -34,7 +34,7 @@ public class MockControllerServiceInitializationContext extends MockControllerSe } public MockControllerServiceInitializationContext(final ControllerService controllerService, final String identifier, final StateManager stateManager) { - this(controllerService, identifier, new MockProcessorLog(identifier, controllerService), stateManager); + this(controllerService, identifier, new MockComponentLog(identifier, controllerService), stateManager); } public MockControllerServiceInitializationContext(final ControllerService controllerService, final String identifier, final ComponentLog logger, final StateManager stateManager) { diff --git a/nifi-mock/src/main/java/org/apache/nifi/util/MockProcessorInitializationContext.java b/nifi-mock/src/main/java/org/apache/nifi/util/MockProcessorInitializationContext.java index 87e2b4589f..f0961efc87 100644 --- a/nifi-mock/src/main/java/org/apache/nifi/util/MockProcessorInitializationContext.java +++ b/nifi-mock/src/main/java/org/apache/nifi/util/MockProcessorInitializationContext.java @@ -26,13 +26,13 @@ import org.apache.nifi.processor.ProcessorInitializationContext; public class MockProcessorInitializationContext implements ProcessorInitializationContext, ControllerServiceLookup { - private final MockProcessorLog logger; + private final MockComponentLog logger; private final String processorId; private final MockProcessContext context; public MockProcessorInitializationContext(final Processor processor, final MockProcessContext context) { processorId = UUID.randomUUID().toString(); - logger = new MockProcessorLog(processorId, processor); + logger = new MockComponentLog(processorId, processor); this.context = context; } @@ -42,7 +42,7 @@ public class MockProcessorInitializationContext implements ProcessorInitializati } @Override - public MockProcessorLog getLogger() { + public MockComponentLog getLogger() { return logger; } diff --git a/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java b/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java index edc0e65c26..9e87d98b80 100644 --- a/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java +++ b/nifi-mock/src/main/java/org/apache/nifi/util/StandardProcessorTestRunner.java @@ -89,8 +89,8 @@ public class StandardProcessorTestRunner implements TestRunner { private static final Set> deprecatedTypeAnnotations = new HashSet<>(); private static final Set> deprecatedMethodAnnotations = new HashSet<>(); - private final Map controllerServiceLoggers = new HashMap<>(); - private final MockProcessorLog logger; + private final Map controllerServiceLoggers = new HashMap<>(); + private final MockComponentLog logger; static { // do this in a separate method, just so that we can add a @SuppressWarnings annotation @@ -640,7 +640,7 @@ public class StandardProcessorTestRunner implements TestRunner { // } // } - final MockProcessorLog logger = new MockProcessorLog(identifier, service); + final MockComponentLog logger = new MockComponentLog(identifier, service); controllerServiceLoggers.put(identifier, logger); final MockStateManager serviceStateManager = new MockStateManager(service); final MockControllerServiceInitializationContext initContext = new MockControllerServiceInitializationContext(requireNonNull(service), requireNonNull(identifier), logger, serviceStateManager); @@ -869,12 +869,12 @@ public class StandardProcessorTestRunner implements TestRunner { } @Override - public MockProcessorLog getLogger() { + public MockComponentLog getLogger() { return logger; } @Override - public MockProcessorLog getControllerServiceLogger(final String identifier) { + public MockComponentLog getControllerServiceLogger(final String identifier) { return controllerServiceLoggers.get(identifier); } diff --git a/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java b/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java index 5832c2e88d..c3bedb1915 100644 --- a/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java +++ b/nifi-mock/src/main/java/org/apache/nifi/util/TestRunner.java @@ -875,18 +875,18 @@ public interface TestRunner { void clearProvenanceEvents(); /** - * Returns the {@link MockProcessorLog} that is used by the Processor under test. + * Returns the {@link MockComponentLog} that is used by the Processor under test. * @return the logger */ - public MockProcessorLog getLogger(); + public MockComponentLog getLogger(); /** - * Returns the {@link MockProcessorLog} that is used by the specified controller service. + * Returns the {@link MockComponentLog} that is used by the specified controller service. * * @param identifier a controller service identifier * @return the logger */ - public MockProcessorLog getControllerServiceLogger(final String identifier); + public MockComponentLog getControllerServiceLogger(final String identifier); /** * @return the State Manager that is used to stored and retrieve state diff --git a/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AMQPPublisher.java b/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AMQPPublisher.java index 41a08d9218..cd3b5058c4 100644 --- a/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AMQPPublisher.java +++ b/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AMQPPublisher.java @@ -18,7 +18,7 @@ package org.apache.nifi.amqp.processors; import java.io.IOException; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -38,7 +38,7 @@ final class AMQPPublisher extends AMQPWorker { private final String routingKey; - private final ProcessorLog processLog; + private final ComponentLog processLog; /** * Creates an instance of this publisher @@ -52,7 +52,7 @@ final class AMQPPublisher extends AMQPWorker { * (required) the name of the routingKey to be used by AMQP-based * system to route messages to its final destination (queue). */ - AMQPPublisher(Connection connection, String exchangeName, String routingKey, ProcessorLog processLog) { + AMQPPublisher(Connection connection, String exchangeName, String routingKey, ComponentLog processLog) { super(connection); this.processLog = processLog; this.validateStringProperty("routingKey", routingKey); diff --git a/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/test/java/org/apache/nifi/amqp/processors/AMQPPublisherTest.java b/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/test/java/org/apache/nifi/amqp/processors/AMQPPublisherTest.java index 9f01c04c48..c8d30f78e7 100644 --- a/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/test/java/org/apache/nifi/amqp/processors/AMQPPublisherTest.java +++ b/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/test/java/org/apache/nifi/amqp/processors/AMQPPublisherTest.java @@ -27,7 +27,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.nifi.util.MockProcessorLog; +import org.apache.nifi.util.MockComponentLog; import org.junit.Test; import org.mockito.Mockito; @@ -101,7 +101,7 @@ public class AMQPPublisherTest { connection.createChannel().addReturnListener(retListener); try (AMQPPublisher sender = new AMQPPublisher(connection, "myExchange", "key2", - new MockProcessorLog("foo", ""))) { + new MockComponentLog("foo", ""))) { sender.publish("hello".getBytes()); Thread.sleep(1000); } diff --git a/nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-processors/src/main/java/org/apache/nifi/processors/cassandra/AbstractCassandraProcessor.java b/nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-processors/src/main/java/org/apache/nifi/processors/cassandra/AbstractCassandraProcessor.java index 478ffaf8dc..3f93b814f6 100644 --- a/nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-processors/src/main/java/org/apache/nifi/processors/cassandra/AbstractCassandraProcessor.java +++ b/nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-processors/src/main/java/org/apache/nifi/processors/cassandra/AbstractCassandraProcessor.java @@ -32,7 +32,7 @@ import org.apache.nifi.components.PropertyValue; import org.apache.nifi.components.ValidationContext; import org.apache.nifi.components.ValidationResult; import org.apache.nifi.components.Validator; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.util.StandardValidators; @@ -183,7 +183,7 @@ public abstract class AbstractCassandraProcessor extends AbstractProcessor { protected void connectToCassandra(ProcessContext context) { if (cluster.get() == null) { - ProcessorLog log = getLogger(); + ComponentLog log = getLogger(); final String contactPointList = context.getProperty(CONTACT_POINTS).getValue(); final String consistencyLevel = context.getProperty(CONSISTENCY_LEVEL).getValue(); List contactPoints = getContactPoints(contactPointList); diff --git a/nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-processors/src/main/java/org/apache/nifi/processors/cassandra/PutCassandraQL.java b/nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-processors/src/main/java/org/apache/nifi/processors/cassandra/PutCassandraQL.java index c923b5b819..8c0908a1cf 100644 --- a/nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-processors/src/main/java/org/apache/nifi/processors/cassandra/PutCassandraQL.java +++ b/nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-processors/src/main/java/org/apache/nifi/processors/cassandra/PutCassandraQL.java @@ -38,7 +38,7 @@ import org.apache.nifi.annotation.lifecycle.OnShutdown; import org.apache.nifi.annotation.lifecycle.OnUnscheduled; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.Relationship; @@ -150,7 +150,7 @@ public class PutCassandraQL extends AbstractCassandraProcessor { @OnScheduled public void onScheduled(final ProcessContext context) { - ProcessorLog log = getLogger(); + ComponentLog log = getLogger(); try { connectToCassandra(context); } catch (final NoHostAvailableException nhae) { @@ -169,7 +169,7 @@ public class PutCassandraQL extends AbstractCassandraProcessor { @Override public void onTrigger(final ProcessContext context, final ProcessSession session) throws ProcessException { - ProcessorLog logger = getLogger(); + ComponentLog logger = getLogger(); FlowFile flowFile = session.get(); if (flowFile == null) { return; diff --git a/nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-processors/src/main/java/org/apache/nifi/processors/cassandra/QueryCassandra.java b/nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-processors/src/main/java/org/apache/nifi/processors/cassandra/QueryCassandra.java index 7b78ea6fe1..bf0890d964 100644 --- a/nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-processors/src/main/java/org/apache/nifi/processors/cassandra/QueryCassandra.java +++ b/nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-processors/src/main/java/org/apache/nifi/processors/cassandra/QueryCassandra.java @@ -45,7 +45,7 @@ import org.apache.nifi.annotation.behavior.WritesAttributes; import org.apache.nifi.annotation.lifecycle.OnScheduled; import org.apache.nifi.annotation.documentation.CapabilityDescription; import org.apache.nifi.annotation.documentation.Tags; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.Relationship; @@ -175,7 +175,7 @@ public class QueryCassandra extends AbstractCassandraProcessor { @OnScheduled public void onScheduled(final ProcessContext context) { - ProcessorLog log = getLogger(); + ComponentLog log = getLogger(); try { connectToCassandra(context); final int fetchSize = context.getProperty(FETCH_SIZE).asInteger(); @@ -212,7 +212,7 @@ public class QueryCassandra extends AbstractCassandraProcessor { } } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final String selectQuery = context.getProperty(CQL_SELECT_QUERY).evaluateAttributeExpressions(fileToProcess).getValue(); final long queryTimeout = context.getProperty(QUERY_TIMEOUT).asTimePeriod(TimeUnit.MILLISECONDS); final String outputFormat = context.getProperty(OUTPUT_FORMAT).getValue(); diff --git a/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/src/main/java/org/apache/nifi/processors/couchbase/AbstractCouchbaseProcessor.java b/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/src/main/java/org/apache/nifi/processors/couchbase/AbstractCouchbaseProcessor.java index ec0e9abca1..49f83b8f98 100644 --- a/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/src/main/java/org/apache/nifi/processors/couchbase/AbstractCouchbaseProcessor.java +++ b/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/src/main/java/org/apache/nifi/processors/couchbase/AbstractCouchbaseProcessor.java @@ -26,7 +26,7 @@ import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.couchbase.CouchbaseAttributes; import org.apache.nifi.couchbase.CouchbaseClusterControllerService; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -178,7 +178,7 @@ public abstract class AbstractCouchbaseProcessor extends AbstractProcessor { * @param errMsg a message to be logged */ protected void handleCouchbaseException(final ProcessContext context, final ProcessSession session, - final ProcessorLog logger, FlowFile inFile, CouchbaseException e, + final ComponentLog logger, FlowFile inFile, CouchbaseException e, String errMsg) { logger.error(errMsg, e); if (inFile != null) { diff --git a/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/src/main/java/org/apache/nifi/processors/couchbase/GetCouchbaseKey.java b/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/src/main/java/org/apache/nifi/processors/couchbase/GetCouchbaseKey.java index b4ff467bdd..63b583aace 100644 --- a/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/src/main/java/org/apache/nifi/processors/couchbase/GetCouchbaseKey.java +++ b/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/src/main/java/org/apache/nifi/processors/couchbase/GetCouchbaseKey.java @@ -38,7 +38,7 @@ import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.couchbase.CouchbaseAttributes; import org.apache.nifi.couchbase.CouchbaseClusterControllerService; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.Relationship; @@ -92,7 +92,7 @@ public class GetCouchbaseKey extends AbstractCouchbaseProcessor { } final long startNanos = System.nanoTime(); - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); String docId = null; if (!StringUtils.isEmpty(context.getProperty(DOC_ID).getValue())) { docId = context.getProperty(DOC_ID).evaluateAttributeExpressions(inFile).getValue(); diff --git a/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/src/main/java/org/apache/nifi/processors/couchbase/PutCouchbaseKey.java b/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/src/main/java/org/apache/nifi/processors/couchbase/PutCouchbaseKey.java index b03f3f2edd..2d89d8f0be 100644 --- a/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/src/main/java/org/apache/nifi/processors/couchbase/PutCouchbaseKey.java +++ b/nifi-nar-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/src/main/java/org/apache/nifi/processors/couchbase/PutCouchbaseKey.java @@ -39,7 +39,7 @@ import org.apache.nifi.couchbase.CouchbaseAttributes; import org.apache.nifi.couchbase.CouchbaseClusterControllerService; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.Relationship; @@ -105,7 +105,7 @@ public class PutCouchbaseKey extends AbstractCouchbaseProcessor { @Override public void onTrigger(final ProcessContext context, final ProcessSession session) throws ProcessException { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); FlowFile flowFile = session.get(); if (flowFile == null) { return; diff --git a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractElasticsearchProcessor.java b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractElasticsearchProcessor.java index 43833ffc0d..f810ec3abd 100644 --- a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractElasticsearchProcessor.java +++ b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/AbstractElasticsearchProcessor.java @@ -20,7 +20,7 @@ import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.components.ValidationContext; import org.apache.nifi.components.ValidationResult; import org.apache.nifi.components.Validator; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.exception.ProcessException; @@ -182,7 +182,7 @@ public abstract class AbstractElasticsearchProcessor extends AbstractProcessor { */ protected void createElasticsearchClient(ProcessContext context) throws ProcessException { - ProcessorLog log = getLogger(); + ComponentLog log = getLogger(); if (esClient.get() != null) { return; } diff --git a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/FetchElasticsearch.java b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/FetchElasticsearch.java index 6b2b22fd08..8d2e3781dd 100644 --- a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/FetchElasticsearch.java +++ b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/FetchElasticsearch.java @@ -27,7 +27,7 @@ import org.apache.nifi.annotation.lifecycle.OnScheduled; import org.apache.nifi.annotation.lifecycle.OnStopped; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.Relationship; @@ -153,7 +153,7 @@ public class FetchElasticsearch extends AbstractElasticsearchProcessor { final String docType = context.getProperty(TYPE).evaluateAttributeExpressions(flowFile).getValue(); final Charset charset = Charset.forName(context.getProperty(CHARSET).getValue()); - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); try { logger.debug("Fetching {}/{}/{} from Elasticsearch", new Object[]{index, docType, docId}); diff --git a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/PutElasticsearch.java b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/PutElasticsearch.java index a0c986c6b2..6452bc7f69 100644 --- a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/PutElasticsearch.java +++ b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/PutElasticsearch.java @@ -27,7 +27,7 @@ import org.apache.nifi.annotation.lifecycle.OnStopped; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.expression.AttributeExpression; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.Relationship; @@ -154,7 +154,7 @@ public class PutElasticsearch extends AbstractElasticsearchProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); // Keep track of the list of flow files that need to be transferred. As they are transferred, remove them from the list. List flowFilesToTransfer = new LinkedList<>(flowFiles); try { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/init/ControllerServiceInitializer.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/init/ControllerServiceInitializer.java index 6525280e5b..7a6d62c90b 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/init/ControllerServiceInitializer.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/init/ControllerServiceInitializer.java @@ -24,7 +24,7 @@ import org.apache.nifi.documentation.mock.MockConfigurationContext; import org.apache.nifi.documentation.mock.MockControllerServiceInitializationContext; import org.apache.nifi.documentation.mock.MockProcessorLogger; import org.apache.nifi.documentation.util.ReflectionUtils; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.nar.NarCloseable; import org.apache.nifi.reporting.InitializationException; @@ -49,7 +49,7 @@ public class ControllerServiceInitializer implements ConfigurableComponentInitia try (NarCloseable narCloseable = NarCloseable.withNarLoader()) { ControllerService controllerService = (ControllerService) component; - final ProcessorLog logger = new MockProcessorLogger(); + final ComponentLog logger = new MockProcessorLogger(); final MockConfigurationContext context = new MockConfigurationContext(); ReflectionUtils.quietlyInvokeMethodsWithAnnotations(OnShutdown.class, org.apache.nifi.processor.annotation.OnShutdown.class, controllerService, logger, context); } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/init/ProcessorInitializer.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/init/ProcessorInitializer.java index 00669ced2c..7fe4946b81 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/init/ProcessorInitializer.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/init/ProcessorInitializer.java @@ -23,7 +23,7 @@ import org.apache.nifi.documentation.mock.MockProcessContext; import org.apache.nifi.documentation.mock.MockProcessorInitializationContext; import org.apache.nifi.documentation.mock.MockProcessorLogger; import org.apache.nifi.documentation.util.ReflectionUtils; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.nar.NarCloseable; import org.apache.nifi.processor.Processor; @@ -47,7 +47,7 @@ public class ProcessorInitializer implements ConfigurableComponentInitializer { Processor processor = (Processor) component; try (NarCloseable narCloseable = NarCloseable.withNarLoader()) { - final ProcessorLog logger = new MockProcessorLogger(); + final ComponentLog logger = new MockProcessorLogger(); final MockProcessContext context = new MockProcessContext(); ReflectionUtils.quietlyInvokeMethodsWithAnnotations(OnShutdown.class, org.apache.nifi.processor.annotation.OnShutdown.class, processor, logger, context); } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/mock/MockProcessorInitializationContext.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/mock/MockProcessorInitializationContext.java index fda94a2575..4218250423 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/mock/MockProcessorInitializationContext.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/mock/MockProcessorInitializationContext.java @@ -17,7 +17,7 @@ package org.apache.nifi.documentation.mock; import org.apache.nifi.controller.ControllerServiceLookup; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessorInitializationContext; /** @@ -34,7 +34,7 @@ public class MockProcessorInitializationContext implements ProcessorInitializati } @Override - public ProcessorLog getLogger() { + public ComponentLog getLogger() { return new MockProcessorLogger(); } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/mock/MockProcessorLogger.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/mock/MockProcessorLogger.java index 8cdd90a2ca..df9e673446 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/mock/MockProcessorLogger.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/mock/MockProcessorLogger.java @@ -16,8 +16,8 @@ */ package org.apache.nifi.documentation.mock; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.logging.LogLevel; -import org.apache.nifi.logging.ProcessorLog; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -26,7 +26,7 @@ import org.slf4j.LoggerFactory; * be used during initialization of a component. * */ -public class MockProcessorLogger implements ProcessorLog { +public class MockProcessorLogger implements ComponentLog { private static final Logger logger = LoggerFactory .getLogger(MockProcessorLogger.class); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/util/ReflectionUtils.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/util/ReflectionUtils.java index b16c605b43..94fc1f3a03 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/util/ReflectionUtils.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-documentation/src/main/java/org/apache/nifi/documentation/util/ReflectionUtils.java @@ -22,7 +22,7 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -43,13 +43,13 @@ public class ReflectionUtils { * @param preferredAnnotation preferred * @param alternateAnnotation alternate * @param instance instance - * @param logger the ProcessorLog to use for logging any errors. If null, will use own logger, but that will not generate bulletins or easily tie to the Processor's log messages. + * @param logger the ComponentLog to use for logging any errors. If null, will use own logger, but that will not generate bulletins or easily tie to the Processor's log messages. * @param args args * @return true if all appropriate methods were invoked and returned without throwing an Exception, false if one of the methods threw an Exception or could not be * invoked; if false is returned, an error will have been logged. */ public static boolean quietlyInvokeMethodsWithAnnotations( - final Class preferredAnnotation, final Class alternateAnnotation, final Object instance, final ProcessorLog logger, final Object... args) { + final Class preferredAnnotation, final Class alternateAnnotation, final Object instance, final ComponentLog logger, final Object... args) { final List> annotationClasses = new ArrayList<>(alternateAnnotation == null ? 1 : 2); annotationClasses.add(preferredAnnotation); if (alternateAnnotation != null) { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java index 43759f56c4..4650c9210a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java @@ -169,7 +169,6 @@ import org.apache.nifi.logging.ControllerServiceLogObserver; import org.apache.nifi.logging.LogLevel; import org.apache.nifi.logging.LogRepository; import org.apache.nifi.logging.LogRepositoryFactory; -import org.apache.nifi.logging.ProcessorLog; import org.apache.nifi.logging.ProcessorLogObserver; import org.apache.nifi.logging.ReportingTaskLogObserver; import org.apache.nifi.nar.ExtensionManager; @@ -991,7 +990,7 @@ public class FlowController implements EventAccess, ControllerServiceProvider, R Thread.currentThread().setContextClassLoader(detectedClassLoaderForType); final Class processorClass = rawClass.asSubclass(Processor.class); processor = processorClass.newInstance(); - final ProcessorLog processorLogger = new SimpleProcessLogger(identifier, processor); + final ComponentLog processorLogger = new SimpleProcessLogger(identifier, processor); final ProcessorInitializationContext ctx = new StandardProcessorInitializationContext(identifier, processorLogger, this); processor.initialize(ctx); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java index 346f3dbc43..2be0dcf65c 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java @@ -43,9 +43,9 @@ import org.apache.nifi.connectable.Position; import org.apache.nifi.controller.service.ControllerServiceNode; import org.apache.nifi.controller.service.ControllerServiceProvider; import org.apache.nifi.groups.ProcessGroup; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.logging.LogLevel; import org.apache.nifi.logging.LogRepositoryFactory; -import org.apache.nifi.logging.ProcessorLog; import org.apache.nifi.nar.NarCloseable; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSessionFactory; @@ -1247,7 +1247,7 @@ public class StandardProcessorNode extends ProcessorNode implements Connectable if (!this.isValid()) { throw new IllegalStateException( "Processor " + this.getName() + " is not in a valid state due to " + this.getValidationErrors()); } - final ProcessorLog procLog = new SimpleProcessLogger(StandardProcessorNode.this.getIdentifier(), processor); + final ComponentLog procLog = new SimpleProcessLogger(StandardProcessorNode.this.getIdentifier(), processor); if (this.scheduledState.compareAndSet(ScheduledState.STOPPED, ScheduledState.STARTING)) { // will ensure that the Processor represented by this node can only be started once final Runnable startProcRunnable = new Runnable() { @Override diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/EventDrivenSchedulingAgent.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/EventDrivenSchedulingAgent.java index 228af707d4..c47d6aa878 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/EventDrivenSchedulingAgent.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/EventDrivenSchedulingAgent.java @@ -39,7 +39,7 @@ import org.apache.nifi.controller.repository.StandardProcessSessionFactory; import org.apache.nifi.controller.service.ControllerServiceProvider; import org.apache.nifi.encrypt.StringEncryptor; import org.apache.nifi.engine.FlowEngine; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.nar.NarCloseable; import org.apache.nifi.processor.ProcessSessionFactory; import org.apache.nifi.processor.SimpleProcessLogger; @@ -328,11 +328,11 @@ public class EventDrivenSchedulingAgent extends AbstractSchedulingAgent { try (final AutoCloseable ncl = NarCloseable.withNarLoader()) { worker.onTrigger(processContext, sessionFactory); } catch (final ProcessException pe) { - final ProcessorLog procLog = new SimpleProcessLogger(worker.getIdentifier(), worker.getProcessor()); + final ComponentLog procLog = new SimpleProcessLogger(worker.getIdentifier(), worker.getProcessor()); procLog.error("Failed to process session due to {}", new Object[]{pe}); } catch (final Throwable t) { - // Use ProcessorLog to log the event so that a bulletin will be created for this processor - final ProcessorLog procLog = new SimpleProcessLogger(worker.getIdentifier(), worker.getProcessor()); + // Use ComponentLog to log the event so that a bulletin will be created for this processor + final ComponentLog procLog = new SimpleProcessLogger(worker.getIdentifier(), worker.getProcessor()); procLog.error("{} failed to process session due to {}", new Object[]{worker.getProcessor(), t}); procLog.warn("Processor Administratively Yielded for {} due to processing failure", new Object[]{adminYieldDuration}); logger.warn("Administratively Yielding {} due to uncaught Exception: ", worker.getProcessor()); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/tasks/ContinuallyRunProcessorTask.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/tasks/ContinuallyRunProcessorTask.java index 91c17ae5f7..b82cb3a05d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/tasks/ContinuallyRunProcessorTask.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/tasks/ContinuallyRunProcessorTask.java @@ -31,7 +31,7 @@ import org.apache.nifi.controller.repository.StandardProcessSessionFactory; import org.apache.nifi.controller.scheduling.ProcessContextFactory; import org.apache.nifi.controller.scheduling.ScheduleState; import org.apache.nifi.controller.scheduling.SchedulingAgent; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.nar.NarCloseable; import org.apache.nifi.processor.ProcessSessionFactory; import org.apache.nifi.processor.SimpleProcessLogger; @@ -157,11 +157,11 @@ public class ContinuallyRunProcessorTask implements Callable { } } } catch (final ProcessException pe) { - final ProcessorLog procLog = new SimpleProcessLogger(procNode.getIdentifier(), procNode.getProcessor()); + final ComponentLog procLog = new SimpleProcessLogger(procNode.getIdentifier(), procNode.getProcessor()); procLog.error("Failed to process session due to {}", new Object[]{pe}); } catch (final Throwable t) { - // Use ProcessorLog to log the event so that a bulletin will be created for this processor - final ProcessorLog procLog = new SimpleProcessLogger(procNode.getIdentifier(), procNode.getProcessor()); + // Use ComponentLog to log the event so that a bulletin will be created for this processor + final ComponentLog procLog = new SimpleProcessLogger(procNode.getIdentifier(), procNode.getProcessor()); procLog.error("{} failed to process session due to {}", new Object[]{procNode.getProcessor(), t}); procLog.warn("Processor Administratively Yielded for {} due to processing failure", new Object[]{schedulingAgent.getAdministrativeYieldDuration()}); logger.warn("Administratively Yielding {} due to uncaught Exception: {}", procNode.getProcessor(), t.toString()); @@ -175,7 +175,7 @@ public class ContinuallyRunProcessorTask implements Callable { try { rawSession.commit(); } catch (final Exception e) { - final ProcessorLog procLog = new SimpleProcessLogger(procNode.getIdentifier(), procNode.getProcessor()); + final ComponentLog procLog = new SimpleProcessLogger(procNode.getIdentifier(), procNode.getProcessor()); procLog.error("Failed to commit session {} due to {}; rolling back", new Object[] { rawSession, e.toString() }, e); try { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/processor/SimpleProcessLogger.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/processor/SimpleProcessLogger.java index a8c5069263..4f31722810 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/processor/SimpleProcessLogger.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/processor/SimpleProcessLogger.java @@ -16,15 +16,15 @@ */ package org.apache.nifi.processor; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.logging.LogLevel; import org.apache.nifi.logging.LogRepository; import org.apache.nifi.logging.LogRepositoryFactory; -import org.apache.nifi.logging.ProcessorLog; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class SimpleProcessLogger implements ProcessorLog { +public class SimpleProcessLogger implements ComponentLog { private final Logger logger; private final LogRepository logRepository; diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/processor/StandardProcessorInitializationContext.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/processor/StandardProcessorInitializationContext.java index 59f4c79159..e1853316dd 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/processor/StandardProcessorInitializationContext.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/processor/StandardProcessorInitializationContext.java @@ -18,15 +18,15 @@ package org.apache.nifi.processor; import org.apache.nifi.controller.ControllerServiceLookup; import org.apache.nifi.controller.service.ControllerServiceProvider; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; public class StandardProcessorInitializationContext implements ProcessorInitializationContext { private final String identifier; - private final ProcessorLog logger; + private final ComponentLog logger; private final ControllerServiceProvider serviceProvider; - public StandardProcessorInitializationContext(final String identifier, final ProcessorLog processorLog, final ControllerServiceProvider serviceProvider) { + public StandardProcessorInitializationContext(final String identifier, final ComponentLog processorLog, final ControllerServiceProvider serviceProvider) { this.identifier = identifier; this.logger = processorLog; this.serviceProvider = serviceProvider; @@ -38,7 +38,7 @@ public class StandardProcessorInitializationContext implements ProcessorInitiali } @Override - public ProcessorLog getLogger() { + public ComponentLog getLogger() { return logger; } diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/util/ReflectionUtils.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/util/ReflectionUtils.java index 9f0380b92c..5e1838a2a0 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/util/ReflectionUtils.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/util/ReflectionUtils.java @@ -21,7 +21,7 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Arrays; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.annotation.AnnotationUtils; @@ -98,7 +98,7 @@ public class ReflectionUtils { * invoked; if false is returned, an error will have been logged. */ public static boolean quietlyInvokeMethodsWithAnnotation(final Class annotation, - final Object instance, final ProcessorLog logger, final Object... args) { + final Object instance, final ComponentLog logger, final Object... args) { return quietlyInvokeMethodsWithAnnotations(annotation, null, instance, logger, args); } @@ -119,13 +119,13 @@ public class ReflectionUtils { return quietlyInvokeMethodsWithAnnotations(preferredAnnotation, alternateAnnotation, instance, null, args); } - private static boolean invokeMethodsWithAnnotations(boolean quietly, ProcessorLog logger, Object instance, + private static boolean invokeMethodsWithAnnotations(boolean quietly, ComponentLog logger, Object instance, Class[] annotations, Object... args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { return invokeMethodsWithAnnotations(quietly, logger, instance, instance.getClass(), annotations, args); } - private static boolean invokeMethodsWithAnnotations(boolean quietly, ProcessorLog logger, Object instance, + private static boolean invokeMethodsWithAnnotations(boolean quietly, ComponentLog logger, Object instance, Class clazz, Class[] annotations, Object... args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { boolean isSuccess = true; @@ -159,7 +159,7 @@ public class ReflectionUtils { return false; } - private static Object[] buildUpdatedArgumentsList(boolean quietly, Method method, Class[] annotations, ProcessorLog processLogger, Object... args) { + private static Object[] buildUpdatedArgumentsList(boolean quietly, Method method, Class[] annotations, ComponentLog processLogger, Object... args) { boolean parametersCompatible = true; int argsCount = 0; @@ -185,7 +185,7 @@ public class ReflectionUtils { return updatedArguments; } - private static void logErrorMessage(String message, ProcessorLog processLogger, Exception e) { + private static void logErrorMessage(String message, ComponentLog processLogger, Exception e) { if (processLogger != null) { if (e != null) { processLogger.error(message, e); @@ -214,7 +214,7 @@ public class ReflectionUtils { * @param preferredAnnotation preferred * @param alternateAnnotation alternate * @param instance instance - * @param logger the ProcessorLog to use for logging any errors. If null, will + * @param logger the ComponentLog to use for logging any errors. If null, will * use own logger, but that will not generate bulletins or easily * tie to the Processor's log messages. * @param args args @@ -225,7 +225,7 @@ public class ReflectionUtils { */ @SuppressWarnings("unchecked") public static boolean quietlyInvokeMethodsWithAnnotations(final Class preferredAnnotation, - final Class alternateAnnotation, final Object instance, final ProcessorLog logger, + final Class alternateAnnotation, final Object instance, final ComponentLog logger, final Object... args) { Class[] annotationArray = (Class[]) (alternateAnnotation != null ? new Class[] { preferredAnnotation, alternateAnnotation } : new Class[] { preferredAnnotation }); diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/util/ReflectionUtilsTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/util/ReflectionUtilsTest.java index c3b35a9c75..8a956db66d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/util/ReflectionUtilsTest.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/util/ReflectionUtilsTest.java @@ -25,7 +25,7 @@ import java.util.ArrayList; import java.util.List; import org.apache.nifi.annotation.lifecycle.OnStopped; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; @@ -93,7 +93,7 @@ public class ReflectionUtilsTest { @Test public void validateNoFailureIfQuiatelyIfOneOfArgumentsWrongTypeAndProcessLog() throws Exception { - ProcessorLog pl = mock(ProcessorLog.class); + ComponentLog pl = mock(ComponentLog.class); ReflectionUtils.quietlyInvokeMethodsWithAnnotation(OnStopped.class, new E(), pl, 3, "hjk", "hjk"); verify(pl, Mockito.atMost(1)).error(Mockito.anyString()); } diff --git a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/GetHDFSSequenceFile.java b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/GetHDFSSequenceFile.java index 7de728a166..ccd5501b0b 100644 --- a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/GetHDFSSequenceFile.java +++ b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/GetHDFSSequenceFile.java @@ -25,7 +25,7 @@ import org.apache.nifi.annotation.documentation.SeeAlso; import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.DataUnit; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -82,7 +82,7 @@ public class GetHDFSSequenceFile extends GetHDFS { int bufferSize = bufferSizeProp.intValue(); conf.setInt(BUFFER_SIZE_KEY, bufferSize); } - ProcessorLog logger = getLogger(); + ComponentLog logger = getLogger(); final SequenceFileReader> reader; if (flowFileContentValue.equalsIgnoreCase(VALUE_ONLY)) { reader = new ValueReader(session); diff --git a/nifi-nar-bundles/nifi-image-bundle/nifi-image-processors/src/main/java/org/apache/nifi/processors/image/ExtractImageMetadata.java b/nifi-nar-bundles/nifi-image-bundle/nifi-image-processors/src/main/java/org/apache/nifi/processors/image/ExtractImageMetadata.java index b44eccd41e..1dd9241185 100644 --- a/nifi-nar-bundles/nifi-image-bundle/nifi-image-processors/src/main/java/org/apache/nifi/processors/image/ExtractImageMetadata.java +++ b/nifi-nar-bundles/nifi-image-bundle/nifi-image-processors/src/main/java/org/apache/nifi/processors/image/ExtractImageMetadata.java @@ -35,7 +35,7 @@ import org.apache.nifi.annotation.documentation.CapabilityDescription; import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -115,7 +115,7 @@ public class ExtractImageMetadata extends AbstractProcessor { return; } - final ProcessorLog logger = this.getLogger(); + final ComponentLog logger = this.getLogger(); final ObjectHolder value = new ObjectHolder<>(null); final Integer max = context.getProperty(MAX_NUMBER_OF_ATTRIBUTES).asInteger(); diff --git a/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/JMSConsumer.java b/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/JMSConsumer.java index e69705a184..d88b3488d4 100644 --- a/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/JMSConsumer.java +++ b/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/JMSConsumer.java @@ -29,7 +29,7 @@ import javax.jms.Queue; import javax.jms.TextMessage; import javax.jms.Topic; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.jms.core.JmsTemplate; @@ -48,9 +48,9 @@ final class JMSConsumer extends JMSWorker { * @param jmsTemplate * instance of {@link JmsTemplate} * @param processLog - * instance of {@link ProcessorLog} + * instance of {@link ComponentLog} */ - JMSConsumer(JmsTemplate jmsTemplate, ProcessorLog processLog) { + JMSConsumer(JmsTemplate jmsTemplate, ComponentLog processLog) { super(jmsTemplate, processLog); if (logger.isInfoEnabled()) { logger.info("Created Message Consumer for '" + jmsTemplate.toString() + "'."); diff --git a/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/JMSPublisher.java b/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/JMSPublisher.java index 3643c51118..cc9ee7f8ac 100644 --- a/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/JMSPublisher.java +++ b/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/JMSPublisher.java @@ -28,7 +28,7 @@ import javax.jms.Session; import javax.jms.Topic; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.jms.core.JmsTemplate; @@ -50,9 +50,9 @@ final class JMSPublisher extends JMSWorker { * @param jmsTemplate * instance of {@link JmsTemplate} * @param processLog - * instance of {@link ProcessorLog} + * instance of {@link ComponentLog} */ - JMSPublisher(JmsTemplate jmsTemplate, ProcessorLog processLog) { + JMSPublisher(JmsTemplate jmsTemplate, ComponentLog processLog) { super(jmsTemplate, processLog); if (logger.isInfoEnabled()) { logger.info("Created Message Publisher for '" + jmsTemplate.toString() + "'."); diff --git a/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/JMSWorker.java b/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/JMSWorker.java index bfb3f86ea9..b0e7087881 100644 --- a/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/JMSWorker.java +++ b/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/processors/JMSWorker.java @@ -20,7 +20,7 @@ import java.nio.channels.Channel; import javax.jms.Connection; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.springframework.jms.core.JmsTemplate; @@ -34,7 +34,7 @@ abstract class JMSWorker { protected final JmsTemplate jmsTemplate; - protected final ProcessorLog processLog; + protected final ComponentLog processLog; /** * Creates an instance of this worker initializing it with JMS @@ -42,9 +42,9 @@ abstract class JMSWorker { * sub-classes to interact with JMS systems * * @param jmsTemplate the instance of {@link JmsTemplate} - * @param processLog the instance of {@link ProcessorLog} + * @param processLog the instance of {@link ComponentLog} */ - public JMSWorker(JmsTemplate jmsTemplate, ProcessorLog processLog) { + public JMSWorker(JmsTemplate jmsTemplate, ComponentLog processLog) { this.jmsTemplate = jmsTemplate; this.processLog = processLog; } diff --git a/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/test/java/org/apache/nifi/jms/processors/ConsumeJMSTest.java b/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/test/java/org/apache/nifi/jms/processors/ConsumeJMSTest.java index 48195a3911..68b95fdd9f 100644 --- a/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/test/java/org/apache/nifi/jms/processors/ConsumeJMSTest.java +++ b/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/test/java/org/apache/nifi/jms/processors/ConsumeJMSTest.java @@ -22,7 +22,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import org.apache.nifi.jms.cf.JMSConnectionFactoryProviderDefinition; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.util.MockFlowFile; import org.apache.nifi.util.TestRunner; import org.apache.nifi.util.TestRunners; @@ -36,7 +36,7 @@ public class ConsumeJMSTest { @Test public void validateSuccessfulConsumeAndTransferToSuccess() throws Exception { JmsTemplate jmsTemplate = CommonTest.buildJmsTemplateForDestination("cooQueue", false); - JMSPublisher sender = new JMSPublisher(jmsTemplate, mock(ProcessorLog.class)); + JMSPublisher sender = new JMSPublisher(jmsTemplate, mock(ComponentLog.class)); sender.publish("Hey dude!".getBytes()); TestRunner runner = TestRunners.newTestRunner(new ConsumeJMS()); JMSConnectionFactoryProviderDefinition cs = mock(JMSConnectionFactoryProviderDefinition.class); diff --git a/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/test/java/org/apache/nifi/jms/processors/JMSPublisherConsumerTest.java b/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/test/java/org/apache/nifi/jms/processors/JMSPublisherConsumerTest.java index e18263e928..1aa528899d 100644 --- a/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/test/java/org/apache/nifi/jms/processors/JMSPublisherConsumerTest.java +++ b/nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/test/java/org/apache/nifi/jms/processors/JMSPublisherConsumerTest.java @@ -31,7 +31,7 @@ import javax.jms.TextMessage; import javax.jms.Topic; import org.apache.nifi.jms.processors.JMSConsumer.JMSResponse; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.junit.Test; import org.springframework.jms.connection.CachingConnectionFactory; import org.springframework.jms.core.JmsTemplate; @@ -44,7 +44,7 @@ public class JMSPublisherConsumerTest { public void validateByesConvertedToBytesMessageOnSend() throws Exception { JmsTemplate jmsTemplate = CommonTest.buildJmsTemplateForDestination("testQueue", false); - JMSPublisher publisher = new JMSPublisher(jmsTemplate, mock(ProcessorLog.class)); + JMSPublisher publisher = new JMSPublisher(jmsTemplate, mock(ComponentLog.class)); publisher.publish("hellomq".getBytes()); Message receivedMessage = jmsTemplate.receive(); @@ -60,7 +60,7 @@ public class JMSPublisherConsumerTest { public void validateJmsHeadersAndPropertiesAreTransferredFromFFAttributes() throws Exception { JmsTemplate jmsTemplate = CommonTest.buildJmsTemplateForDestination("testQueue", false); - JMSPublisher publisher = new JMSPublisher(jmsTemplate, mock(ProcessorLog.class)); + JMSPublisher publisher = new JMSPublisher(jmsTemplate, mock(ComponentLog.class)); Map flowFileAttributes = new HashMap<>(); flowFileAttributes.put("foo", "foo"); flowFileAttributes.put(JmsHeaders.REPLY_TO, "myTopic"); @@ -92,7 +92,7 @@ public class JMSPublisherConsumerTest { } }); - JMSConsumer consumer = new JMSConsumer(jmsTemplate, mock(ProcessorLog.class)); + JMSConsumer consumer = new JMSConsumer(jmsTemplate, mock(ComponentLog.class)); try { consumer.consume(); } finally { @@ -115,7 +115,7 @@ public class JMSPublisherConsumerTest { } }); - JMSConsumer consumer = new JMSConsumer(jmsTemplate, mock(ProcessorLog.class)); + JMSConsumer consumer = new JMSConsumer(jmsTemplate, mock(ComponentLog.class)); assertEquals("JMSConsumer[destination:testQueue; pub-sub:false;]", consumer.toString()); JMSResponse response = consumer.consume(); diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/processors/kafka/KafkaPublisher.java b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/processors/kafka/KafkaPublisher.java index dac5804fd1..bf89d2204c 100644 --- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/processors/kafka/KafkaPublisher.java +++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-processors/src/main/java/org/apache/nifi/processors/kafka/KafkaPublisher.java @@ -33,7 +33,7 @@ import org.apache.kafka.clients.producer.ProducerRecord; import org.apache.kafka.clients.producer.RecordMetadata; import org.apache.kafka.common.serialization.ByteArraySerializer; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.stream.io.util.StreamDemarcator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -52,7 +52,7 @@ class KafkaPublisher implements Closeable { private long ackWaitTime = 30000; - private ProcessorLog processLog; + private ComponentLog processLog; private final Partitioner partitioner; @@ -110,7 +110,7 @@ class KafkaPublisher implements Closeable { */ KafkaPublisherResult publish(PublishingContext publishingContext) { StreamDemarcator streamTokenizer = new StreamDemarcator(publishingContext.getContentStream(), - publishingContext.getDelimiterBytes(), publishingContext.getMaxRequestSize()); + publishingContext.getDelimiterBytes(), publishingContext.getMaxRequestSize()); int prevLastAckedMessageIndex = publishingContext.getLastAckedMessageIndex(); List> resultFutures = new ArrayList<>(); @@ -124,7 +124,7 @@ class KafkaPublisher implements Closeable { partitionId = this.getPartition(publishingContext.getKeyBytes(), publishingContext.getTopic()); } ProducerRecord message = - new ProducerRecord<>(publishingContext.getTopic(), publishingContext.getPartitionId(), publishingContext.getKeyBytes(), messageBytes); + new ProducerRecord<>(publishingContext.getTopic(), publishingContext.getPartitionId(), publishingContext.getKeyBytes(), messageBytes); resultFutures.add(this.kafkaProducer.send(message)); } } @@ -198,10 +198,10 @@ class KafkaPublisher implements Closeable { } /** - * Will set {@link ProcessorLog} as an additional logger to forward log + * Will set {@link ComponentLog} as an additional logger to forward log * messages to NiFi bulletin */ - void setProcessLog(ProcessorLog processLog) { + void setProcessLog(ComponentLog processLog) { this.processLog = processLog; } diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java index ebe7a24f29..fc00a080db 100644 --- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java +++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java @@ -36,7 +36,7 @@ import org.apache.nifi.components.ValidationContext; import org.apache.nifi.components.ValidationResult; import org.apache.nifi.components.Validator; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.Relationship; @@ -132,7 +132,7 @@ public class GetMongo extends AbstractMongoProcessor { @Override public void onTrigger(final ProcessContext context, final ProcessSession session) throws ProcessException { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final Document query = context.getProperty(QUERY).isSet() ? Document.parse(context.getProperty(QUERY).getValue()) : null; final Document projection = context.getProperty(PROJECTION).isSet() ? Document.parse(context.getProperty(PROJECTION).getValue()) : null; diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/PutMongo.java b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/PutMongo.java index 5f6d875678..51e5265f1c 100644 --- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/PutMongo.java +++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/PutMongo.java @@ -32,7 +32,7 @@ import org.apache.nifi.annotation.documentation.CapabilityDescription; import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.Relationship; @@ -142,7 +142,7 @@ public class PutMongo extends AbstractMongoProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final Charset charset = Charset.forName(context.getProperty(CHARACTER_SET).getValue()); final String mode = context.getProperty(MODE).getValue(); diff --git a/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/AbstractScriptProcessor.java b/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/AbstractScriptProcessor.java index a34c83c0d1..ad41850836 100644 --- a/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/AbstractScriptProcessor.java +++ b/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/AbstractScriptProcessor.java @@ -16,6 +16,21 @@ */ package org.apache.nifi.processors.script; +import org.apache.nifi.components.AllowableValue; +import org.apache.nifi.components.PropertyDescriptor; +import org.apache.nifi.components.ValidationContext; +import org.apache.nifi.components.ValidationResult; +import org.apache.nifi.components.Validator; +import org.apache.nifi.logging.ComponentLog; +import org.apache.nifi.processor.AbstractSessionFactoryProcessor; +import org.apache.nifi.processor.Relationship; +import org.apache.nifi.processor.util.StandardValidators; +import org.apache.nifi.util.StringUtils; + +import javax.script.ScriptEngine; +import javax.script.ScriptEngineFactory; +import javax.script.ScriptEngineManager; +import javax.script.ScriptException; import java.io.File; import java.net.MalformedURLException; import java.net.URL; @@ -47,7 +62,6 @@ import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.components.ValidationContext; import org.apache.nifi.components.ValidationResult; import org.apache.nifi.components.Validator; -import org.apache.nifi.logging.ProcessorLog; import org.apache.nifi.processor.AbstractSessionFactoryProcessor; import org.apache.nifi.processor.Relationship; import org.apache.nifi.processor.util.StandardValidators; @@ -223,7 +237,7 @@ public abstract class AbstractScriptProcessor extends AbstractSessionFactoryProc engineQ = new LinkedBlockingQueue<>(numberOfScriptEngines); ClassLoader originalContextClassLoader = Thread.currentThread().getContextClassLoader(); try { - ProcessorLog log = getLogger(); + ComponentLog log = getLogger(); if (StringUtils.isBlank(scriptEngineName)) { throw new IllegalArgumentException("The script engine name cannot be null"); diff --git a/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/ExecuteScript.java b/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/ExecuteScript.java index f9fe2e3b3e..224c55f9b2 100644 --- a/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/ExecuteScript.java +++ b/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/ExecuteScript.java @@ -30,11 +30,13 @@ import javax.script.ScriptException; import javax.script.SimpleBindings; import org.apache.commons.io.IOUtils; import org.apache.nifi.annotation.behavior.DynamicProperty; +import org.apache.nifi.annotation.behavior.TriggerSerially; +import org.apache.nifi.annotation.lifecycle.OnStopped; +import org.apache.nifi.components.PropertyDescriptor; +import org.apache.nifi.logging.ComponentLog; +import org.apache.nifi.annotation.lifecycle.OnScheduled; import org.apache.nifi.annotation.documentation.CapabilityDescription; import org.apache.nifi.annotation.documentation.Tags; -import org.apache.nifi.annotation.lifecycle.OnScheduled; -import org.apache.nifi.components.PropertyDescriptor; -import org.apache.nifi.logging.ProcessorLog; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.ProcessSessionFactory; @@ -161,7 +163,7 @@ public class ExecuteScript extends AbstractScriptProcessor { } } ScriptEngine scriptEngine = engineQ.poll(); - ProcessorLog log = getLogger(); + ComponentLog log = getLogger(); if (scriptEngine == null) { // No engine available so nothing more to do here return; diff --git a/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/InvokeScriptedProcessor.java b/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/InvokeScriptedProcessor.java index 06c0a7f18b..b4a6c0d524 100644 --- a/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/InvokeScriptedProcessor.java +++ b/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/InvokeScriptedProcessor.java @@ -42,7 +42,7 @@ import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.components.ValidationContext; import org.apache.nifi.components.ValidationResult; import org.apache.nifi.controller.ControllerServiceLookup; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSessionFactory; import org.apache.nifi.processor.Processor; @@ -84,7 +84,7 @@ public class InvokeScriptedProcessor extends AbstractScriptProcessor { try { relationships.addAll(instance.getRelationships()); } catch (final Throwable t) { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final String message = "Unable to get relationships from scripted Processor: " + t; logger.error(message); @@ -126,7 +126,7 @@ public class InvokeScriptedProcessor extends AbstractScriptProcessor { supportedPropertyDescriptors.addAll(instanceDescriptors); } } catch (final Throwable t) { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final String message = "Unable to get property descriptors from Processor: " + t; logger.error(message); @@ -206,7 +206,7 @@ public class InvokeScriptedProcessor extends AbstractScriptProcessor { */ @Override public void onPropertyModified(final PropertyDescriptor descriptor, final String oldValue, final String newValue) { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final Processor instance = processor.get(); if (SCRIPT_FILE.equals(descriptor) @@ -240,7 +240,7 @@ public class InvokeScriptedProcessor extends AbstractScriptProcessor { return reloadScript(IOUtils.toString(scriptStream)); } catch (final Exception e) { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final String message = "Unable to load script: " + e; logger.error(message, e); @@ -271,7 +271,7 @@ public class InvokeScriptedProcessor extends AbstractScriptProcessor { return reloadScript(scriptBody); } catch (final Exception e) { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final String message = "Unable to load script: " + e; logger.error(message, e); @@ -319,7 +319,7 @@ public class InvokeScriptedProcessor extends AbstractScriptProcessor { // get configured processor from the script (if it exists) final Object obj = scriptEngine.get("processor"); if (obj != null) { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); try { // set the logger if the processor wants it @@ -343,7 +343,7 @@ public class InvokeScriptedProcessor extends AbstractScriptProcessor { } @Override - public ProcessorLog getLogger() { + public ComponentLog getLogger() { return logger; } @@ -363,7 +363,7 @@ public class InvokeScriptedProcessor extends AbstractScriptProcessor { } } catch (final Exception ex) { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final String message = "Unable to load script: " + ex.getLocalizedMessage(); logger.error(message, ex); @@ -423,7 +423,7 @@ public class InvokeScriptedProcessor extends AbstractScriptProcessor { return instanceResults; } } catch (final Exception e) { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final String message = "Unable to validate the script Processor: " + e; logger.error(message, e); @@ -465,7 +465,7 @@ public class InvokeScriptedProcessor extends AbstractScriptProcessor { } } - ProcessorLog log = getLogger(); + ComponentLog log = getLogger(); // ensure the processor (if it exists) is loaded final Processor instance = processor.get(); diff --git a/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/impl/GroovyScriptEngineConfigurator.java b/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/impl/GroovyScriptEngineConfigurator.java index 83e04cba27..b4c4cd39d6 100644 --- a/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/impl/GroovyScriptEngineConfigurator.java +++ b/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/main/java/org/apache/nifi/processors/script/impl/GroovyScriptEngineConfigurator.java @@ -29,7 +29,7 @@ public class GroovyScriptEngineConfigurator extends AbstractModuleClassloaderCon + "import org.apache.nifi.processor.io.*\n" + "import org.apache.nifi.processor.util.*\n" + "import org.apache.nifi.processors.script.*\n" - + "import org.apache.nifi.logging.ProcessorLog\n"; + + "import org.apache.nifi.logging.ComponentLog\n"; private ScriptEngine scriptEngine; diff --git a/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/test/resources/groovy/testInvokeScriptCausesException.groovy b/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/test/resources/groovy/testInvokeScriptCausesException.groovy index 1b2922c515..d41710fc52 100644 --- a/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/test/resources/groovy/testInvokeScriptCausesException.groovy +++ b/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/test/resources/groovy/testInvokeScriptCausesException.groovy @@ -17,7 +17,7 @@ class testInvokeScriptCausesException implements Processor { - def ProcessorLog log + def ComponentLog log @Override void initialize(ProcessorInitializationContext context) { diff --git a/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/test/resources/groovy/testScriptRoutesToFailure.groovy b/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/test/resources/groovy/testScriptRoutesToFailure.groovy index 47074a27bd..90d7d6c162 100644 --- a/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/test/resources/groovy/testScriptRoutesToFailure.groovy +++ b/nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/test/resources/groovy/testScriptRoutesToFailure.groovy @@ -16,7 +16,7 @@ */ class testScriptRoutesToFailure implements Processor { - def ProcessorLog log + def ComponentLog log @Override void initialize(ProcessorInitializationContext context) { diff --git a/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/main/java/org/apache/nifi/processors/solr/GetSolr.java b/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/main/java/org/apache/nifi/processors/solr/GetSolr.java index 0de5b089a8..3bf073e163 100644 --- a/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/main/java/org/apache/nifi/processors/solr/GetSolr.java +++ b/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-processors/src/main/java/org/apache/nifi/processors/solr/GetSolr.java @@ -47,7 +47,7 @@ import org.apache.nifi.annotation.lifecycle.OnRemoved; import org.apache.nifi.annotation.lifecycle.OnStopped; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.ProcessorInitializationContext; @@ -182,7 +182,7 @@ public class GetSolr extends SolrProcessor { @Override public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); readLastEndDate(); final SimpleDateFormat sdf = new SimpleDateFormat(LAST_END_DATE_PATTERN, Locale.US); diff --git a/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-processors/src/test/java/org/apache/nifi/processors/splunk/TestPutSplunk.java b/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-processors/src/test/java/org/apache/nifi/processors/splunk/TestPutSplunk.java index d6bf3a1c71..a0713a3291 100644 --- a/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-processors/src/test/java/org/apache/nifi/processors/splunk/TestPutSplunk.java +++ b/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-processors/src/test/java/org/apache/nifi/processors/splunk/TestPutSplunk.java @@ -16,7 +16,7 @@ */ package org.apache.nifi.processors.splunk; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.util.put.sender.ChannelSender; import org.apache.nifi.util.MockFlowFile; import org.apache.nifi.util.TestRunner; @@ -43,7 +43,7 @@ public class TestPutSplunk { @Before public void init() { - ProcessorLog logger = Mockito.mock(ProcessorLog.class); + ComponentLog logger = Mockito.mock(ComponentLog.class); sender = new CapturingChannelSender("localhost", 12345, 0, logger); proc = new TestablePutSplunk(sender); @@ -356,7 +356,7 @@ public class TestPutSplunk { private int errorStart = -1; private int errorEnd = -1; - public CapturingChannelSender(String host, int port, int maxSendBufferSize, ProcessorLog logger) { + public CapturingChannelSender(String host, int port, int maxSendBufferSize, ComponentLog logger) { super(host, port, maxSendBufferSize, logger); } diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/Base64EncodeContent.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/Base64EncodeContent.java index db45109c0c..cdade756d7 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/Base64EncodeContent.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/Base64EncodeContent.java @@ -37,7 +37,7 @@ import org.apache.nifi.annotation.documentation.CapabilityDescription; import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -107,7 +107,7 @@ public class Base64EncodeContent extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); boolean encode = context.getProperty(MODE).getValue().equalsIgnoreCase(ENCODE_MODE); try { diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/BinFiles.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/BinFiles.java index e5f3d555dc..3df4317c33 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/BinFiles.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/BinFiles.java @@ -30,7 +30,7 @@ import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.components.ValidationContext; import org.apache.nifi.components.ValidationResult; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractSessionFactoryProcessor; import org.apache.nifi.processor.DataUnit; import org.apache.nifi.processor.ProcessContext; @@ -218,7 +218,7 @@ public abstract class BinFiles extends AbstractSessionFactoryProcessor { final List bins = new ArrayList<>(); bins.add(bin); - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final ProcessSession session = sessionFactory.createSession(); final List binCopy = new ArrayList<>(bin.getContents()); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/CompressContent.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/CompressContent.java index f8855216df..e4e6cf4a06 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/CompressContent.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/CompressContent.java @@ -44,7 +44,7 @@ import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -180,7 +180,7 @@ public class CompressContent extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final long sizeBeforeCompression = flowFile.getSize(); final String compressionMode = context.getProperty(MODE).getValue(); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ControlRate.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ControlRate.java index 5612d4fd4e..bce67ac9a2 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ControlRate.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ControlRate.java @@ -44,7 +44,7 @@ import org.apache.nifi.components.ValidationContext; import org.apache.nifi.components.ValidationResult; import org.apache.nifi.components.Validator; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.DataUnit; import org.apache.nifi.processor.FlowFileFilter; @@ -261,7 +261,7 @@ public class ControlRate extends AbstractProcessor { } } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); for (FlowFile flowFile : flowFiles) { // call this to capture potential error final long accrualAmount = getFlowFileAccrual(flowFile); @@ -311,13 +311,13 @@ public class ControlRate extends AbstractProcessor { private final AtomicLong maxRate = new AtomicLong(1L); private final long timePeriodMillis; private final TimedBuffer timedBuffer; - private final ProcessorLog logger; + private final ComponentLog logger; private volatile long penalizationPeriod = 0; private volatile long penalizationExpired = 0; private volatile long lastUpdateTime; - public Throttle(final int timePeriod, final TimeUnit unit, final ProcessorLog logger) { + public Throttle(final int timePeriod, final TimeUnit unit, final ComponentLog logger) { this.timePeriodMillis = TimeUnit.MILLISECONDS.convert(timePeriod, unit); this.timedBuffer = new TimedBuffer<>(unit, timePeriod, new LongEntityAccess()); this.logger = logger; diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertCharacterSet.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertCharacterSet.java index 53c19543ea..c1f76a4cf4 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertCharacterSet.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ConvertCharacterSet.java @@ -31,7 +31,7 @@ import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.Relationship; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.annotation.documentation.CapabilityDescription; import org.apache.nifi.annotation.behavior.EventDriven; import org.apache.nifi.annotation.behavior.InputRequirement; @@ -136,7 +136,7 @@ public class ConvertCharacterSet extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final Charset inputCharset = Charset.forName(context.getProperty(INPUT_CHARSET).evaluateAttributeExpressions(flowFile).getValue()); final Charset outputCharset = Charset.forName(context.getProperty(OUTPUT_CHARSET).evaluateAttributeExpressions(flowFile).getValue()); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/DetectDuplicate.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/DetectDuplicate.java index 71195d9dbd..2fd7b8027c 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/DetectDuplicate.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/DetectDuplicate.java @@ -43,7 +43,7 @@ import org.apache.nifi.distributed.cache.client.exception.DeserializationExcepti import org.apache.nifi.distributed.cache.client.exception.SerializationException; import org.apache.nifi.expression.AttributeExpression.ResultType; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -160,7 +160,7 @@ public class DetectDuplicate extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final String cacheKey = context.getProperty(CACHE_ENTRY_IDENTIFIER).evaluateAttributeExpressions(flowFile).getValue(); if (StringUtils.isBlank(cacheKey)) { logger.error("FlowFile {} has no attribute for given Cache Entry Identifier", new Object[]{flowFile}); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EncodeContent.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EncodeContent.java index d1e010d9c5..469e4ecd92 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EncodeContent.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EncodeContent.java @@ -42,7 +42,7 @@ import org.apache.nifi.annotation.documentation.CapabilityDescription; import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -128,7 +128,7 @@ public class EncodeContent extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); boolean encode = context.getProperty(MODE).getValue().equalsIgnoreCase(ENCODE_MODE); String encoding = context.getProperty(ENCODING).getValue(); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EncryptContent.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EncryptContent.java index a02fd3067e..b4f8c49385 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EncryptContent.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EncryptContent.java @@ -32,7 +32,7 @@ import org.apache.nifi.components.ValidationContext; import org.apache.nifi.components.ValidationResult; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -454,7 +454,7 @@ public class EncryptContent extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final String method = context.getProperty(ENCRYPTION_ALGORITHM).getValue(); final EncryptionMethod encryptionMethod = EncryptionMethod.valueOf(method); final String providerName = encryptionMethod.getProvider(); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EvaluateJsonPath.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EvaluateJsonPath.java index db60f13bce..18259d1ab7 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EvaluateJsonPath.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EvaluateJsonPath.java @@ -44,7 +44,7 @@ import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.components.ValidationContext; import org.apache.nifi.components.ValidationResult; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.ProcessorInitializationContext; @@ -238,7 +238,7 @@ public class EvaluateJsonPath extends AbstractJsonPathProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); String representationOption = processContext.getProperty(NULL_VALUE_DEFAULT_REPRESENTATION).getValue(); final String nullDefaultValue = NULL_REPRESENTATION_MAP.get(representationOption); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EvaluateXPath.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EvaluateXPath.java index 6b3c514e46..10d9af983d 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EvaluateXPath.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EvaluateXPath.java @@ -64,7 +64,7 @@ import org.apache.nifi.components.ValidationContext; import org.apache.nifi.components.ValidationResult; import org.apache.nifi.components.Validator; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -219,7 +219,7 @@ public class EvaluateXPath extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final XPathFactory factory = factoryRef.get(); final XPathEvaluator xpathEvaluator = (XPathEvaluator) factory.newXPath(); final Map attributeToXPathMap = new HashMap<>(); @@ -400,7 +400,7 @@ public class EvaluateXPath extends AbstractProcessor { props.setProperty(OutputKeys.OMIT_XML_DECLARATION, "no"); transformer.setOutputProperties(props); - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final ObjectHolder error = new ObjectHolder<>(null); transformer.setErrorListener(new ErrorListener() { diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EvaluateXQuery.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EvaluateXQuery.java index f8db8f88f7..51a7db0aec 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EvaluateXQuery.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EvaluateXQuery.java @@ -54,7 +54,7 @@ import org.apache.nifi.components.ValidationContext; import org.apache.nifi.components.ValidationResult; import org.apache.nifi.components.Validator; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -227,7 +227,7 @@ public class EvaluateXQuery extends AbstractProcessor { if (flowFileBatch.isEmpty()) { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final Map attributeToXQueryMap = new HashMap<>(); final Processor proc = new Processor(false); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExecuteProcess.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExecuteProcess.java index fd6bb05368..2af1f5383b 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExecuteProcess.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExecuteProcess.java @@ -52,7 +52,7 @@ import org.apache.nifi.annotation.lifecycle.OnUnscheduled; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.components.Validator; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -389,12 +389,12 @@ public class ExecuteProcess extends AbstractProcessor { */ private static class ProxyOutputStream extends OutputStream { - private final ProcessorLog logger; + private final ComponentLog logger; private final Lock lock = new ReentrantLock(); private OutputStream delegate; - public ProxyOutputStream(final ProcessorLog logger) { + public ProxyOutputStream(final ComponentLog logger) { this.logger = logger; } diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExecuteSQL.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExecuteSQL.java index 02d9f886a7..1e775bf456 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExecuteSQL.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExecuteSQL.java @@ -37,7 +37,7 @@ import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.dbcp.DBCPService; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -136,7 +136,7 @@ public class ExecuteSQL extends AbstractProcessor { } } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final DBCPService dbcpService = context.getProperty(DBCP_SERVICE).asControllerService(DBCPService.class); final String selectQuery = context.getProperty(SQL_SELECT_QUERY).evaluateAttributeExpressions(fileToProcess).getValue(); final Integer queryTimeout = context.getProperty(QUERY_TIMEOUT).asTimePeriod(TimeUnit.SECONDS).intValue(); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExecuteStreamCommand.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExecuteStreamCommand.java index 44a03b914d..4654a225e4 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExecuteStreamCommand.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExecuteStreamCommand.java @@ -49,7 +49,7 @@ import org.apache.nifi.components.ValidationResult; import org.apache.nifi.components.Validator; import org.apache.nifi.expression.AttributeExpression.ResultType; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -245,7 +245,7 @@ public class ExecuteStreamCommand extends AbstractProcessor { ATTRIBUTE_RELATIONSHIP_SET = Collections.unmodifiableSet(attributeRelationships); } - private ProcessorLog logger; + private ComponentLog logger; @Override public Set getRelationships() { @@ -408,7 +408,7 @@ public class ExecuteStreamCommand extends AbstractProcessor { final boolean ignoreStdin; final OutputStream stdinWritable; final InputStream stdoutReadable; - final ProcessorLog logger; + final ComponentLog logger; final ProcessSession session; final Process process; FlowFile outputFlowFile; @@ -420,7 +420,7 @@ public class ExecuteStreamCommand extends AbstractProcessor { byte[] outputBuffer; int size; - public ProcessStreamWriterCallback(boolean ignoreStdin, OutputStream stdinWritable, InputStream stdoutReadable,ProcessorLog logger, String attributeName, + public ProcessStreamWriterCallback(boolean ignoreStdin, OutputStream stdinWritable, InputStream stdoutReadable,ComponentLog logger, String attributeName, ProcessSession session, FlowFile outputFlowFile, Process process, boolean putToAttribute, int attributeSize) { this.ignoreStdin = ignoreStdin; this.stdinWritable = stdinWritable; @@ -477,7 +477,7 @@ public class ExecuteStreamCommand extends AbstractProcessor { } private static void readStdoutReadable(final boolean ignoreStdin, final OutputStream stdinWritable, - final ProcessorLog logger, final InputStream incomingFlowFileIS) throws IOException { + final ComponentLog logger, final InputStream incomingFlowFileIS) throws IOException { Thread writerThread = new Thread(new Runnable() { @Override diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExtractText.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExtractText.java index 0c40a1585d..a4370b8ab7 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExtractText.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExtractText.java @@ -44,7 +44,7 @@ import org.apache.nifi.annotation.lifecycle.OnScheduled; import org.apache.nifi.annotation.lifecycle.OnStopped; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.DataUnit; import org.apache.nifi.processor.ProcessContext; @@ -285,7 +285,7 @@ public class ExtractText extends AbstractProcessor { if (flowFile == null) { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final Charset charset = Charset.forName(context.getProperty(CHARACTER_SET).getValue()); final int maxCaptureGroupLength = context.getProperty(MAX_CAPTURE_GROUP_LENGTH).asInteger(); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/FetchDistributedMapCache.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/FetchDistributedMapCache.java index ee1a897354..185ed72645 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/FetchDistributedMapCache.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/FetchDistributedMapCache.java @@ -34,7 +34,7 @@ import org.apache.nifi.distributed.cache.client.exception.SerializationException import org.apache.nifi.expression.AttributeExpression; import org.apache.nifi.expression.AttributeExpression.ResultType; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -157,7 +157,7 @@ public class FetchDistributedMapCache extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final String cacheKey = context.getProperty(PROP_CACHE_ENTRY_IDENTIFIER).evaluateAttributeExpressions(flowFile).getValue(); if (StringUtils.isBlank(cacheKey)) { logger.error("FlowFile {} has no attribute for given Cache Entry Identifier", new Object[]{flowFile}); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetFile.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetFile.java index 74b6761bea..45c95eb8f9 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetFile.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetFile.java @@ -61,7 +61,7 @@ import org.apache.nifi.annotation.lifecycle.OnScheduled; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.DataUnit; import org.apache.nifi.processor.ProcessContext; @@ -363,7 +363,7 @@ public class GetFile extends AbstractProcessor { public void onTrigger(final ProcessContext context, final ProcessSession session) throws ProcessException { final File directory = new File(context.getProperty(DIRECTORY).evaluateAttributeExpressions().getValue()); final boolean keepingSourceFile = context.getProperty(KEEP_SOURCE_FILE).asBoolean(); - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); if (fileQueue.size() < 100) { final long pollingMillis = context.getProperty(POLLING_INTERVAL).asTimePeriod(TimeUnit.MILLISECONDS); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetFileTransfer.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetFileTransfer.java index 810a91e504..7347db1ce7 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetFileTransfer.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetFileTransfer.java @@ -43,7 +43,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -115,7 +115,7 @@ public abstract class GetFileTransfer extends AbstractProcessor { final long pollingIntervalMillis = context.getProperty(FileTransfer.POLLING_INTERVAL).asTimePeriod(TimeUnit.MILLISECONDS); final long nextPollTime = lastPollTime.get() + pollingIntervalMillis; BlockingQueue fileQueue = fileQueueRef.get(); - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); // dont do the listing if there are already 100 or more items in our queue // 100 is really just a magic number that seems to work out well in practice diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetHTTP.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetHTTP.java index 438e3b9cff..288d5da800 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetHTTP.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetHTTP.java @@ -81,7 +81,7 @@ import org.apache.nifi.components.state.StateMap; import org.apache.nifi.expression.AttributeExpression; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractSessionFactoryProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -307,7 +307,7 @@ public class GetHTTP extends AbstractSessionFactoryProcessor { @Override public void onTrigger(final ProcessContext context, final ProcessSessionFactory sessionFactory) throws ProcessException { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final ProcessSession session = sessionFactory.createSession(); final FlowFile incomingFlowFile = session.get(); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetJMSQueue.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetJMSQueue.java index 0ba7f98edb..09a79aa83a 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetJMSQueue.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetJMSQueue.java @@ -28,7 +28,7 @@ import org.apache.nifi.annotation.documentation.CapabilityDescription; import org.apache.nifi.annotation.documentation.SeeAlso; import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.annotation.lifecycle.OnStopped; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.exception.ProcessException; @@ -55,7 +55,7 @@ public class GetJMSQueue extends JmsConsumer { @Override public void onTrigger(final ProcessContext context, final ProcessSession session) throws ProcessException { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); WrappedMessageConsumer wrappedConsumer = consumerQueue.poll(); if (wrappedConsumer == null) { diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetJMSTopic.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetJMSTopic.java index 272c7abc44..2876e60537 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetJMSTopic.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/GetJMSTopic.java @@ -52,7 +52,7 @@ import org.apache.nifi.annotation.lifecycle.OnRemoved; import org.apache.nifi.annotation.lifecycle.OnScheduled; import org.apache.nifi.annotation.lifecycle.OnStopped; import org.apache.nifi.components.PropertyDescriptor; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.exception.ProcessException; @@ -323,7 +323,7 @@ public class GetJMSTopic extends JmsConsumer { @Override public void onTrigger(final ProcessContext context, final ProcessSession session) throws ProcessException { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); WrappedMessageConsumer consumer = this.wrappedConsumer; if (consumer == null || consumer.isClosed()) { diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HashAttribute.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HashAttribute.java index a0c603c177..e263705437 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HashAttribute.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HashAttribute.java @@ -42,7 +42,7 @@ import org.apache.nifi.annotation.documentation.CapabilityDescription; import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -191,7 +191,7 @@ public class HashAttribute extends AbstractProcessor { } final Map patterns = regexMapRef.get(); - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final SortedMap attributes = getRelevantAttributes(flowFile, patterns); if (attributes.size() != patterns.size()) { diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HashContent.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HashContent.java index 988559902a..d0e99f886f 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HashContent.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/HashContent.java @@ -37,7 +37,7 @@ import org.apache.nifi.annotation.documentation.CapabilityDescription; import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -118,7 +118,7 @@ public class HashContent extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final String algorithm = context.getProperty(HASH_ALGORITHM).getValue(); final MessageDigest digest; try { diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/IdentifyMimeType.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/IdentifyMimeType.java index d514722fc2..f4189c30c6 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/IdentifyMimeType.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/IdentifyMimeType.java @@ -33,7 +33,7 @@ import org.apache.nifi.annotation.documentation.CapabilityDescription; import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -116,7 +116,7 @@ public class IdentifyMimeType extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final ObjectHolder mimeTypeRef = new ObjectHolder<>(null); final String filename = flowFile.getAttribute(CoreAttributes.FILENAME.key()); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java index 4470bf6aaf..2552e9a15a 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java @@ -78,7 +78,7 @@ import org.apache.nifi.components.ValidationResult; import org.apache.nifi.expression.AttributeExpression; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -543,7 +543,7 @@ public final class InvokeHTTP extends AbstractProcessor { // Setting some initial variables final int maxAttributeSize = context.getProperty(PROP_PUT_ATTRIBUTE_MAX_LENGTH).asInteger(); - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); // Every request/response cycle has a unique transaction id which will be stored as a flowfile attribute. final UUID txId = UUID.randomUUID(); @@ -866,12 +866,12 @@ public final class InvokeHTTP extends AbstractProcessor { return statusCode / 100 == 2; } - private void logRequest(ProcessorLog logger, Request request) { + private void logRequest(ComponentLog logger, Request request) { logger.debug("\nRequest to remote service:\n\t{}\n{}", new Object[]{request.url().toExternalForm(), getLogString(request.headers().toMultimap())}); } - private void logResponse(ProcessorLog logger, URL url, Response response) { + private void logResponse(ComponentLog logger, URL url, Response response) { logger.debug("\nResponse from remote service:\n\t{}\n{}", new Object[]{url.toExternalForm(), getLogString(response.headers().toMultimap())}); } diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/JmsConsumer.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/JmsConsumer.java index ea70d52d71..0031c6a064 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/JmsConsumer.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/JmsConsumer.java @@ -49,7 +49,7 @@ import javax.jms.MessageConsumer; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -107,7 +107,7 @@ public abstract class JmsConsumer extends AbstractProcessor { } public void consume(final ProcessContext context, final ProcessSession session, final WrappedMessageConsumer wrappedConsumer) throws ProcessException { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final MessageConsumer consumer = wrappedConsumer.getConsumer(); final boolean clientAcknowledge = context.getProperty(ACKNOWLEDGEMENT_MODE).getValue().equalsIgnoreCase(ACK_MODE_CLIENT); @@ -177,7 +177,7 @@ public abstract class JmsConsumer extends AbstractProcessor { } } - public static JmsProcessingSummary map2FlowFile(final ProcessContext context, final ProcessSession session, final Message message, final boolean addAttributes, ProcessorLog logger) + public static JmsProcessingSummary map2FlowFile(final ProcessContext context, final ProcessSession session, final Message message, final boolean addAttributes, ComponentLog logger) throws Exception { // Currently not very useful, because always one Message == one FlowFile diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/LogAttribute.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/LogAttribute.java index 5cd5b14149..0aeff11a55 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/LogAttribute.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/LogAttribute.java @@ -37,7 +37,7 @@ import org.apache.nifi.annotation.behavior.SupportsBatching; import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -132,9 +132,9 @@ public class LogAttribute extends AbstractProcessor { return supportedDescriptors; } - protected String processFlowFile(final ProcessorLog logger, final DebugLevels logLevel, final FlowFile flowFile, final ProcessSession session, final ProcessContext context) { + protected String processFlowFile(final ComponentLog logger, final DebugLevels logLevel, final FlowFile flowFile, final ProcessSession session, final ProcessContext context) { final Set attributeKeys = getAttributesToLog(flowFile.getAttributes().keySet(), context); - final ProcessorLog LOG = getLogger(); + final ComponentLog LOG = getLogger(); final String dashedLine; String logPrefix = context.getProperty(LOG_PREFIX).evaluateAttributeExpressions(flowFile).getValue(); @@ -240,7 +240,7 @@ public class LogAttribute extends AbstractProcessor { throw new ProcessException(e); } - final ProcessorLog LOG = getLogger(); + final ComponentLog LOG = getLogger(); boolean isLogLevelEnabled = false; switch (logLevel) { case trace: diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ModifyBytes.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ModifyBytes.java index e0efa3d110..958096a139 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ModifyBytes.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ModifyBytes.java @@ -34,7 +34,7 @@ import org.apache.nifi.annotation.documentation.CapabilityDescription; import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.DataUnit; import org.apache.nifi.processor.ProcessContext; @@ -104,7 +104,7 @@ public class ModifyBytes extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final int startOffset = context.getProperty(START_OFFSET).asDataSize(DataUnit.B).intValue(); final int endOffset = context.getProperty(END_OFFSET).asDataSize(DataUnit.B).intValue(); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MonitorActivity.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MonitorActivity.java index 426b7926fd..9d4dbe538f 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MonitorActivity.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MonitorActivity.java @@ -43,7 +43,7 @@ import org.apache.nifi.annotation.lifecycle.OnScheduled; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -167,7 +167,7 @@ public class MonitorActivity extends AbstractProcessor { final long thresholdMillis = context.getProperty(THRESHOLD).asTimePeriod(TimeUnit.MILLISECONDS); final long now = System.currentTimeMillis(); - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final List flowFiles = session.get(50); if (flowFiles.isEmpty()) { final long previousSuccessMillis = latestSuccessTransfer.get(); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PostHTTP.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PostHTTP.java index 79d281512c..d3713a12cd 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PostHTTP.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PostHTTP.java @@ -94,7 +94,7 @@ import org.apache.nifi.components.ValidationContext; import org.apache.nifi.components.ValidationResult; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.DataUnit; import org.apache.nifi.processor.ProcessContext; @@ -455,7 +455,7 @@ public class PostHTTP extends AbstractProcessor { final RequestConfig requestConfig = requestConfigBuilder.build(); final StreamThrottler throttler = throttlerRef.get(); - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final Double maxBatchBytes = context.getProperty(MAX_BATCH_SIZE).asDataSize(DataUnit.B); String lastUrl = null; @@ -877,7 +877,7 @@ public class PostHTTP extends AbstractProcessor { } private DestinationAccepts getDestinationAcceptance(final boolean sendAsFlowFile, final HttpClient client, final String uri, - final ProcessorLog logger, final String transactionId) throws IOException { + final ComponentLog logger, final String transactionId) throws IOException { final HttpHead head = new HttpHead(uri); if (sendAsFlowFile) { head.addHeader(TRANSACTION_ID_HEADER, transactionId); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutDistributedMapCache.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutDistributedMapCache.java index 6e8950270c..180ff8e216 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutDistributedMapCache.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutDistributedMapCache.java @@ -44,7 +44,7 @@ import org.apache.nifi.distributed.cache.client.exception.DeserializationExcepti import org.apache.nifi.distributed.cache.client.exception.SerializationException; import org.apache.nifi.expression.AttributeExpression.ResultType; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.DataUnit; import org.apache.nifi.processor.ProcessContext; @@ -155,7 +155,7 @@ public class PutDistributedMapCache extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); // cache key is computed from attribute 'CACHE_ENTRY_IDENTIFIER' with expression language support final String cacheKey = context.getProperty(CACHE_ENTRY_IDENTIFIER).evaluateAttributeExpressions(flowFile).getValue(); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutEmail.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutEmail.java index e71f5aa46a..27534fe45c 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutEmail.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutEmail.java @@ -57,7 +57,7 @@ import org.apache.nifi.components.ValidationContext; import org.apache.nifi.components.ValidationResult; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -295,7 +295,7 @@ public class PutEmail extends AbstractProcessor { final Session mailSession = this.createMailSession(properties); final Message message = new MimeMessage(mailSession); - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); try { message.addFrom(toInetAddresses(context, flowFile, FROM)); @@ -384,7 +384,7 @@ public class PutEmail extends AbstractProcessor { final Properties properties = new Properties(); - final ProcessorLog logger = this.getLogger(); + final ComponentLog logger = this.getLogger(); for (Entry entry : propertyToContext.entrySet()) { diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFile.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFile.java index d32427e086..5cce470f27 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFile.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFile.java @@ -43,7 +43,7 @@ import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -183,7 +183,7 @@ public class PutFile extends AbstractProcessor { final Path configuredRootDirPath = Paths.get(context.getProperty(DIRECTORY).evaluateAttributeExpressions(flowFile).getValue()); final String conflictResponse = context.getProperty(CONFLICT_RESOLUTION).getValue(); final Integer maxDestinationFiles = context.getProperty(MAX_DESTINATION_FILES).asInteger(); - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); Path tempDotCopyFile = null; try { diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFileTransfer.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFileTransfer.java index c03f755ea7..8fb5996dec 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFileTransfer.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFileTransfer.java @@ -19,7 +19,7 @@ package org.apache.nifi.processors.standard; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; import org.apache.nifi.stream.io.BufferedInputStream; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -94,7 +94,7 @@ public abstract class PutFileTransfer extends AbstractPr return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final String hostname = context.getProperty(FileTransfer.HOSTNAME).evaluateAttributeExpressions(flowFile).getValue(); final int maxNumberOfFiles = context.getProperty(FileTransfer.BATCH_SIZE).asInteger(); @@ -187,7 +187,7 @@ public abstract class PutFileTransfer extends AbstractPr final String path, final FlowFile flowFile, final boolean rejectZeroByteFiles, - final ProcessorLog logger) + final ComponentLog logger) throws IOException { Relationship destinationRelationship = REL_SUCCESS; String fileName = flowFile.getAttribute(CoreAttributes.FILENAME.key()); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutJMS.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutJMS.java index c2cd35f47f..b72fa49ea3 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutJMS.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutJMS.java @@ -79,7 +79,7 @@ import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.annotation.lifecycle.OnStopped; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.DataUnit; import org.apache.nifi.processor.ProcessContext; @@ -160,7 +160,7 @@ public class PutJMS extends AbstractProcessor { @Override public void onTrigger(final ProcessContext context, final ProcessSession session) throws ProcessException { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final List flowFiles = session.get(context.getProperty(BATCH_SIZE).asInteger().intValue()); if (flowFiles.isEmpty()) { return; @@ -335,7 +335,7 @@ public class PutJMS extends AbstractProcessor { * @throws JMSException ex */ private void copyAttributesToJmsProps(final FlowFile flowFile, final Message message) throws JMSException { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final Map attributes = flowFile.getAttributes(); for (final Entry entry : attributes.entrySet()) { diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/QueryDatabaseTable.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/QueryDatabaseTable.java index 9403eb81d3..ec81446e9a 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/QueryDatabaseTable.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/QueryDatabaseTable.java @@ -31,7 +31,7 @@ import org.apache.nifi.components.state.StateManager; import org.apache.nifi.components.state.StateMap; import org.apache.nifi.dbcp.DBCPService; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractSessionFactoryProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -254,7 +254,7 @@ public class QueryDatabaseTable extends AbstractSessionFactoryProcessor { ProcessSession session = sessionFactory.createSession(); FlowFile fileToProcess = null; - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final DBCPService dbcpService = context.getProperty(DBCP_SERVICE).asControllerService(DBCPService.class); final String tableName = context.getProperty(TABLE_NAME).getValue(); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ReplaceText.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ReplaceText.java index 3cb7edae20..43a01c7182 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ReplaceText.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ReplaceText.java @@ -47,7 +47,7 @@ import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.components.Validator; import org.apache.nifi.expression.AttributeValueDecorator; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.DataUnit; import org.apache.nifi.processor.ProcessContext; @@ -206,7 +206,7 @@ public class ReplaceText extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final String unsubstitutedRegex = context.getProperty(SEARCH_VALUE).getValue(); String unsubstitutedReplacement = context.getProperty(REPLACEMENT_VALUE).getValue(); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ReplaceTextWithMapping.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ReplaceTextWithMapping.java index f68ac6c3c7..84aeb75563 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ReplaceTextWithMapping.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ReplaceTextWithMapping.java @@ -52,7 +52,7 @@ import org.apache.nifi.components.ValidationContext; import org.apache.nifi.components.ValidationResult; import org.apache.nifi.expression.AttributeValueDecorator; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.DataUnit; import org.apache.nifi.processor.ProcessContext; @@ -192,7 +192,7 @@ public class ReplaceTextWithMapping extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final int maxBufferSize = context.getProperty(MAX_BUFFER_SIZE).asDataSize(DataUnit.B).intValue(); @@ -236,7 +236,7 @@ public class ReplaceTextWithMapping extends AbstractProcessor { private void updateMapping(final ProcessContext context) { if (processorLock.tryLock()) { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); try { // if not queried mapping file lastUpdate time in // mapppingRefreshPeriodSecs, do so. diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RouteOnAttribute.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RouteOnAttribute.java index acfa3dd4d5..3a1ed9fe6c 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RouteOnAttribute.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RouteOnAttribute.java @@ -41,7 +41,7 @@ import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.components.PropertyValue; import org.apache.nifi.expression.AttributeExpression.ResultType; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -203,7 +203,7 @@ public class RouteOnAttribute extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final Map propMap = this.propertyMap; final Set matchingRelationships = new HashSet<>(); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RouteOnContent.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RouteOnContent.java index c63839c5ee..1bf235baa8 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RouteOnContent.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RouteOnContent.java @@ -41,7 +41,7 @@ import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.expression.AttributeValueDecorator; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.DataUnit; import org.apache.nifi.processor.ProcessContext; @@ -174,7 +174,7 @@ public class RouteOnContent extends AbstractProcessor { }; final Map> flowFileDestinationMap = new HashMap<>(); - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final Charset charset = Charset.forName(context.getProperty(CHARACTER_SET).getValue()); final byte[] buffer = new byte[context.getProperty(BUFFER_SIZE).asDataSize(DataUnit.B).intValue()]; diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RouteText.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RouteText.java index 0ed43b4c6f..01148f26e9 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RouteText.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RouteText.java @@ -54,7 +54,7 @@ import org.apache.nifi.components.ValidationResult; import org.apache.nifi.components.Validator; import org.apache.nifi.expression.AttributeExpression.ResultType; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -354,7 +354,7 @@ public class RouteText extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final Charset charset = Charset.forName(context.getProperty(CHARACTER_SET).getValue()); final boolean trim = context.getProperty(TRIM_WHITESPACE).asBoolean(); final String routeStrategy = context.getProperty(ROUTE_STRATEGY).getValue(); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ScanAttribute.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ScanAttribute.java index aa88827ac4..cd3d36ad6b 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ScanAttribute.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ScanAttribute.java @@ -42,7 +42,7 @@ import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.annotation.lifecycle.OnScheduled; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -195,7 +195,7 @@ public class ScanAttribute extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); try { if (fileWatcher.checkAndReset()) { this.dictionaryTerms = createDictionary(context); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ScanContent.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ScanContent.java index 6fe84463f2..59d1cbd455 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ScanContent.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ScanContent.java @@ -44,7 +44,7 @@ import org.apache.nifi.annotation.documentation.CapabilityDescription; import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -142,7 +142,7 @@ public class ScanContent extends AbstractProcessor { } } - private boolean reloadDictionary(final ProcessContext context, final boolean force, final ProcessorLog logger) throws IOException { + private boolean reloadDictionary(final ProcessContext context, final boolean force, final ComponentLog logger) throws IOException { boolean obtainedLock; if (force) { dictionaryUpdateLock.lock(); @@ -188,7 +188,7 @@ public class ScanContent extends AbstractProcessor { @Override public void onTrigger(final ProcessContext context, final ProcessSession session) throws ProcessException { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final SynchronousFileWatcher fileWatcher = fileWatcherRef.get(); try { if (fileWatcher.checkAndReset()) { diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitContent.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitContent.java index 3cdf7877e0..52b124e21a 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitContent.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitContent.java @@ -50,7 +50,7 @@ import org.apache.nifi.components.ValidationResult; import org.apache.nifi.components.Validator; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -187,7 +187,7 @@ public class SplitContent extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final boolean keepSequence = context.getProperty(KEEP_SEQUENCE).asBoolean(); final boolean keepTrailingSequence; final boolean keepLeadingSequence; diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitJson.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitJson.java index dfd09a25cd..58b3adc9f4 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitJson.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitJson.java @@ -39,7 +39,7 @@ import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.components.ValidationContext; import org.apache.nifi.components.ValidationResult; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.ProcessorInitializationContext; @@ -151,7 +151,7 @@ public class SplitJson extends AbstractJsonPathProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); DocumentContext documentContext = null; try { diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitText.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitText.java index 8c59d88288..39eb4e80fc 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitText.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitText.java @@ -43,7 +43,7 @@ import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -288,7 +288,7 @@ public class SplitText extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final int headerCount = context.getProperty(HEADER_LINE_COUNT).asInteger(); final int splitCount = context.getProperty(LINE_SPLIT_COUNT).asInteger(); final boolean removeTrailingNewlines = context.getProperty(REMOVE_TRAILING_NEWLINES).asBoolean(); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitXml.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitXml.java index b503f9bef5..055ffd84f3 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitXml.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/SplitXml.java @@ -42,7 +42,7 @@ import org.apache.nifi.annotation.documentation.CapabilityDescription; import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -143,7 +143,7 @@ public class SplitXml extends AbstractProcessor { } final int depth = context.getProperty(SPLIT_DEPTH).asInteger(); - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final List splits = new ArrayList<>(); final XmlSplitterSaxParser parser = new XmlSplitterSaxParser(new XmlElementNotifier() { diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/TransformXml.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/TransformXml.java index e77dfc6371..5c3c23ca16 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/TransformXml.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/TransformXml.java @@ -47,7 +47,7 @@ import org.apache.nifi.components.ValidationResult; import org.apache.nifi.components.Validator; import org.apache.nifi.expression.AttributeExpression; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -131,7 +131,7 @@ public class TransformXml extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final StopWatch stopWatch = new StopWatch(true); try { diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/UnpackContent.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/UnpackContent.java index 3443aea195..decbd547ba 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/UnpackContent.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/UnpackContent.java @@ -48,7 +48,7 @@ import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -161,7 +161,7 @@ public class UnpackContent extends AbstractProcessor { return; } - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); String packagingFormat = context.getProperty(PACKAGING_FORMAT).getValue().toLowerCase(); if (AUTO_DETECT_FORMAT.equals(packagingFormat)) { final String mimeType = flowFile.getAttribute(CoreAttributes.MIME_TYPE.key()); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ValidateXml.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ValidateXml.java index 3693590bad..4647028405 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ValidateXml.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ValidateXml.java @@ -41,7 +41,7 @@ import org.apache.nifi.annotation.documentation.Tags; import org.apache.nifi.annotation.lifecycle.OnScheduled; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -125,7 +125,7 @@ public class ValidateXml extends AbstractProcessor { final Schema schema = schemaRef.get(); final Validator validator = schema.newValidator(); - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); for (final FlowFile flowFile : flowFiles) { final BooleanHolder valid = new BooleanHolder(true); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/relp/handler/RELPFrameHandler.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/relp/handler/RELPFrameHandler.java index 7b879f3afa..dff8c84233 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/relp/handler/RELPFrameHandler.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/relp/handler/RELPFrameHandler.java @@ -16,7 +16,7 @@ */ package org.apache.nifi.processors.standard.relp.handler; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.util.listen.dispatcher.AsyncChannelDispatcher; import org.apache.nifi.processor.util.listen.event.Event; import org.apache.nifi.processor.util.listen.event.EventFactory; @@ -50,7 +50,7 @@ public class RELPFrameHandler> { private final EventQueue events; private final SelectionKey key; private final AsyncChannelDispatcher dispatcher; - private final ProcessorLog logger; + private final ComponentLog logger; private final RELPEncoder encoder; public RELPFrameHandler(final SelectionKey selectionKey, @@ -58,7 +58,7 @@ public class RELPFrameHandler> { final EventFactory eventFactory, final BlockingQueue events, final AsyncChannelDispatcher dispatcher, - final ProcessorLog logger) { + final ComponentLog logger) { this.key = selectionKey; this.charset = charset; this.eventFactory = eventFactory; diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/relp/handler/RELPSSLSocketChannelHandler.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/relp/handler/RELPSSLSocketChannelHandler.java index 30697ed8d6..9bb2548edb 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/relp/handler/RELPSSLSocketChannelHandler.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/relp/handler/RELPSSLSocketChannelHandler.java @@ -16,7 +16,7 @@ */ package org.apache.nifi.processors.standard.relp.handler; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.util.listen.dispatcher.AsyncChannelDispatcher; import org.apache.nifi.processor.util.listen.event.Event; import org.apache.nifi.processor.util.listen.event.EventFactory; @@ -47,7 +47,7 @@ public class RELPSSLSocketChannelHandler> extends final Charset charset, final EventFactory eventFactory, final BlockingQueue events, - final ProcessorLog logger) { + final ComponentLog logger) { super(key, dispatcher, charset, eventFactory, events, logger); this.decoder = new RELPDecoder(charset); this.frameHandler = new RELPFrameHandler<>(key, charset, eventFactory, events, dispatcher, logger); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/relp/handler/RELPSocketChannelHandler.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/relp/handler/RELPSocketChannelHandler.java index e3e84cfd19..7e7b7695bb 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/relp/handler/RELPSocketChannelHandler.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/relp/handler/RELPSocketChannelHandler.java @@ -16,7 +16,7 @@ */ package org.apache.nifi.processors.standard.relp.handler; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.util.listen.dispatcher.AsyncChannelDispatcher; import org.apache.nifi.processor.util.listen.event.Event; import org.apache.nifi.processor.util.listen.event.EventFactory; @@ -47,7 +47,7 @@ public class RELPSocketChannelHandler> extends St final Charset charset, final EventFactory eventFactory, final BlockingQueue events, - final ProcessorLog logger) { + final ComponentLog logger) { super(key, dispatcher, charset, eventFactory, events, logger); this.decoder = new RELPDecoder(charset); this.frameHandler = new RELPFrameHandler<>(key, charset, eventFactory, events, dispatcher, logger); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/relp/handler/RELPSocketChannelHandlerFactory.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/relp/handler/RELPSocketChannelHandlerFactory.java index 2299a6b40c..625219bcd8 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/relp/handler/RELPSocketChannelHandlerFactory.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/relp/handler/RELPSocketChannelHandlerFactory.java @@ -16,7 +16,7 @@ */ package org.apache.nifi.processors.standard.relp.handler; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.util.listen.dispatcher.AsyncChannelDispatcher; import org.apache.nifi.processor.util.listen.event.Event; import org.apache.nifi.processor.util.listen.event.EventFactory; @@ -39,7 +39,7 @@ public class RELPSocketChannelHandlerFactory> imp final Charset charset, final EventFactory eventFactory, final BlockingQueue events, - final ProcessorLog logger) { + final ComponentLog logger) { return new RELPSocketChannelHandler<>(key, dispatcher, charset, eventFactory, events, logger); } @@ -49,7 +49,7 @@ public class RELPSocketChannelHandlerFactory> imp final Charset charset, final EventFactory eventFactory, final BlockingQueue events, - final ProcessorLog logger) { + final ComponentLog logger) { return new RELPSSLSocketChannelHandler<>(key, dispatcher, charset, eventFactory, events, logger); } diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/servlets/ContentAcknowledgmentServlet.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/servlets/ContentAcknowledgmentServlet.java index 3252aea7f0..0faeec62f0 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/servlets/ContentAcknowledgmentServlet.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/servlets/ContentAcknowledgmentServlet.java @@ -31,7 +31,7 @@ import javax.servlet.http.HttpServletResponse; import javax.ws.rs.Path; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.Processor; import org.apache.nifi.processors.standard.ListenHTTP; @@ -46,7 +46,7 @@ public class ContentAcknowledgmentServlet extends HttpServlet { private Processor processor; private Pattern authorizedPattern; - private ProcessorLog logger; + private ComponentLog logger; private ConcurrentMap flowFileMap; @SuppressWarnings("unchecked") @@ -54,7 +54,7 @@ public class ContentAcknowledgmentServlet extends HttpServlet { public void init(final ServletConfig config) throws ServletException { final ServletContext context = config.getServletContext(); this.processor = (Processor) context.getAttribute(ListenHTTP.CONTEXT_ATTRIBUTE_PROCESSOR); - this.logger = (ProcessorLog) context.getAttribute(ListenHTTP.CONTEXT_ATTRIBUTE_LOGGER); + this.logger = (ComponentLog) context.getAttribute(ListenHTTP.CONTEXT_ATTRIBUTE_LOGGER); this.authorizedPattern = (Pattern) context.getAttribute(ListenHTTP.CONTEXT_ATTRIBUTE_AUTHORITY_PATTERN); this.flowFileMap = (ConcurrentMap) context.getAttribute(ListenHTTP.CONTEXT_ATTRIBUTE_FLOWFILE_MAP); } diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/servlets/ListenHTTPServlet.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/servlets/ListenHTTPServlet.java index d740f932d5..24cfe1d8cf 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/servlets/ListenHTTPServlet.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/servlets/ListenHTTPServlet.java @@ -47,7 +47,7 @@ import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; import org.apache.nifi.stream.io.BufferedOutputStream; import org.apache.nifi.stream.io.StreamThrottler; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.ProcessSessionFactory; @@ -87,7 +87,7 @@ public class ListenHTTPServlet extends HttpServlet { private final AtomicLong filesReceived = new AtomicLong(0L); private final AtomicBoolean spaceAvailable = new AtomicBoolean(true); - private ProcessorLog logger; + private ComponentLog logger; private AtomicReference sessionFactoryHolder; private volatile ProcessContext processContext; private Pattern authorizedPattern; @@ -100,7 +100,7 @@ public class ListenHTTPServlet extends HttpServlet { @Override public void init(final ServletConfig config) throws ServletException { final ServletContext context = config.getServletContext(); - this.logger = (ProcessorLog) context.getAttribute(ListenHTTP.CONTEXT_ATTRIBUTE_LOGGER); + this.logger = (ComponentLog) context.getAttribute(ListenHTTP.CONTEXT_ATTRIBUTE_LOGGER); this.sessionFactoryHolder = (AtomicReference) context.getAttribute(ListenHTTP.CONTEXT_ATTRIBUTE_SESSION_FACTORY_HOLDER); this.processContext = (ProcessContext) context.getAttribute(ListenHTTP.CONTEXT_ATTRIBUTE_PROCESS_CONTEXT_HOLDER); this.authorizedPattern = (Pattern) context.getAttribute(ListenHTTP.CONTEXT_ATTRIBUTE_AUTHORITY_PATTERN); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/FTPTransfer.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/FTPTransfer.java index a038eb7c50..3baf657a3f 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/FTPTransfer.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/FTPTransfer.java @@ -40,7 +40,7 @@ import org.apache.commons.net.ftp.FTPHTTPClient; import org.apache.commons.net.ftp.FTPReply; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.exception.ProcessException; import org.apache.nifi.processor.util.StandardValidators; @@ -105,7 +105,7 @@ public class FTPTransfer implements FileTransfer { .sensitive(true) .build(); - private final ProcessorLog logger; + private final ComponentLog logger; private final ProcessContext ctx; private boolean closed = true; @@ -113,7 +113,7 @@ public class FTPTransfer implements FileTransfer { private String homeDirectory; private String remoteHostName; - public FTPTransfer(final ProcessContext context, final ProcessorLog logger) { + public FTPTransfer(final ProcessContext context, final ComponentLog logger) { this.ctx = context; this.logger = logger; } diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java index 9bad52073c..3a88862b7b 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java @@ -36,7 +36,7 @@ import java.util.regex.Pattern; import org.apache.nifi.components.PropertyDescriptor; import org.apache.nifi.components.PropertyValue; import org.apache.nifi.flowfile.FlowFile; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.util.StandardValidators; import org.slf4j.LoggerFactory; @@ -107,7 +107,7 @@ public class SFTPTransfer implements FileTransfer { .defaultValue("false") .build(); - private final ProcessorLog logger; + private final ComponentLog logger; private final ProcessContext ctx; private Session session; @@ -117,7 +117,7 @@ public class SFTPTransfer implements FileTransfer { private final boolean disableDirectoryListing; - public SFTPTransfer(final ProcessContext processContext, final ProcessorLog logger) { + public SFTPTransfer(final ProcessContext processContext, final ComponentLog logger) { this.ctx = processContext; this.logger = logger; diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/UDPStreamConsumer.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/UDPStreamConsumer.java index 38f8add557..e159bdd05d 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/UDPStreamConsumer.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/UDPStreamConsumer.java @@ -31,7 +31,7 @@ import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.stream.io.BufferedOutputStream; import org.apache.nifi.io.nio.BufferPool; import org.apache.nifi.io.nio.consumer.StreamConsumer; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.ProcessSession; import org.apache.nifi.processor.io.OutputStreamCallback; @@ -44,7 +44,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder; */ public class UDPStreamConsumer implements StreamConsumer { - private final ProcessorLog logger; + private final ComponentLog logger; final List newFlowFileQueue; private final String uniqueId; private BufferPool bufferPool = null; @@ -54,7 +54,7 @@ public class UDPStreamConsumer implements StreamConsumer { private ProcessSession session; private final UDPConsumerCallback udpCallback; - public UDPStreamConsumer(final String streamId, final List newFlowFiles, final long fileSizeTrigger, final ProcessorLog logger, + public UDPStreamConsumer(final String streamId, final List newFlowFiles, final long fileSizeTrigger, final ComponentLog logger, final boolean flowFilePerDatagram) { this.uniqueId = streamId; this.newFlowFileQueue = newFlowFiles; diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/WrappedMessageConsumer.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/WrappedMessageConsumer.java index fca6a70c5d..cc33184807 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/WrappedMessageConsumer.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/WrappedMessageConsumer.java @@ -21,7 +21,7 @@ import javax.jms.JMSException; import javax.jms.MessageConsumer; import javax.jms.Session; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; public class WrappedMessageConsumer { @@ -49,7 +49,7 @@ public class WrappedMessageConsumer { return consumer; } - public void close(final ProcessorLog logger) { + public void close(final ComponentLog logger) { closed = true; try { diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/WrappedMessageProducer.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/WrappedMessageProducer.java index fc01b02ce4..49e586da85 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/WrappedMessageProducer.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/WrappedMessageProducer.java @@ -21,7 +21,7 @@ import javax.jms.JMSException; import javax.jms.MessageProducer; import javax.jms.Session; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; public class WrappedMessageProducer { @@ -49,7 +49,7 @@ public class WrappedMessageProducer { return producer; } - public void close(final ProcessorLog logger) { + public void close(final ComponentLog logger) { closed = true; try { diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestDetectDuplicate.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestDetectDuplicate.java index 0d7394ec07..b23d56b281 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestDetectDuplicate.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestDetectDuplicate.java @@ -32,7 +32,7 @@ import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.reporting.InitializationException; import org.apache.nifi.state.MockStateManager; import org.apache.nifi.util.MockControllerServiceInitializationContext; -import org.apache.nifi.util.MockProcessorLog; +import org.apache.nifi.util.MockComponentLog; import org.apache.nifi.util.TestRunner; import org.apache.nifi.util.TestRunners; import org.junit.Test; @@ -103,7 +103,7 @@ public class TestDetectDuplicate { private DistributedMapCacheClientImpl createClient() throws InitializationException { final DistributedMapCacheClientImpl client = new DistributedMapCacheClientImpl(); - final ComponentLog logger = new MockProcessorLog("client", client); + final ComponentLog logger = new MockComponentLog("client", client); final MockControllerServiceInitializationContext clientInitContext = new MockControllerServiceInitializationContext(client, "client", logger, new MockStateManager(client)); client.initialize(clientInitContext); diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/relp/handler/TestRELPFrameHandler.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/relp/handler/TestRELPFrameHandler.java index 892fb8e1f6..46cd3ef9b4 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/relp/handler/TestRELPFrameHandler.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/relp/handler/TestRELPFrameHandler.java @@ -16,7 +16,7 @@ */ package org.apache.nifi.processors.standard.relp.handler; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.util.listen.dispatcher.AsyncChannelDispatcher; import org.apache.nifi.processor.util.listen.event.EventFactory; import org.apache.nifi.processor.util.listen.response.ChannelResponder; @@ -46,7 +46,7 @@ public class TestRELPFrameHandler { private BlockingQueue events; private SelectionKey key; private AsyncChannelDispatcher dispatcher; - private ProcessorLog logger; + private ComponentLog logger; private RELPFrameHandler frameHandler; @@ -57,7 +57,7 @@ public class TestRELPFrameHandler { this.events = new LinkedBlockingQueue<>(); this.key = Mockito.mock(SelectionKey.class); this.dispatcher = Mockito.mock(AsyncChannelDispatcher.class); - this.logger = Mockito.mock(ProcessorLog.class); + this.logger = Mockito.mock(ComponentLog.class); this.frameHandler = new RELPFrameHandler<>(key, charset, eventFactory, events, dispatcher, logger); } diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/relp/handler/TestRELPSocketChannelHandler.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/relp/handler/TestRELPSocketChannelHandler.java index 0bec3ed7c6..4ac1fb76df 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/relp/handler/TestRELPSocketChannelHandler.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/relp/handler/TestRELPSocketChannelHandler.java @@ -17,7 +17,7 @@ package org.apache.nifi.processors.standard.relp.handler; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.util.listen.dispatcher.AsyncChannelDispatcher; import org.apache.nifi.processor.util.listen.dispatcher.ChannelDispatcher; import org.apache.nifi.processor.util.listen.dispatcher.SocketChannelDispatcher; @@ -50,7 +50,7 @@ public class TestRELPSocketChannelHandler { private ChannelHandlerFactory channelHandlerFactory; private BlockingQueue byteBuffers; private BlockingQueue events; - private ProcessorLog logger = Mockito.mock(ProcessorLog.class); + private ComponentLog logger = Mockito.mock(ComponentLog.class); private int maxConnections; private SSLContext sslContext; private Charset charset; @@ -65,7 +65,7 @@ public class TestRELPSocketChannelHandler { byteBuffers.add(ByteBuffer.allocate(4096)); events = new LinkedBlockingQueue<>(); - logger = Mockito.mock(ProcessorLog.class); + logger = Mockito.mock(ComponentLog.class); maxConnections = 1; sslContext = null; diff --git a/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-processor/src/main/java/org/apache/nifi/processors/attributes/UpdateAttribute.java b/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-processor/src/main/java/org/apache/nifi/processors/attributes/UpdateAttribute.java index cff2b559b7..d267bf71b3 100644 --- a/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-processor/src/main/java/org/apache/nifi/processors/attributes/UpdateAttribute.java +++ b/nifi-nar-bundles/nifi-update-attribute-bundle/nifi-update-attribute-processor/src/main/java/org/apache/nifi/processors/attributes/UpdateAttribute.java @@ -49,7 +49,7 @@ import org.apache.nifi.components.Validator; import org.apache.nifi.expression.AttributeExpression; import org.apache.nifi.flowfile.FlowFile; import org.apache.nifi.flowfile.attributes.CoreAttributes; -import org.apache.nifi.logging.ProcessorLog; +import org.apache.nifi.logging.ComponentLog; import org.apache.nifi.processor.AbstractProcessor; import org.apache.nifi.processor.ProcessContext; import org.apache.nifi.processor.ProcessSession; @@ -332,7 +332,7 @@ public class UpdateAttribute extends AbstractProcessor implements Searchable { @Override public void onTrigger(final ProcessContext context, final ProcessSession session) { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final Criteria criteria = criteriaCache.get(); List flowFiles = session.get(100); @@ -385,7 +385,7 @@ public class UpdateAttribute extends AbstractProcessor implements Searchable { //Evaluates the specified Criteria on the specified flowfile. Clones the // specified flow file for each rule that is applied. private boolean evaluateCriteria(final ProcessSession session, final ProcessContext context, final Criteria criteria, final FlowFile flowfile, final Map> matchedRules) { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final List rules = criteria.getRules(); // consider each rule and hold a copy of the flowfile for each matched rule @@ -459,7 +459,7 @@ public class UpdateAttribute extends AbstractProcessor implements Searchable { // Executes the specified action on the specified flowfile. private FlowFile executeActions(final ProcessSession session, final ProcessContext context, final List rules, final Map defaultActions, final FlowFile flowfile) { - final ProcessorLog logger = getLogger(); + final ComponentLog logger = getLogger(); final Map actions = new HashMap<>(defaultActions); final String ruleName = (rules == null || rules.isEmpty()) ? "default" : rules.get(rules.size() - 1).getName();