Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/main/java/org/apache/nifi/parameter/ParameterProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
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;
Expand Down Expand Up @@ -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) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -284,4 +285,21 @@ default String generateFlowId(final String flowName) {
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) {
}

}