This is an automated email from the ASF dual-hosted git repository.
exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-api.git
The following commit(s) were added to refs/heads/main by this push:
new ee7b135 NIFI-15443 Add support for migrateProperties in Registry
Clients and Parameter Providers (#44)
ee7b135 is described below
commit ee7b135114e6e700b947bada72be4b611017b5ea
Author: Pierre Villard <[email protected]>
AuthorDate: Fri Jan 16 16:36:12 2026 +0100
NIFI-15443 Add support for migrateProperties in Registry Clients and
Parameter Providers (#44)
Signed-off-by: David Handermann <[email protected]>
---
.../org/apache/nifi/parameter/ParameterProvider.java | 18 ++++++++++++++++++
.../apache/nifi/registry/flow/FlowRegistryClient.java | 18 ++++++++++++++++++
2 files changed, 36 insertions(+)
diff --git a/src/main/java/org/apache/nifi/parameter/ParameterProvider.java
b/src/main/java/org/apache/nifi/parameter/ParameterProvider.java
index 7179bfb..f97d529 100644
--- a/src/main/java/org/apache/nifi/parameter/ParameterProvider.java
+++ b/src/main/java/org/apache/nifi/parameter/ParameterProvider.java
@@ -19,6 +19,7 @@ package org.apache.nifi.parameter;
import org.apache.nifi.annotation.lifecycle.OnConfigurationRestored;
import org.apache.nifi.components.ConfigurableComponent;
import org.apache.nifi.controller.ConfigurationContext;
+import org.apache.nifi.migration.PropertyConfiguration;
import org.apache.nifi.reporting.InitializationException;
import java.io.IOException;
@@ -84,4 +85,21 @@ public interface ParameterProvider extends
ConfigurableComponent {
* @throws IOException if there is an I/O problem while fetching the
Parameters
*/
List<ParameterGroup> fetchParameters(ConfigurationContext context) throws
IOException;
+
+ /**
+ * <p>
+ * Allows for the migration of an old property configuration to a new
configuration. This allows the Parameter Provider to evolve over time,
+ * as it allows properties to be renamed, removed, or reconfigured.
+ * </p>
+ *
+ * <p>
+ * This method is called only when a Parameter Provider is restored from a
previous configuration. For example, when NiFi is restarted and the
+ * flow is restored from disk, or when a node joins a cluster and inherits
a flow that has a new Parameter Provider. Once called, the method
+ * will not be invoked again for this Parameter Provider until NiFi is
restarted.
+ * </p>
+ *
+ * @param config the current property configuration
+ */
+ default void migrateProperties(PropertyConfiguration config) {
+ }
}
diff --git
a/src/main/java/org/apache/nifi/registry/flow/FlowRegistryClient.java
b/src/main/java/org/apache/nifi/registry/flow/FlowRegistryClient.java
index 76845c6..2f7d467 100644
--- a/src/main/java/org/apache/nifi/registry/flow/FlowRegistryClient.java
+++ b/src/main/java/org/apache/nifi/registry/flow/FlowRegistryClient.java
@@ -17,6 +17,7 @@
package org.apache.nifi.registry.flow;
import org.apache.nifi.components.ConfigurableComponent;
+import org.apache.nifi.migration.PropertyConfiguration;
import java.io.IOException;
import java.util.Optional;
@@ -284,4 +285,21 @@ public interface FlowRegistryClient extends
ConfigurableComponent {
return UUID.randomUUID().toString();
}
+ /**
+ * <p>
+ * Allows for the migration of an old property configuration to a new
configuration. This allows the Flow Registry Client to evolve over time,
+ * as it allows properties to be renamed, removed, or reconfigured.
+ * </p>
+ *
+ * <p>
+ * This method is called only when a Flow Registry Client is restored from
a previous configuration. For example, when NiFi is restarted and the
+ * flow is restored from disk, or when a node joins a cluster and inherits
a flow that has a new Flow Registry Client. Once called, the method
+ * will not be invoked again for this Flow Registry Client until NiFi is
restarted.
+ * </p>
+ *
+ * @param config the current property configuration
+ */
+ default void migrateProperties(PropertyConfiguration config) {
+ }
+
}