kevdoran commented on code in PR #11175:
URL: https://github.com/apache/nifi/pull/11175#discussion_r3384943314


##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java:
##########
@@ -3704,7 +3734,8 @@ public ConnectorEntity updateConnector(final Revision 
revision, final ConnectorD
 
     @Override
     public void verifyDeleteConnector(final String id) {
-        // For now, DAO will enforce state; expose hook for symmetry
+        final ConnectorNode connector = connectorDAO.getConnector(id);
+        connector.verifyCanDelete();

Review Comment:
   Not a blocker as this was pre-existing, and improving it could be a future 
extensibility API enhancement, but `verifyCanDelete()` should probably use the 
`ConnectorDAO->ConnectorRepository` path to mirror `verifyCanCreate()`, in case 
the `ConnectorRepository` wants to consult with the optional 
`ConnectorConfigurationProvider`



##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardConnectorDAO.java:
##########
@@ -157,6 +158,34 @@ public void verifyCancelDrainFlowFile(final String id) {
         connector.verifyCancelDrainFlowFiles();
     }
 
+    @Override
+    public void verifyEnterTroubleshooting(final String id) {
+        final ConnectorNode connector = getConnector(id);
+        getConnectorRepository().verifyEnterTroubleshooting(connector);
+    }
+
+    @Override
+    public void enterTroubleshooting(final String id) {
+        final ConnectorNode connector = getConnector(id);
+        getConnectorRepository().enterTroubleshooting(connector);
+    }
+
+    @Override
+    public void verifyEndTroubleshooting(final String id) {
+        final ConnectorNode connector = getConnector(id);
+        getConnectorRepository().verifyEndTroubleshooting(connector);
+    }
+
+    @Override
+    public void endTroubleshooting(final String id) {
+        final ConnectorNode connector = getConnector(id);
+        try {
+            getConnectorRepository().endTroubleshooting(connector);
+        } catch (final FlowUpdateException e) {
+            throw new IllegalStateException("Failed to exit troubleshooting 
mode for Connector " + id + ": " + e, e);
+        }
+    }
+

Review Comment:
   should any of these use `requireConnector(id, 
ConnectorSyncMode.LOCAL_ONLY);` rather than `getConnector(id)`? Just making 
sure this is intentional.



-- 
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]

Reply via email to