pvillard31 commented on code in PR #25:
URL: https://github.com/apache/nifi-api/pull/25#discussion_r2474869704
##########
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:
I don't have a strong opinion about the order of the arguments but the
current order seems to be more consistent with the other methods in this
interface. Regarding Optional, it's usually something we use for return values,
no?
While we may not have a use case for it yet, we may want the ability to
create a branch off a specific version, this is why I went with
`FlowVersionLocation` instead of `FlowLocation `.
--
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]