markap14 commented on code in PR #88:
URL: https://github.com/apache/nifi-api/pull/88#discussion_r3243809782
##########
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) {
Review Comment:
Yeah, I think that's fair. I suspect that eventually we will see connectors
being built this way in the first place. But in the meantime I think we'll see
people who already have flows and want to convert those into Connectors so this
is a helpful migration. But given that, I think I'm now leaning toward the
separate interface. I'll go that way.
--
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]