This is an automated email from the ASF dual-hosted git repository.

markap14 pushed a commit to branch NIFI-15258
in repository https://gitbox.apache.org/repos/asf/nifi.git

commit e07c90b7a6f7bf28715db6a2bc25a07a2407c274
Author: Mark Payne <[email protected]>
AuthorDate: Fri Jan 9 17:27:48 2026 -0500

    NIFI-15445: Removed 'disabled' state from Connectors; also fixed bug … 
(#10749)
    
    * NIFI-15445: Removed 'disabled' state from Connectors; also fixed bug to 
ensure that if we fail to apply an update to a Connector that we stop it.
    
    * NIFI-15445: Addressed review feedback
    
    * NIFI-15445: Fixed checkstyle
---
 .../org/apache/nifi/web/api/dto/ConnectorDTO.java  |  4 +-
 .../flow/mapping/VersionedComponentFlowMapper.java |  5 +-
 .../nifi/components/connector/ConnectorNode.java   |  9 ---
 .../nifi/components/connector/ConnectorState.java  |  1 -
 .../apache/nifi/controller/ProcessScheduler.java   |  4 --
 .../connector/StandardConnectorNode.java           | 78 +++++++---------------
 .../scheduling/StandardProcessScheduler.java       | 27 --------
 .../connector/StandardConnectorNodeIT.java         |  3 +-
 .../connector/TestStandardConnectorNode.java       | 68 +------------------
 .../org/apache/nifi/audit/ConnectorAuditor.java    | 52 ---------------
 .../apache/nifi/web/StandardNiFiServiceFacade.java |  1 -
 .../java/org/apache/nifi/web/dao/ConnectorDAO.java |  4 --
 .../nifi/web/dao/impl/StandardConnectorDAO.java    | 12 ----
 .../scheduling/StatelessProcessScheduler.java      | 10 ---
 14 files changed, 32 insertions(+), 246 deletions(-)

diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ConnectorDTO.java
 
b/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ConnectorDTO.java
index a2253fdfeb..d2d08590a3 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ConnectorDTO.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/ConnectorDTO.java
@@ -29,7 +29,7 @@ public class ConnectorDTO extends ComponentDTO {
     private String name;
     private String type;
     private BundleDTO bundle;
-    private String state; // RUNNING, STOPPED, DISABLED
+    private String state; // RUNNING, STOPPED
     private String managedProcessGroupId;
     private ConnectorConfigurationDTO activeConfiguration;
     private ConnectorConfigurationDTO workingConfiguration;
@@ -69,7 +69,7 @@ public class ConnectorDTO extends ComponentDTO {
         this.bundle = bundle;
     }
 
-    @Schema(description = "The state of the Connector.", allowableValues = 
{"RUNNING", "STOPPED", "DISABLED"})
+    @Schema(description = "The state of the Connector.", allowableValues = 
{"RUNNING", "STOPPED"})
     public String getState() {
         return state;
     }
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/flow/mapping/VersionedComponentFlowMapper.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/flow/mapping/VersionedComponentFlowMapper.java
index 50a896ebf5..dc9ac31f85 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/flow/mapping/VersionedComponentFlowMapper.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/registry/flow/mapping/VersionedComponentFlowMapper.java
@@ -21,17 +21,17 @@ import org.apache.commons.lang3.ClassUtils;
 import org.apache.nifi.asset.Asset;
 import org.apache.nifi.bundle.BundleCoordinate;
 import org.apache.nifi.components.PropertyDescriptor;
-import org.apache.nifi.components.listen.ListenPortDefinition;
 import org.apache.nifi.components.connector.AssetReference;
-import org.apache.nifi.components.connector.NamedStepConfiguration;
 import org.apache.nifi.components.connector.ConnectorConfiguration;
 import org.apache.nifi.components.connector.ConnectorNode;
 import org.apache.nifi.components.connector.ConnectorState;
 import org.apache.nifi.components.connector.ConnectorValueReference;
 import org.apache.nifi.components.connector.FrameworkFlowContext;
+import org.apache.nifi.components.connector.NamedStepConfiguration;
 import org.apache.nifi.components.connector.SecretReference;
 import org.apache.nifi.components.connector.StepConfiguration;
 import org.apache.nifi.components.connector.StringLiteralValue;
+import org.apache.nifi.components.listen.ListenPortDefinition;
 import org.apache.nifi.components.resource.ResourceCardinality;
 import org.apache.nifi.components.resource.ResourceDefinition;
 import org.apache.nifi.connectable.Connectable;
@@ -1106,7 +1106,6 @@ public class VersionedComponentFlowMapper {
         }
 
         return switch (connectorState) {
-            case DISABLED -> org.apache.nifi.flow.ScheduledState.DISABLED;
             case RUNNING, STARTING -> 
org.apache.nifi.flow.ScheduledState.RUNNING;
             default -> org.apache.nifi.flow.ScheduledState.ENABLED;
         };
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/components/connector/ConnectorNode.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/components/connector/ConnectorNode.java
index d4121b2db9..146be70d73 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/components/connector/ConnectorNode.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/components/connector/ConnectorNode.java
@@ -161,15 +161,6 @@ public interface ConnectorNode extends 
ComponentAuthorizable, VersionedComponent
      */
     Collection<ValidationResult> getValidationErrors();
 
-    /**
-     * Enables the Connector. This method should only be invoked via the 
ConnectorRepository.
-     */
-    void enable();
-
-    /**
-     * Disables the Connector. This method should only be invoked via the 
ConnectorRepository.
-     */
-    void disable();
 
     ValidationState getValidationState();
 
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/components/connector/ConnectorState.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/components/connector/ConnectorState.java
index ad30ab832b..c13999c4fa 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/components/connector/ConnectorState.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/components/connector/ConnectorState.java
@@ -22,7 +22,6 @@ public enum ConnectorState {
     RUNNING,
     STOPPING,
     STOPPED,
-    DISABLED,
     DRAINING,
     PURGING,
     PREPARING_FOR_UPDATE,
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/ProcessScheduler.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/ProcessScheduler.java
index fba71ebca8..94ca3da1b1 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/ProcessScheduler.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/ProcessScheduler.java
@@ -269,10 +269,6 @@ public interface ProcessScheduler {
 
     CompletableFuture<Void> stopConnector(ConnectorNode connectorNode);
 
-    void enableConnector(ConnectorNode connectorNode);
-
-    void disableConnector(ConnectorNode connectorNode);
-
     void onConnectorRemoved(ConnectorNode connectorNode);
 
     /**
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/components/connector/StandardConnectorNode.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/components/connector/StandardConnectorNode.java
index 671e88efea..5edd2d3fb1 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/components/connector/StandardConnectorNode.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/components/connector/StandardConnectorNode.java
@@ -37,6 +37,7 @@ import org.apache.nifi.connectable.FlowFileActivity;
 import org.apache.nifi.connectable.FlowFileTransferCounts;
 import org.apache.nifi.controller.flow.FlowManager;
 import org.apache.nifi.controller.queue.DropFlowFileStatus;
+import org.apache.nifi.controller.queue.QueueSize;
 import org.apache.nifi.engine.FlowEngine;
 import org.apache.nifi.flow.Bundle;
 import org.apache.nifi.flow.VersionedConfigurationStep;
@@ -227,7 +228,19 @@ public class StandardConnectorNode implements 
ConnectorNode {
 
     @Override
     public void applyUpdate() throws FlowUpdateException {
-        applyUpdate(workingFlowContext);
+        try {
+            applyUpdate(workingFlowContext);
+        } catch (final FlowUpdateException e) {
+            // Since we failed to update, make sure that we stop the 
Connector. Note that we do not do this for all
+            // throwables because IllegalStateException for example indicates 
that we did not even attempt to perform the update.
+            try (final NarCloseable ignored = 
NarCloseable.withComponentNarLoader(extensionManager, 
connectorDetails.getConnector().getClass(), getIdentifier())) {
+                connectorDetails.getConnector().stop(activeFlowContext);
+            } catch (final Throwable stopThrowable) {
+                e.addSuppressed(stopThrowable);
+            }
+
+            throw e;
+        }
     }
 
     private void applyUpdate(final FrameworkFlowContext contextToInherit) 
throws FlowUpdateException {
@@ -321,39 +334,6 @@ public class StandardConnectorNode implements 
ConnectorNode {
         return stateTransition.getDesiredState();
     }
 
-    @Override
-    public void enable() {
-        if (getCurrentState() == ConnectorState.STOPPED) {
-            return;
-        }
-        if (getCurrentState() != ConnectorState.DISABLED) {
-            throw new IllegalStateException("Cannot enable " + this + " 
because its desired state is currently " + getCurrentState()
-                                            + "; it must be DISABLED in order 
to be enabled.");
-        }
-
-        stateTransition.setDesiredState(ConnectorState.STOPPED);
-        if (stateTransition.trySetCurrentState(ConnectorState.DISABLED, 
ConnectorState.STOPPED)) {
-            logger.info("Transitioned current state for {} to {}", this, 
ConnectorState.STOPPED);
-            return;
-        }
-
-        logger.info("{} enabled but not currently DISABLED so set desired 
state to STOPPED; current state is {}", this, 
stateTransition.getCurrentState());
-    }
-
-    @Override
-    public void disable() {
-        stateTransition.setDesiredState(ConnectorState.DISABLED);
-
-        final ConnectorState currentState = getCurrentState();
-        if (currentState == ConnectorState.DISABLED || currentState == 
ConnectorState.STOPPED || currentState == ConnectorState.UPDATE_FAILED) {
-            if (stateTransition.trySetCurrentState(currentState, 
ConnectorState.DISABLED)) {
-                logger.info("Transitioned current state for {} to {}", this, 
ConnectorState.DISABLED);
-                return;
-            }
-        }
-
-        logger.info("{} disabled but not in a state that can immediately 
transition to DISABLED so set desired state to DISABLED; current state is {}", 
this, currentState);
-    }
 
     @Override
     public Optional<Duration> getIdleDuration() {
@@ -424,7 +404,7 @@ public class StandardConnectorNode implements ConnectorNode 
{
         boolean stateUpdated = false;
         while (!stateUpdated) {
             final ConnectorState currentState = getCurrentState();
-            if (currentState == ConnectorState.STOPPED || currentState == 
ConnectorState.DISABLED) {
+            if (currentState == ConnectorState.STOPPED) {
                 logger.debug("{} is already {}; will not attempt to stop", 
this, currentState);
                 stopCompleteFuture.complete(null);
                 return stopCompleteFuture;
@@ -504,18 +484,9 @@ public class StandardConnectorNode implements 
ConnectorNode {
         stopCompleteFuture.complete(null);
 
         final ConnectorState desiredState = getDesiredState();
-        switch (desiredState) {
-            case DISABLED -> {
-                logger.info("{} was requested to be DISABLED while it was 
stopping so will now transition to DISABLED", this);
-                disable();
-            }
-            case RUNNING -> {
-                logger.info("{} was requested to be RUNNING while it was 
stopping so will attempt to start again", this);
-                start(scheduler, new CompletableFuture<>());
-            }
-            default -> {
-                // No action needed for other states
-            }
+        if (desiredState == ConnectorState.RUNNING) {
+            logger.info("{} was requested to be RUNNING while it was stopping 
so will attempt to start again", this);
+            start(scheduler, new CompletableFuture<>());
         }
     }
 
@@ -541,8 +512,14 @@ public class StandardConnectorNode implements 
ConnectorNode {
 
     @Override
     public void verifyCanDelete() {
+        final QueueSize queueSize = 
getActiveFlowContext().getManagedProcessGroup().getQueueSize();
+        if (queueSize.getObjectCount() > 0) {
+            throw new IllegalStateException("Cannot delete " + this + " 
because its Process Group has " + queueSize.getObjectCount()
+                + " FlowFiles queued; all FlowFiles must be removed before it 
can be deleted.");
+        }
+
         final ConnectorState currentState = getCurrentState();
-        if (currentState == ConnectorState.STOPPED || currentState == 
ConnectorState.DISABLED) {
+        if (currentState == ConnectorState.STOPPED || currentState == 
ConnectorState.UPDATE_FAILED || currentState == ConnectorState.UPDATED) {
             return;
         }
 
@@ -551,11 +528,6 @@ public class StandardConnectorNode implements 
ConnectorNode {
 
     @Override
     public void verifyCanStart() {
-        final ConnectorState currentState = getCurrentState();
-        if (currentState == ConnectorState.DISABLED) {
-            throw new IllegalStateException("Cannot start " + this + " because 
its state is currently " + currentState + "; it must be fully stopped before it 
can be started.");
-        }
-
         final ValidationState state = performValidation();
         if (state.getStatus() != ValidationStatus.VALID) {
             throw new IllegalStateException("Cannot start " + this + " because 
it is not valid: " + state.getValidationErrors());
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java
index eb9a0e2101..1b0f89a0db 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java
@@ -23,7 +23,6 @@ import org.apache.nifi.annotation.lifecycle.OnUnscheduled;
 import org.apache.nifi.annotation.notification.PrimaryNodeState;
 import org.apache.nifi.authorization.resource.ComponentAuthorizable;
 import org.apache.nifi.components.connector.ConnectorNode;
-import org.apache.nifi.components.connector.ConnectorState;
 import org.apache.nifi.components.state.StateManager;
 import org.apache.nifi.components.state.StateManagerProvider;
 import org.apache.nifi.components.validation.ValidationStatus;
@@ -924,32 +923,6 @@ public final class StandardProcessScheduler implements 
ProcessScheduler {
         throw new UnsupportedOperationException();
     }
 
-    @Override
-    public void enableConnector(final ConnectorNode connectorNode) {
-        final ConnectorState currentState = connectorNode.getCurrentState();
-        if (currentState != ConnectorState.DISABLED) {
-            throw new IllegalStateException("Connector cannot be enabled 
because its state is set to " + currentState
-                    + " but transition to STOPPED state is allowed only from 
the DISABLED state");
-        }
-
-        connectorNode.enable();
-    }
-
-    @Override
-    public void disableConnector(final ConnectorNode connectorNode) {
-        final ConnectorState currentState = connectorNode.getCurrentState();
-        if (currentState == ConnectorState.DISABLED) {
-            return;
-        }
-
-        if (currentState != ConnectorState.STOPPED) {
-            throw new IllegalStateException("Connector cannot be disabled 
because its state is set to " + currentState
-                    + " but transition to DISABLED state is allowed only from 
the STOPPED state");
-        }
-
-        connectorNode.disable();
-    }
-
     @Override
     public void onConnectorRemoved(final ConnectorNode connectorNode) {
         
lifecycleStateManager.removeLifecycleState(connectorNode.getIdentifier());
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/components/connector/StandardConnectorNodeIT.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/components/connector/StandardConnectorNodeIT.java
index d2f8ce2dfc..f8e63e2723 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/components/connector/StandardConnectorNodeIT.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/components/connector/StandardConnectorNodeIT.java
@@ -481,12 +481,11 @@ public class StandardConnectorNodeIT {
     }
 
     @Test
-    public void testPurgeFlowFilesRequiresStoppedState() throws 
FlowUpdateException {
+    public void testPurgeFlowFilesRequiresStoppedState() {
         final ConnectorNode connectorNode = initializeDynamicFlowConnector();
         final ProcessGroup rootGroup = 
connectorNode.getActiveFlowContext().getManagedProcessGroup();
         queueDataBySource(rootGroup, "Create FlowFile");
 
-        connectorNode.enable();
         assertEquals(ConnectorState.STOPPED, connectorNode.getCurrentState());
 
         connectorNode.start(componentLifecycleThreadPool);
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/components/connector/TestStandardConnectorNode.java
 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/components/connector/TestStandardConnectorNode.java
index bf26c1f7ed..4eba662d26 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/components/connector/TestStandardConnectorNode.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/components/connector/TestStandardConnectorNode.java
@@ -25,6 +25,7 @@ import 
org.apache.nifi.components.connector.components.FlowContext;
 import org.apache.nifi.components.connector.components.FlowContextType;
 import org.apache.nifi.components.connector.secrets.SecretsManager;
 import org.apache.nifi.controller.flow.FlowManager;
+import org.apache.nifi.controller.queue.QueueSize;
 import org.apache.nifi.engine.FlowEngine;
 import org.apache.nifi.flow.Bundle;
 import org.apache.nifi.flow.VersionedExternalFlow;
@@ -81,6 +82,7 @@ public class TestStandardConnectorNode {
         scheduler = new FlowEngine(1, "flow-engine");
 
         
when(managedProcessGroup.purge()).thenReturn(CompletableFuture.completedFuture(null));
+        when(managedProcessGroup.getQueueSize()).thenReturn(new QueueSize(0, 
0L));
 
         flowContextFactory = new FlowContextFactory() {
             @Override
@@ -143,47 +145,6 @@ public class TestStandardConnectorNode {
         assertFalse(stopFuture.isCancelled());
     }
 
-    @Test
-    public void testCannotStartFromDisabledState() throws FlowUpdateException {
-        final StandardConnectorNode connectorNode = createConnectorNode();
-        connectorNode.disable();
-        assertEquals(ConnectorState.DISABLED, connectorNode.getCurrentState());
-
-        assertThrows(IllegalStateException.class, () -> 
connectorNode.start(scheduler));
-    }
-
-    @Test
-    public void testCannotTransitionFromDisabledToRunning() throws 
FlowUpdateException {
-        final StandardConnectorNode connectorNode = createConnectorNode();
-        connectorNode.disable();
-        assertEquals(ConnectorState.DISABLED, connectorNode.getCurrentState());
-
-        assertThrows(IllegalStateException.class, () -> 
connectorNode.start(scheduler));
-
-        assertEquals(ConnectorState.DISABLED, connectorNode.getCurrentState());
-    }
-
-    @Test
-    public void testEnableFromDisabledState() throws FlowUpdateException {
-        final StandardConnectorNode connectorNode = createConnectorNode();
-        connectorNode.disable();
-        assertEquals(ConnectorState.DISABLED, connectorNode.getCurrentState());
-
-        connectorNode.enable();
-        assertEquals(ConnectorState.STOPPED, connectorNode.getCurrentState());
-        assertEquals(ConnectorState.STOPPED, connectorNode.getDesiredState());
-    }
-
-    @Test
-    public void testDisableFromStoppedState() throws FlowUpdateException {
-        final StandardConnectorNode connectorNode = createConnectorNode();
-        assertEquals(ConnectorState.STOPPED, connectorNode.getCurrentState());
-
-        connectorNode.disable();
-        assertEquals(ConnectorState.DISABLED, connectorNode.getCurrentState());
-        assertEquals(ConnectorState.DISABLED, connectorNode.getDesiredState());
-    }
-
     @Test
     public void testStartFutureCompletedOnlyWhenRunning() throws Exception {
         final StandardConnectorNode connectorNode = createConnectorNode();
@@ -243,14 +204,6 @@ public class TestStandardConnectorNode {
         connectorNode.verifyCanDelete();
     }
 
-    @Test
-    public void testVerifyCanDeleteWhenDisabled() throws FlowUpdateException {
-        final StandardConnectorNode connectorNode = createConnectorNode();
-        connectorNode.disable();
-        assertEquals(ConnectorState.DISABLED, connectorNode.getCurrentState());
-        connectorNode.verifyCanDelete();
-    }
-
     @Test
     public void testCannotDeleteWhenRunning() throws Exception {
         final StandardConnectorNode connectorNode = createConnectorNode();
@@ -355,23 +308,6 @@ public class TestStandardConnectorNode {
         assertEquals(newConfiguration, 
connectorNode.getActiveFlowContext().getConfigurationContext().toConnectorConfiguration());
     }
 
-    @Test
-    public void testSetConfigurationWhenDisabled() throws FlowUpdateException {
-        final StandardConnectorNode connectorNode = createConnectorNode();
-        connectorNode.disable();
-        assertEquals(ConnectorState.DISABLED, connectorNode.getCurrentState());
-        assertEquals(ConnectorState.DISABLED, connectorNode.getDesiredState());
-
-        final ConnectorConfiguration newConfiguration = 
createTestConfiguration();
-
-        connectorNode.transitionStateForUpdating();
-        connectorNode.prepareForUpdate();
-        connectorNode.setConfiguration("testGroup", createStepConfiguration());
-        connectorNode.applyUpdate();
-
-        assertEquals(newConfiguration, 
connectorNode.getActiveFlowContext().getConfigurationContext().toConnectorConfiguration());
-    }
-
     @Test
     public void testSetConfigurationWithPropertyChanges() throws 
FlowUpdateException, ExecutionException, InterruptedException, TimeoutException 
{
         final StandardConnectorNode connectorNode = createConnectorNode();
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/ConnectorAuditor.java
 
b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/ConnectorAuditor.java
index 73922f984a..57c762451f 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/ConnectorAuditor.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/ConnectorAuditor.java
@@ -157,58 +157,6 @@ public class ConnectorAuditor extends NiFiAuditor {
         }
     }
 
-    /**
-     * Audits the enabling of a connector via enableConnector().
-     *
-     * @param proceedingJoinPoint join point
-     * @param connectorId connector id
-     * @param connectorDAO connector dao
-     * @throws Throwable if an error occurs
-     */
-    @Around("within(org.apache.nifi.web.dao.ConnectorDAO+) && "
-            + "execution(void enableConnector(java.lang.String)) && "
-            + "args(connectorId) && "
-            + "target(connectorDAO)")
-    public void enableConnectorAdvice(final ProceedingJoinPoint 
proceedingJoinPoint, final String connectorId, final ConnectorDAO connectorDAO) 
throws Throwable {
-        final ConnectorNode connector = connectorDAO.getConnector(connectorId);
-        final ConnectorState previousState = connector.getCurrentState();
-
-        proceedingJoinPoint.proceed();
-
-        if (isAuditable() && previousState == ConnectorState.DISABLED) {
-            final Action action = generateAuditRecord(connector, 
Operation.Enable);
-            if (action != null) {
-                saveAction(action, logger);
-            }
-        }
-    }
-
-    /**
-     * Audits the disabling of a connector via disableConnector().
-     *
-     * @param proceedingJoinPoint join point
-     * @param connectorId connector id
-     * @param connectorDAO connector dao
-     * @throws Throwable if an error occurs
-     */
-    @Around("within(org.apache.nifi.web.dao.ConnectorDAO+) && "
-            + "execution(void disableConnector(java.lang.String)) && "
-            + "args(connectorId) && "
-            + "target(connectorDAO)")
-    public void disableConnectorAdvice(final ProceedingJoinPoint 
proceedingJoinPoint, final String connectorId, final ConnectorDAO connectorDAO) 
throws Throwable {
-        final ConnectorNode connector = connectorDAO.getConnector(connectorId);
-        final ConnectorState previousState = connector.getCurrentState();
-
-        proceedingJoinPoint.proceed();
-
-        if (isAuditable() && previousState != ConnectorState.DISABLED) {
-            final Action action = generateAuditRecord(connector, 
Operation.Disable);
-            if (action != null) {
-                saveAction(action, logger);
-            }
-        }
-    }
-
     /**
      * Audits configuration step updates via 
updateConnectorConfigurationStep().
      *
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
 
b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
index c540467b38..195aca6e21 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
@@ -3591,7 +3591,6 @@ public class StandardNiFiServiceFacade implements 
NiFiServiceFacade {
             switch (state) {
                 case RUNNING -> connectorDAO.startConnector(id);
                 case STOPPED -> connectorDAO.stopConnector(id);
-                case DISABLED -> connectorDAO.disableConnector(id);
                 default -> throw new IllegalArgumentException("Unsupported 
scheduled state for Connector: " + state);
             }
             controllerFacade.save();
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/ConnectorDAO.java
 
b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/ConnectorDAO.java
index a494cf47ba..a987dde126 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/ConnectorDAO.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/ConnectorDAO.java
@@ -45,10 +45,6 @@ public interface ConnectorDAO {
 
     void stopConnector(String id);
 
-    void enableConnector(String id);
-
-    void disableConnector(String id);
-
     void updateConnectorConfigurationStep(String id, String 
configurationStepName, ConfigurationStepConfigurationDTO 
configurationStepConfiguration);
 
     void applyConnectorUpdate(String id, ConnectorUpdateContext updateContext);
diff --git 
a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardConnectorDAO.java
 
b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardConnectorDAO.java
index d4b2183604..e55e6ceee0 100644
--- 
a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardConnectorDAO.java
+++ 
b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardConnectorDAO.java
@@ -127,18 +127,6 @@ public class StandardConnectorDAO implements ConnectorDAO {
         getConnectorRepository().stopConnector(connector);
     }
 
-    @Override
-    public void enableConnector(final String id) {
-        final ConnectorNode connector = getConnector(id);
-        connector.enable();
-    }
-
-    @Override
-    public void disableConnector(final String id) {
-        final ConnectorNode connector = getConnector(id);
-        connector.disable();
-    }
-
     @Override
     public void updateConnectorConfigurationStep(final String id, final String 
configurationStepName, final ConfigurationStepConfigurationDTO 
configurationStepDto) {
         final ConnectorNode connector = getConnector(id);
diff --git 
a/nifi-stateless/nifi-stateless-bundle/nifi-stateless-engine/src/main/java/org/apache/nifi/controller/scheduling/StatelessProcessScheduler.java
 
b/nifi-stateless/nifi-stateless-bundle/nifi-stateless-engine/src/main/java/org/apache/nifi/controller/scheduling/StatelessProcessScheduler.java
index 531b9da34b..72c026083b 100644
--- 
a/nifi-stateless/nifi-stateless-bundle/nifi-stateless-engine/src/main/java/org/apache/nifi/controller/scheduling/StatelessProcessScheduler.java
+++ 
b/nifi-stateless/nifi-stateless-bundle/nifi-stateless-engine/src/main/java/org/apache/nifi/controller/scheduling/StatelessProcessScheduler.java
@@ -345,16 +345,6 @@ public class StatelessProcessScheduler implements 
ProcessScheduler {
         throw new UnsupportedOperationException();
     }
 
-    @Override
-    public void enableConnector(final ConnectorNode connectorNode) {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public void disableConnector(final ConnectorNode connectorNode) {
-        throw new UnsupportedOperationException();
-    }
-
     @Override
     public void onConnectorRemoved(final ConnectorNode connectorNode) {
     }

Reply via email to