* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
} finally {
tt2.done();
}
- cqlBatch = new CQLBatch(noAvg.info(),session);
-
-
+ cqlBatch = new CQLBatch(noAvg.info(),session);
} finally {
tt0.done();
}
@Override
protected void run(AuthzTrans trans) {
- // Create Intermediate Output
+ // Create Intermediate Output
File logDir = logDir();
List<File> remove = new ArrayList<>();
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) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM");
hdd.yr_mon = Integer.parseInt(sdf.format(new Date()));
- try {
+ try {
final CQLBatchLoop cbl = new CQLBatchLoop(cqlBatch,50,dryRun);
for(File f : remove) {
trans.info().log("Processing ",f.getAbsolutePath(),"for Deletions");
ur.set(true);
}
//TODO If deleted because Role is no longer there, double check...
-
+
UserRole.batchDelete(cbl.inc(),row);
- hdd.target=UserRoleDAO.TABLE;
+ hdd.target=UserRoleDAO.TABLE;
hdd.subject=UserRole.histSubject(row);
hdd.memo=UserRole.histMemo(memoFmt.get(), row);
historyDAO.createBatch(cbl.inc(), hdd);
cred.set(true);
}
Cred.batchDelete(cbl.inc(),row);
- hdd.target=CredDAO.TABLE;
+ hdd.target=CredDAO.TABLE;
hdd.subject=Cred.histSubject(row);
hdd.memo=Cred.histMemo(memoFmt.get(), orgName,row);
historyDAO.createBatch(cbl.inc(), hdd);
x509.set(true);
}
X509.batchDelete(cbl.inc(),row);
- hdd.target="x509";
+ hdd.target="x509";
hdd.subject=X509.histSubject(row);
hdd.memo=X509.histMemo(memoFmt.get(),row);
historyDAO.createBatch(cbl.inc(), hdd);