This is an automated email from the ASF dual-hosted git repository.
exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-api.git
The following commit(s) were added to refs/heads/main by this push:
new 6e2ed1e NIFI-15142 Added createBranch method to Flow Registry Client
(#25)
6e2ed1e is described below
commit 6e2ed1ec8bbd6915c01547946ca4e7d8e39e47d0
Author: Pierre Villard <[email protected]>
AuthorDate: Wed Oct 29 20:32:40 2025 +0100
NIFI-15142 Added createBranch method to Flow Registry Client (#25)
Signed-off-by: David Handermann <[email protected]>
---
.../nifi/registry/flow/FlowRegistryClient.java | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git
a/src/main/java/org/apache/nifi/registry/flow/FlowRegistryClient.java
b/src/main/java/org/apache/nifi/registry/flow/FlowRegistryClient.java
index 860dfd8..76845c6 100644
--- a/src/main/java/org/apache/nifi/registry/flow/FlowRegistryClient.java
+++ b/src/main/java/org/apache/nifi/registry/flow/FlowRegistryClient.java
@@ -119,6 +119,27 @@ public interface FlowRegistryClient extends
ConfigurableComponent {
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 branchName 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(FlowRegistryClientConfigurationContext context,
FlowVersionLocation sourceLocation, String branchName)
+ throws FlowRegistryException, IOException {
+ throw new UnsupportedOperationException("Branch creation is not
supported by this Flow Registry Client");
+ }
+
/**
* Gets the buckets for the specified user.
*