bbende commented on code in PR #8726:
URL: https://github.com/apache/nifi/pull/8726#discussion_r1589526553


##########
nifi-api/src/main/java/org/apache/nifi/registry/flow/FlowRegistryClient.java:
##########
@@ -71,30 +74,82 @@ public interface FlowRegistryClient extends 
ConfigurableComponent {
      */
     boolean isStorageLocationApplicable(FlowRegistryClientConfigurationContext 
context, String location);
 
+    /**
+     * Indicates if the registry supports branching.
+     *
+     * @param context Configuration context
+     * @return true if the registry supports branching, false otherwise
+     */
+    default boolean isBranchingSupported(final 
FlowRegistryClientConfigurationContext context) {
+        return false;
+    }
+
+    /**
+     * Get the available branches. Should return at least one branch that 
matches the response of getDefaultBranch.
+     *
+     * @param context Configuration context
+     * @return the set of available branches
+     *
+     * @throws FlowRegistryException If an issue happens during processing the 
request.
+     * @throws IOException If there is issue with the communication between 
NiFi and the Flow Registry.
+     */
+    default Set<FlowRegistryBranch> getBranches(final 
FlowRegistryClientConfigurationContext context) throws FlowRegistryException, 
IOException {
+        return Set.of(getDefaultBranch(context));
+    }
+
+    /**
+     * Gets the default branch. Must return a non-null FlowRegistryBranch 
instance with a non-null name.
+     *
+     * @param context Configuration context
+     * @return the default branch
+     *
+     * @throws FlowRegistryException If an issue happens during processing the 
request.
+     * @throws IOException If there is issue with the communication between 
NiFi and the Flow Registry.
+     */
+    default FlowRegistryBranch getDefaultBranch(final 
FlowRegistryClientConfigurationContext context) throws FlowRegistryException, 
IOException {
+        final FlowRegistryBranch branch = new FlowRegistryBranch();
+        branch.setName(DEFAULT_BRANCH_NAME);
+        return branch;
+    }
+
+    /**
+     * Creates a new branch from a given branch.
+     *
+     * @param context Configuration context
+     * @param createBranch the info for creating the branch
+     *
+     * @throws FlowRegistryException If an issue happens during processing the 
request.
+     * @throws IOException If there is issue with the communication between 
NiFi and the Flow Registry.
+     */
+    default void createBranch(FlowRegistryClientConfigurationContext context, 
final CreateBranch createBranch) throws FlowRegistryException, IOException {

Review Comment:
   I agree, I am going to remove the `createBranch` method and `CreateBranch` 
object for now, which addresses some of the discussion/questions. It can be 
added in a non-breaking way later if we decide we ever want to create branches 
from NiFi, but I have a feeling we don't want to.



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to