Bring over Extend Batch programs
[aaf/authz.git] / auth / auth-batch / src / main / java / org / onap / aaf / auth / batch / helpers / Cred.java
index 979cdf0..c4a9b0d 100644 (file)
@@ -138,13 +138,14 @@ public class Cred  {
                     row = iter.next();
                     int type = row.getInt(1);
                     if (types.length>0) { // filter by types, if requested
-                        boolean quit = true;
+                        boolean hastype = false;
                         for (int t : types) {
                             if (t==type) {
+                               hastype=true;
                                 break;
                             }
                         }
-                        if (quit) {
+                        if (!hastype) {
                             continue;
                         }
                     }
@@ -280,7 +281,7 @@ public class Cred  {
     }
 
 
-    public static void row(StringBuilder sb, List<String> row) {
+    public static void batchDelete(StringBuilder sb, List<String> row) {
        sb.append("DELETE from authz.cred WHERE id='");
        sb.append(row.get(1));
        sb.append("' AND type=");
@@ -291,7 +292,6 @@ public class Cred  {
        sb.append("));\n");
        }
 
-
        public String toString() {
         StringBuilder sb = new StringBuilder(id);
         sb.append('[');
@@ -322,4 +322,14 @@ public class Cred  {
         return id.equals(obj);
     }
 
+
+       public static String histSubject(List<String> row) {
+               return row.get(1);
+       }
+
+
+       public static String histMemo(String fmt, String orgName, List<String> row) {
+               return String.format(fmt, row.get(1),orgName,row.get(4));
+       }
+
 }
\ No newline at end of file