markap14 commented on code in PR #88:
URL: https://github.com/apache/nifi-api/pull/88#discussion_r3243569424


##########
src/main/java/org/apache/nifi/components/connector/migration/ConnectorMigrationContext.java:
##########
@@ -0,0 +1,68 @@
+/*
+ * 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.components.connector.migration;
+
+import org.apache.nifi.components.connector.AssetReference;
+import org.apache.nifi.components.connector.components.FlowContext;
+import org.apache.nifi.flow.VersionedExternalFlow;
+
+/**
+ * Context provided to a Connector when evaluating or performing migration 
from a Versioned Process Group export. The
+ * source flow exposed through this context is a read-only reference that the 
Connector uses to update its own managed
+ * flow; the source flow itself is never installed onto the Connector.
+ */
+public interface ConnectorMigrationContext {
+
+    /**
+     * Returns the source flow whose configuration, parameters, and component 
state the Connector should mirror into
+     * its own managed flow.
+     *
+     * @return the source flow
+     */
+    VersionedExternalFlow getSourceFlow();
+
+    /**
+     * Indicates whether the migration source is a local Versioned Process 
Group on this NiFi instance.
+     *
+     * @return {@code true} when the source is local
+     */
+    boolean isLocalMigration();
+
+    /**
+     * Returns the active flow context for the Connector being migrated.
+     *
+     * @return the active flow context
+     */
+    FlowContext getActiveFlowContext();

Review Comment:
   That's a good point, we do use FlowContext as an argument elsewhere. 
However, consistency cuts both ways here: consistent with the other lifecycle 
methods would mean passing FlowContext as a parameter, but consistent with "all 
migration inputs live on ConnectorMigrationContext" means leaving it on the 
context. Generally, in the nifi api when we provide a "Context" type of object, 
it is more of an all-inclusive type of object.



-- 
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]

Reply via email to