Lehel44 commented on code in PR #6034:
URL: https://github.com/apache/nifi/pull/6034#discussion_r911259939


##########
nifi-nar-bundles/nifi-snmp-bundle/nifi-snmp-processors/src/main/java/org/apache/nifi/snmp/processors/ListenTrapSNMP.java:
##########
@@ -99,29 +151,69 @@ public class ListenTrapSNMP extends 
AbstractSessionFactoryProcessor {
     )));
 
     private volatile SNMPTrapReceiverHandler snmpTrapReceiverHandler;
+    private volatile List<UsmUser> usmUsers;
+
+
+    @Override
+    public List<ConfigVerificationResult> verify(ProcessContext context, 
ComponentLog verificationLogger, Map<String, String> attributes) {
+        final List<ConfigVerificationResult> results = new ArrayList<>();
+
+        final String usmUserSource = 
context.getProperty(SNMP_USM_USER_SOURCE).getValue();
+
+        if (usmUserSource != null) {
+            final String usmUsersJsonFilePath = 
context.getProperty(SNMP_USM_USERS_JSON_FILE_PATH).getValue();
+            final String usmUsersJson = 
context.getProperty(SNMP_USM_USERS_JSON).getValue();
+            final String usmSecurityNames = 
context.getProperty(SNMP_USM_SECURITY_NAMES).getValue();
+
+            UsmReader usmReader = null;
+
+            if (USM_JSON_FILE_PATH.getValue().equals(usmUserSource)) {
+                usmReader = new JsonFileUsmReader(usmUsersJsonFilePath);
+            } else if (USM_JSON_CONTENT.getValue().equals(usmUserSource)) {
+                usmReader = new JsonUsmReader(usmUsersJson);
+            } else if (USM_SECURITY_NAMES.getValue().equals(usmUserSource)) {
+                usmReader = new SecurityNamesUsmReader(usmSecurityNames);
+            }
+
+            try {
+                if (usmReader != null) {
+                    usmUsers = usmReader.readUsm();

Review Comment:
   That's right, thanks!



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

Reply via email to