Lehel44 commented on code in PR #6034: URL: https://github.com/apache/nifi/pull/6034#discussion_r879889000
########## nifi-nar-bundles/nifi-snmp-bundle/nifi-snmp-processors/src/main/java/org/apache/nifi/snmp/processors/ListenTrapSNMP.java: ########## @@ -100,21 +129,66 @@ public class ListenTrapSNMP extends AbstractSessionFactoryProcessor { private volatile SNMPTrapReceiverHandler snmpTrapReceiverHandler; + @Override + public Collection<ValidationResult> customValidate(final ValidationContext validationContext) { + final List<ValidationResult> results = new ArrayList<>(super.customValidate(validationContext)); + + final boolean snmpUsersJsonFileIsSet = validationContext.getProperty(SNMP_USM_USERS_JSON_FILE).isSet(); + final boolean snmpUsersJsonIsSet = validationContext.getProperty(SNMP_USM_USERS_JSON).isSet(); + final boolean snmpUsersSecurityNames = validationContext.getProperty(SNMP_USM_SECURITY_NAMES).isSet(); + + final boolean isOnlyOneIsSetFromThree = Stream.of(snmpUsersJsonFileIsSet, snmpUsersJsonIsSet, snmpUsersSecurityNames).filter(a -> a).count() == 1; Review Comment: I will refactor this part so the additional validation won't be needed, but I agree, I don't like their names as well. -- 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: issues-unsubscr...@nifi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org