mcgilman commented on code in PR #10748:
URL: https://github.com/apache/nifi/pull/10748#discussion_r2677838155
##########
nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/components/connector/StandardConnectorNode.java:
##########
@@ -840,6 +841,168 @@ public void discardWorkingConfiguration() {
recreateWorkingFlowContext();
}
+ @Override
+ public List<ConnectorAction> getAvailableActions() {
+ final List<ConnectorAction> actions = new ArrayList<>();
+ final ConnectorState currentState = getCurrentState();
+ final boolean dataQueued =
activeFlowContext.getManagedProcessGroup().isDataQueued();
+ final boolean stopped = currentState == ConnectorState.STOPPED ||
currentState == ConnectorState.DISABLED
+ || currentState == ConnectorState.UPDATED || currentState ==
ConnectorState.UPDATE_FAILED;
+
+ actions.add(createStartAction(currentState, stopped));
+ actions.add(createStopAction(currentState));
+ actions.add(createConfigureAction());
+ actions.add(createDiscardWorkingConfigAction());
+ actions.add(createPurgeFlowFilesAction(stopped, dataQueued));
+ actions.add(createDrainFlowFilesAction(stopped, dataQueued));
+ actions.add(createApplyUpdatesAction(currentState));
+ actions.add(createDeleteAction(stopped, dataQueued));
+
+ return actions;
+ }
+
+ private ConnectorAction createStartAction(final ConnectorState
currentState, final boolean stopped) {
+ final boolean allowed;
+ final String reason;
+
+ if (currentState == ConnectorState.DISABLED) {
+ allowed = false;
+ reason = "Connector is disabled";
Review Comment:
#10749 has been merged. When rebased to current NIFI-15258 branch this no
longer compiles.
--
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]