dan-s1 commented on code in PR #10233:
URL: https://github.com/apache/nifi/pull/10233#discussion_r2305157281
##########
nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/audit/ProcessGroupAuditor.java:
##########
@@ -246,6 +252,48 @@ public void enableComponentsAdvice(ProceedingJoinPoint
proceedingJoinPoint, Stri
}
saveUpdateProcessGroupAction(groupId, operation);
+ if (components.get(Component.Processor) != null) {
+ saveUpdateConnectableActions(components.get(Component.Processor),
operation, Component.Processor);
+ }
+ if (components.get(Component.InputPort) != null) {
+ saveUpdateConnectableActions(components.get(Component.InputPort),
operation, Component.InputPort);
+ }
+ if (components.get(Component.OutputPort) != null) {
+ saveUpdateConnectableActions(components.get(Component.OutputPort),
operation, Component.OutputPort);
+ }
+ }
+
+ private Map<Component, List<Connectable>> getComponents(final String
groupId, final Collection<String> componentIds) {
Review Comment:
@exceptionfactory I agree the map is not necessary, though for clarity to
show the exact components could there be three separate lists e.g.
```
final List<? extends Connectable> processorNodes =
componentIds.stream()
.map(processGroup::findProcessor)
.filter(Objects::nonNull)
.toList();
final List<? extends Connectable> inputPorts = componentIds.stream()
.map(processGroup::findInputPort)
.filter(Objects::nonNull)
.toList();
final List<? extends Connectable> outputPorts = componentIds.stream()
.map(processGroup::findOutputPort)
.filter(Objects::nonNull)
.toList();
```
If this would be okay, then the signature for `saveUpdateConnectableActions`
would change slightly for the first argument from
`final List<Connectable> connectables` to `final List<? extends Connectable>
connectables`
--
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]