Return-Path:
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor},
* {@link org.apache.nifi.controller.ControllerService ControllerService}, or
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask}
* implementation can use to indicate a method
* should be called whenever the component is added to the flow. This method
* will be called once for the entire life of a component instance.
- *
+ *
+ * Methods with this annotation are called without any arguments, as all settings
+ * and properties can be assumed to be the defaults.
+ *
* If any method annotated with this annotation throws a Throwable, the component
* will not be added to the flow.
- *
+ *
+ * Marker annotation a {@link org.apache.nifi.controller.ControllerService ControllerService}
+ * can use to indicate a method should be called whenever the service is disabled.
+ *
- * Methods using this annotation must take no arguments. If a method with this annotation
- * throws a Throwable, a log message and bulletin will be issued for the component, but
- * the component will still be disabled.
+ * Methods using this annotation are permitted to take zero arguments or to take a single
+ * argument of type {@link ConfigurationContext}. If a method with this annotation
+ * throws a Throwable, a log message and bulletin will be issued for the service, and the
+ * service will remain in a 'DISABLING' state. When this occurs, the method with this annotation
+ * will be called again after some period of time. This will continue until the method returns
+ * without throwing any Throwable. Until that time, the service will remain in a 'DISABLING' state
+ * and cannot be enabled again.
+ *
+ * Note that this annotation will be ignored if applied to a ReportingTask or Processor. For a Controller
+ * Service, enabling and disabling are considered lifecycle events, as the action makes them usable or
+ * unusable by other components. However, for a Processor and a Reporting
+ * Task, these are not lifecycle events but rather a mechanism to allow a component to be excluded when
+ * starting or stopping a group of components.
*
- * Marker annotation a {@link org.apache.nifi.processor.Processor Processor},
- * {@link org.apache.nifi.controller.ControllerService ControllerService} or
- * {@link org.apache.nifi.reporting.ReportingTask ReportingTask}
- * can use to indicate a method should be called whenever the component is enabled.
- * Any method that has this annotation will be called every time a user enables the component.
+ * Marker annotation a {@link org.apache.nifi.controller.ControllerService ControllerService}
+ * can use to indicate a method should be called whenever the service is enabled.
+ * Any method that has this annotation will be called every time a user enables the service.
* Additionally, each time that NiFi is restarted, if NiFi is configured to "auto-resume state"
- * and the component is enabled (whether stopped or running), the method will be invoked.
+ * and the service is enabled, the method will be invoked.
*
- * Methods using this annotation must take either 0 arguments or a single argument.
+ * Methods using this annotation must take either 0 arguments or a single argument of type
+ * {@link org.apache.nifi.controller.ConfigurationContext ConfigurationContext}.
*
- * If using 1 argument and the component using the annotation is a Processor, that argument must
- * be of type {@link org.apache.nifi.processor.ProcessContext ProcessContext}.
- *
- * If using 1 argument and the component using the annotation is a Reporting Task or Controller Service,
- * that argument must be of type {@link org.apache.nifi.controller.ConfigurationContext ConfigurationContext}.
+ * If a method with this annotation throws a Throwable, a log message and bulletin will be issued
+ * for the component. In this event, the service will remain in an 'ENABLING' state and will not be
+ * usable. All methods with this annotation will then be called again after a delay. The service will
+ * not be made available for use until all methods with this annotation have returned without throwing
+ * anything.
*
- * If a method with this annotation throws a Throwable, a log message and bulletin will be issued
- * for the component, but the component will still be enabled.
+ * Note that this annotation will be ignored if applied to a ReportingTask or Processor. For a Controller
+ * Service, enabling and disabling are considered lifecycle events, as the action makes them usable or
+ * unusable by other components. However, for a Processor and a Reporting
+ * Task, these are not lifecycle events but rather a mechanism to allow a component to be excluded when
+ * starting or stopping a group of components.
*
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor},
* {@link org.apache.nifi.controller.ControllerService ControllerService}, or
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask} implementation
@@ -32,7 +36,15 @@ import java.lang.annotation.Target;
* component instance. If the method throw any Throwable, that Throwable will be
* caught and logged but will not prevent subsequent methods with this annotation
* or removal of the component from the flow.
- *
+ *
+ * Methods with this annotation are permitted to take no arguments or to take a single
+ * argument. If using a single argument, that argument must be of type {@link ConfigurationContext}
+ * if the component is a ReportingTask or a ControllerService. If the component is a Processor,
+ * then the argument must be of type {@link ProcessContext}.
+ *
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor},
* {@link org.apache.nifi.controller.ControllerService ControllerService}, or
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask} implementation
@@ -31,7 +35,14 @@ import java.lang.annotation.Target;
* This will be called at most once for each component in a JVM lifetime.
* It is not, however, guaranteed that this method will be called on shutdown, as
* the service may be killed suddenly.
- *
+ *
+ * Methods with this annotation are permitted to take either 0 or 1 argument. If an argument
+ * is used, it must be of type {@link ConfigurationContext} if the component is a ReportingTask
+ * or Controller Service, or of type {@link ProcessContext} if the component is a Processor.
+ *
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor} or
@@ -47,6 +50,12 @@ import java.lang.annotation.Target;
* longer scheduled to run (as opposed to after all threads have returned from the
*
+ * Methods with this annotation are permitted to take either 0 or 1 argument. If an argument
+ * is used, it must be of type {@link ConfigurationContext} if the component is a ReportingTask
+ * or of type {@link ProcessContext} if the component is a Processor.
+ * onTrigger
method), see the {@link OnUnscheduled} annotation.
*
false
+ * if the component is to be considered valid even if the given Controller Service is referenced
+ * and is invalid.
+ * @param service
+ */
+ boolean isValidationRequired(ControllerService service);
+
+ /**
* Returns true
if the given value contains a NiFi Expression Language expression,
* false
if it does not
*
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-api/src/main/java/org/apache/nifi/controller/AbstractControllerService.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/controller/AbstractControllerService.java b/nifi/nifi-api/src/main/java/org/apache/nifi/controller/AbstractControllerService.java
index c12f2f8..71cdd23 100644
--- a/nifi/nifi-api/src/main/java/org/apache/nifi/controller/AbstractControllerService.java
+++ b/nifi/nifi-api/src/main/java/org/apache/nifi/controller/AbstractControllerService.java
@@ -22,6 +22,7 @@ import org.apache.nifi.components.AbstractConfigurableComponent;
import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.components.PropertyValue;
import org.apache.nifi.controller.annotation.OnConfigured;
+import org.apache.nifi.logging.ComponentLog;
import org.apache.nifi.processor.ProcessorInitializationContext;
import org.apache.nifi.reporting.InitializationException;
@@ -30,11 +31,13 @@ public abstract class AbstractControllerService extends AbstractConfigurableComp
private String identifier;
private ControllerServiceLookup serviceLookup;
private volatile ConfigurationContext configContext;
-
+ private ComponentLog logger;
+
@Override
public final void initialize(final ControllerServiceInitializationContext context) throws InitializationException {
this.identifier = context.getIdentifier();
serviceLookup = context.getControllerServiceLookup();
+ logger = context.getLogger();
init(context);
}
@@ -88,4 +91,12 @@ public abstract class AbstractControllerService extends AbstractConfigurableComp
*/
protected void init(final ControllerServiceInitializationContext config) throws InitializationException {
}
+
+ /**
+ * Returns the logger that has been provided to the component by the framework in its initialize method.
+ * @return
+ */
+ protected ComponentLog getLogger() {
+ return logger;
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-api/src/main/java/org/apache/nifi/controller/ControllerServiceInitializationContext.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/controller/ControllerServiceInitializationContext.java b/nifi/nifi-api/src/main/java/org/apache/nifi/controller/ControllerServiceInitializationContext.java
index b5b0412..d34c635 100644
--- a/nifi/nifi-api/src/main/java/org/apache/nifi/controller/ControllerServiceInitializationContext.java
+++ b/nifi/nifi-api/src/main/java/org/apache/nifi/controller/ControllerServiceInitializationContext.java
@@ -16,6 +16,8 @@
*/
package org.apache.nifi.controller;
+import org.apache.nifi.logging.ComponentLog;
+
public interface ControllerServiceInitializationContext {
/**
@@ -33,4 +35,12 @@ public interface ControllerServiceInitializationContext {
* @return
*/
ControllerServiceLookup getControllerServiceLookup();
+
+ /**
+ * Returns a logger that can be used to log important events in a standard way and generate
+ * bulletins when appropriate
+ *
+ * @return
+ */
+ ComponentLog getLogger();
}
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-api/src/main/java/org/apache/nifi/controller/ControllerServiceLookup.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/controller/ControllerServiceLookup.java b/nifi/nifi-api/src/main/java/org/apache/nifi/controller/ControllerServiceLookup.java
index 77b8e62..4b96f62 100644
--- a/nifi/nifi-api/src/main/java/org/apache/nifi/controller/ControllerServiceLookup.java
+++ b/nifi/nifi-api/src/main/java/org/apache/nifi/controller/ControllerServiceLookup.java
@@ -42,6 +42,18 @@ public interface ControllerServiceLookup {
boolean isControllerServiceEnabled(String serviceIdentifier);
/**
+ * Returns true
if the Controller Service with the given
+ * identifier has been enabled but is still in the transitioning state,
+ * otherwise returns false
.
+ * If the given identifier is not known by this ControllerServiceLookup,
+ * returns false
.
+ *
+ * @param serviceIdentifier
+ * @return
+ */
+ boolean isControllerServiceEnabling(String serviceIdentifier);
+
+ /**
* Returns true
if the given Controller Service is enabled,
* false
otherwise. If the given Controller Service is not
* known by this ControllerServiceLookup, returns false
@@ -63,4 +75,11 @@ public interface ControllerServiceLookup {
*/
Set+ * The ComponentLog provides a mechanism to ensure that all NiFi components are logging and reporting + * information in a consistent way. When messages are logged to the ComponentLog, each message has the + * following characteristics: + *
+ * + *toString()
of the component is automatically prepended to the message so that it is clear
+ * which component is providing the information. This is important, since a single component may have many
+ * different instances within the same NiFi instance.
+ * toString()
of the Throwable; in addition, if the component's logger is set to
+ * DEBUG level via the logback configuration, the Stacktrace will also be logged. This provides a mechanism to easily
+ * enable stacktraces in the logs when they are desired without filling the logs with unneeded stack traces for messages
+ * that end up occurring often.
+ *
+ * <CN=original-proxied-entity><CN=first-proxy><CN=second-proxy>...
+ *
+ *
+ * @return the proxied entities chain or null if no chain
+ */
+ String getProxiedEntitiesChain();
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-api/src/main/java/org/apache/nifi/web/ProcessorConfigurationAction.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/web/ProcessorConfigurationAction.java b/nifi/nifi-api/src/main/java/org/apache/nifi/web/ProcessorConfigurationAction.java
index 8385e4a..ce5e069 100644
--- a/nifi/nifi-api/src/main/java/org/apache/nifi/web/ProcessorConfigurationAction.java
+++ b/nifi/nifi-api/src/main/java/org/apache/nifi/web/ProcessorConfigurationAction.java
@@ -19,6 +19,7 @@ package org.apache.nifi.web;
/**
*
*/
+@Deprecated
public class ProcessorConfigurationAction {
private final String processorId;
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-api/src/main/java/org/apache/nifi/web/ProcessorInfo.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/web/ProcessorInfo.java b/nifi/nifi-api/src/main/java/org/apache/nifi/web/ProcessorInfo.java
index 0481098..e87e73e 100644
--- a/nifi/nifi-api/src/main/java/org/apache/nifi/web/ProcessorInfo.java
+++ b/nifi/nifi-api/src/main/java/org/apache/nifi/web/ProcessorInfo.java
@@ -22,6 +22,7 @@ import java.util.Map;
/**
*
*/
+@Deprecated
public class ProcessorInfo {
private final String id;
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-api/src/main/java/org/apache/nifi/web/Revision.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/web/Revision.java b/nifi/nifi-api/src/main/java/org/apache/nifi/web/Revision.java
index 1881c2f..8a6275e 100644
--- a/nifi/nifi-api/src/main/java/org/apache/nifi/web/Revision.java
+++ b/nifi/nifi-api/src/main/java/org/apache/nifi/web/Revision.java
@@ -37,12 +37,12 @@ public class Revision implements Serializable {
* the client ID
*/
private final String clientId;
-
+
public Revision(Long revision, String clientId) {
this.version = revision;
this.clientId = clientId;
}
-
+
public String getClientId() {
return clientId;
}
@@ -51,34 +51,6 @@ public class Revision implements Serializable {
return version;
}
- /**
- * A factory method for creating a new Revision instance whose version is
- * this instance's version plus 1.
- *
- * @return an updated revision
- */
- public Revision increment() {
- final long incrementedVersion;
- if (version == null) {
- incrementedVersion = 0;
- } else {
- incrementedVersion = version + 1;
- }
- return new Revision(incrementedVersion, clientId);
- }
-
- /**
- * A factory method for creating a new Revision instance whose version is
- * this instance's version plus 1 and whose client ID is the given client
- * ID.
- *
- * @param clientId the client ID
- * @return an updated revision
- */
- public Revision increment(String clientId) {
- return new Revision(increment().getVersion(), clientId);
- }
-
@Override
public boolean equals(final Object obj) {
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-api/src/main/java/org/apache/nifi/web/UiExtensionType.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-api/src/main/java/org/apache/nifi/web/UiExtensionType.java b/nifi/nifi-api/src/main/java/org/apache/nifi/web/UiExtensionType.java
new file mode 100644
index 0000000..0bbda16
--- /dev/null
+++ b/nifi/nifi-api/src/main/java/org/apache/nifi/web/UiExtensionType.java
@@ -0,0 +1,31 @@
+/*
+ * 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.web;
+
+/**
+ * Types of UI extensions. Since a UI extension could support multiple
+ * types of custom UIs it will need to include the type so the framework
+ * can appropriate understand and process the request (recording actions
+ * in the audit database, replicating a request throughout the cluster to
+ * the appropriate endpoints, etc).
+ */
+public enum UiExtensionType {
+ ContentViewer,
+ ProcessorConfiguration,
+ ControllerServiceConfiguration,
+ ReportingTaskConfiguration
+}
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/e9647717/nifi/nifi-assembly/pom.xml
----------------------------------------------------------------------
diff --git a/nifi/nifi-assembly/pom.xml b/nifi/nifi-assembly/pom.xml
index cae0f00..a26f214 100644
--- a/nifi/nifi-assembly/pom.xml
+++ b/nifi/nifi-assembly/pom.xml
@@ -187,8 +187,6 @@