summaryrefslogtreecommitdiffstats
path: root/auth/auth-batch/src/main/java/org/onap
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2019-11-05 14:19:36 -0600
committerInstrumental <jonathan.gathman@att.com>2019-11-05 14:19:41 -0600
commit83b93fc82cc39590f1f3aa1e92a53f37cd191416 (patch)
tree7a6026e5a3760daadf6b4f45418e77479e932091 /auth/auth-batch/src/main/java/org/onap
parentbc5f9dec37da59182034c1166a6a9d4150f40847 (diff)
Fix Batch Cred Deletes
Issue-ID: AAF-1038 Change-Id: I30ea4ec04cd3ca6c416010f99e46aa44c5f2fd24 Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'auth/auth-batch/src/main/java/org/onap')
-rw-r--r--auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Cred.java5
-rw-r--r--auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/update/Remove.java9
2 files changed, 9 insertions, 5 deletions
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Cred.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Cred.java
index 49309004..4c14f0fd 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Cred.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/helpers/Cred.java
@@ -316,7 +316,7 @@ public class Cred {
}
public static void batchDelete(StringBuilder sb, List<String> row) {
- Long l = Long.parseLong(row.get(5));
+ long l = Long.parseLong(row.get(5));
String date = Chrono.batchFmt.format(new Date(l));
sb.append("DELETE from authz.cred WHERE id='");
sb.append(row.get(1));
@@ -326,9 +326,6 @@ public class Cred {
sb.append(" AND expires='");
sb.append(date);
sb.append("';\n");
-// sb.append(" AND expires=dateof(maxtimeuuid(");
-// sb.append(row.get(5));
-// sb.append("));\n");
}
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/update/Remove.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/update/Remove.java
index 087ab952..3d26ce99 100644
--- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/update/Remove.java
+++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/batch/update/Remove.java
@@ -94,7 +94,14 @@ public class Remove extends Batch {
remove.add(new File(logDir, args()[i]));
}
} else {
- remove.add(new File(logDir,"Delete"+Chrono.dateOnlyStamp()+".csv"));
+ final String ending = Chrono.dateOnlyStamp()+".csv";
+ for (File file : logDir.listFiles(f -> {
+ String name = f.getName();
+ return name.endsWith(ending) && (
+ name.startsWith("Delete") || name.startsWith("Clean."));
+ })) {
+ remove.add(file);
+ };
}
for(File f : remove) {