Skip to content

Commit 6e2ed1e

Browse files
authored
NIFI-15142 Added createBranch method to Flow Registry Client (#25)
Signed-off-by: David Handermann <[email protected]>
1 parent 476aeb8 commit 6e2ed1e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/main/java/org/apache/nifi/registry/flow/FlowRegistryClient.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,27 @@ default FlowRegistryBranch getDefaultBranch(final FlowRegistryClientConfiguratio
119119
return branch;
120120
}
121121

122+
/**
123+
* Creates a new branch in the Flow Registry for the specified flow.
124+
*
125+
* Implementations that do not support branching should rely on this default method, which throws an
126+
* {@link UnsupportedOperationException}. Implementations that support branching must override this method
127+
* and perform any required validation to ensure that the new branch can be created.
128+
*
129+
* @param context Configuration context
130+
* @param sourceLocation The location of the flow version that will act as the source for the new branch. The version may be {@code null}
131+
* to indicate that the registry implementation should select a default, such as the latest version on the source branch.
132+
* @param branchName The name of the branch to create
133+
*
134+
* @throws FlowRegistryException If an issue happens during processing the request.
135+
* @throws IOException If there is issue with the communication between NiFi and the Flow Registry.
136+
* @throws UnsupportedOperationException If the registry does not support branching.
137+
*/
138+
default void createBranch(FlowRegistryClientConfigurationContext context, FlowVersionLocation sourceLocation, String branchName)
139+
throws FlowRegistryException, IOException {
140+
throw new UnsupportedOperationException("Branch creation is not supported by this Flow Registry Client");
141+
}
142+
122143
/**
123144
* Gets the buckets for the specified user.
124145
*

0 commit comments

Comments
 (0)