exceptionfactory commented on code in PR #25:
URL: https://github.com/apache/nifi-api/pull/25#discussion_r2475018674


##########
src/main/java/org/apache/nifi/registry/flow/FlowRegistryClient.java:
##########
@@ -119,6 +119,27 @@ default FlowRegistryBranch getDefaultBranch(final 
FlowRegistryClientConfiguratio
         return branch;
     }
 
+    /**
+     * Creates a new branch in the Flow Registry for the specified flow.
+     *
+     * Implementations that do not support branching should rely on this 
default method, which throws an
+     * {@link UnsupportedOperationException}. Implementations that support 
branching must override this method
+     * and perform any required validation to ensure that the new branch can 
be created.
+     *
+     * @param context Configuration context
+     * @param sourceLocation The location of the flow version that will act as 
the source for the new branch. The version may be {@code null}
+     *                       to indicate that the registry implementation 
should select a default, such as the latest version on the source branch.
+     * @param newBranchName The name of the branch to create
+     *
+     * @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.
+     * @throws UnsupportedOperationException If the registry does not support 
branching.
+     */
+    default void createBranch(final FlowRegistryClientConfigurationContext 
context, final FlowVersionLocation sourceLocation, final String newBranchName)

Review Comment:
   That's a good point regarding `Optional` only on returns, avoiding it in 
parameters makes sense.
   
   Thanks for the answer on the `FlowVersionLocation`, I could see the 
potential for branching from a certain version, so that sounds good.
   
   I don't have as strong an opinion on the order, though most of the other 
methods are for retrieval. Leaving as-is sounds good.



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