Merge "sonar-AAF_Locate.java"
authorJonathan Gathman <jonathan.gathman@att.com>
Tue, 8 Oct 2019 12:25:42 +0000 (12:25 +0000)
committerGerrit Code Review <gerrit@onap.org>
Tue, 8 Oct 2019 12:25:42 +0000 (12:25 +0000)
auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/approvalsets/Pending.java
auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/LastNotified.java

index eed6733..9a66698 100644 (file)
@@ -3,6 +3,8 @@
  * org.onap.aaf
  * ===========================================================================
  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+ *
+ * Modifications Copyright (C) 2019 IBM.
  * ===========================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -36,12 +38,12 @@ public class Pending {
     
     /**
      * Use this constructor to indicate when last Notified
-     * @param last_notified
+     * @param lastNotified
      */
-    public Pending(Date last_notified) {
+    public Pending(Date lastNotified) {
         qty = 1;
-        hasNew = last_notified==null;
-        earliest = last_notified;
+        hasNew = lastNotified==null;
+        earliest = lastNotified;
     }
 
     /**
index 6f228e0..dfacd81 100644 (file)
@@ -45,7 +45,7 @@ import com.datastax.driver.core.SimpleStatement;
 import com.datastax.driver.core.Statement;
 
 public class LastNotified {
-    private Map<String,Date> lastNotified = new TreeMap<>();
+    private Map<String,Date> lastNotifiedVar = new TreeMap<>();
     private Session session;
     public static final Date NEVER = new Date(0);
     private static final String SELECT = "SELECT user,target,key,last FROM authz.notified";
@@ -67,7 +67,7 @@ public class LastNotified {
             query.append('\'');
             if(cnt>=30) {
                 endQuery(query);
-                add(session.execute(query.toString()),lastNotified, (x,y) -> false);
+                add(session.execute(query.toString()),lastNotifiedVar, (x,y) -> false);
                 query.setLength(0);
                 startQuery(query);
                 cnt=0;
@@ -75,7 +75,7 @@ public class LastNotified {
         }
         if(cnt>0) {
             endQuery(query);
-            add(session.execute(query.toString()),lastNotified, (x,y) -> false);
+            add(session.execute(query.toString()),lastNotifiedVar, (x,y) -> false);
         }
     }
 
@@ -93,7 +93,7 @@ public class LastNotified {
     }
     
     public Date lastNotified(String key) {
-        Date d = lastNotified.get(key);
+        Date d = lastNotifiedVar.get(key);
         return d==null?NEVER:d;
     }
     
@@ -150,7 +150,7 @@ public class LastNotified {
         try {
             Statement stmt = new SimpleStatement( SELECT );
             results = session.execute(stmt);
-            add(results,lastNotified, (fullKey, last) ->  {
+            add(results,lastNotifiedVar, (fullKey, last) ->  {
                 if(delRange.inRange(last)) {
                     String[] params = Split.splitTrim('|', fullKey,3);
                     if(params.length==3) {