markap14 commented on code in PR #88:
URL: https://github.com/apache/nifi-api/pull/88#discussion_r3243554215
##########
src/main/java/org/apache/nifi/components/connector/Connector.java:
##########
@@ -78,6 +79,48 @@ public interface Connector {
*/
VersionedExternalFlow getInitialFlow();
+ /**
+ * Indicates whether this Connector can be migrated from the provided
source flow.
+ *
+ * <p>
+ * Implementations should inspect the source flow structure and metadata
using {@link ConnectorMigrationContext#getSourceFlow()}
+ * and return quickly without mutating the Connector or the source flow.
This method must not call
+ * {@link ConnectorMigrationContext#copyAssetFromSource(String)}.
+ * </p>
+ *
+ * @param context the migration context describing the source flow and
target Connector
+ * @return {@code true} when this Connector can be migrated from the
provided source flow
+ */
+ default boolean isMigrationSupported(ConnectorMigrationContext context) {
+ return false;
+ }
+
+ /**
+ * Migrates this Connector by updating its own managed flow to mirror the
configuration, parameters, and component
Review Comment:
Yeah good point, we should update the docs to be very clear here. We will
support the migration ONLY for a new connector that's not been configured or
started. So because of this, we don't need to go through the `prepareForUpdate`
/ `applyUpdate` phases because we're not transitioning into a state where it's
safe to apply the changes, we're requiring that we already be there. Will
clarify this on the JavaDoc.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]