You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Mark Payne (JIRA)" <ji...@apache.org> on 2019/07/03 18:53:00 UTC

[jira] [Created] (NIFI-6421) Add getReferencedControllerServices() method to ComponentNode

Mark Payne created NIFI-6421:
--------------------------------

             Summary: Add getReferencedControllerServices() method to ComponentNode
                 Key: NIFI-6421
                 URL: https://issues.apache.org/jira/browse/NIFI-6421
             Project: Apache NiFi
          Issue Type: Improvement
          Components: Core Framework
            Reporter: Mark Payne
            Assignee: Mark Payne


There are several places throughout the codebase where we do something like this:
{code:java}
for (final Map.Entry<PropertyDescriptor, String> entry : reportingTaskNode.getEffectivePropertyValues().entrySet()) {
    final PropertyDescriptor descriptor = entry.getKey();
    if (descriptor.getControllerServiceDefinition() != null) {
        final String value = entry.getValue() == null ? descriptor.getDefaultValue() : entry.getValue();
        if (value != null) {
            final ControllerServiceNode serviceNode = flowController.getControllerServiceProvider().getControllerServiceNode(value);
            if (serviceNode != null) {
                serviceNode.removeReference(reportingTaskNode);
            }
        }
    }
}
{code}
We should avoid this redundancy by adding a getReferencedControllerServices() method to ComponentNode.  If we look at references to ComponentNode.getEffectivePropertyValues(), it will show the same code block (or similar) in several different locations.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)