exceptionfactory commented on code in PR #25:
URL: https://github.com/apache/nifi-api/pull/25#discussion_r2474683148
##########
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
Review Comment:
Recommend `branchName` since `new` is implied in the method.
##########
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:
It seems better to have the required Branch Name argument before the
optional source location. Instead of allowing `sourceLocation` to be `null`,
what do you think about using `Optional`?
In addition, is the `version` necessary, or could `FlowLocation` be used
instead?
--
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]