X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-batch%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fbatch%2Fupdate%2FRemove.java;h=4472a314c40d859a446f767d311cb33da2b3a109;hb=e3163b2d5609753f874e2f52fd5ef67fa063af7a;hp=dad03ce52c4e394c4fb761e2dce7bbe6e7ebc015;hpb=4c709df6500a95057a92ec3ea5c739738764388d;p=aaf%2Fauthz.git 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 dad03ce5..4472a314 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 @@ -51,6 +51,7 @@ import org.onap.aaf.cadi.util.CSV; import org.onap.aaf.misc.env.APIException; import org.onap.aaf.misc.env.Env; import org.onap.aaf.misc.env.TimeTaken; +import org.onap.aaf.misc.env.Trans; import org.onap.aaf.misc.env.util.Chrono; public class Remove extends Batch { @@ -74,7 +75,7 @@ public class Remove extends Batch { } finally { tt2.done(); } - cqlBatch = new CQLBatch(noAvg.info(),session); + cqlBatch = new CQLBatch(noAvg.debug(),session); } finally { @@ -138,6 +139,8 @@ public class Remove extends Batch { if(!ur.get()) { ur.set(true); } + //TODO If deleted because Role is no longer there, double check... + UserRole.batchDelete(cbl.inc(),row); hdd.target=UserRoleDAO.TABLE; hdd.subject=UserRole.histSubject(row); @@ -158,8 +161,8 @@ public class Remove extends Batch { if(!x509.get()) { x509.set(true); } - X509.row(cbl.inc(),row); - hdd.target=CertDAO.TABLE; + X509.batchDelete(cbl.inc(),row); + hdd.target="x509"; hdd.subject=X509.histSubject(row); hdd.memo=X509.histMemo(memoFmt.get(),row); historyDAO.createBatch(cbl.inc(), hdd); @@ -183,14 +186,19 @@ public class Remove extends Batch { } } } finally { - if(ur.get()) { - cqlBatch.touch(UserRoleDAO.TABLE, 0, UserRoleDAO.CACHE_SEG, dryRun); - } - if(cred.get()) { - cqlBatch.touch(CredDAO.TABLE, 0, CredDAO.CACHE_SEG, dryRun); - } - if(x509.get()) { - cqlBatch.touch(CertDAO.TABLE, 0, CertDAO.CACHE_SEG, dryRun); + TimeTaken tt = trans.start("Touch UR,Cred and Cert Caches",Trans.REMOTE); + try { + if(ur.get()) { + cqlBatch.touch(UserRoleDAO.TABLE, 0, UserRoleDAO.CACHE_SEG, dryRun); + } + if(cred.get()) { + cqlBatch.touch(CredDAO.TABLE, 0, CredDAO.CACHE_SEG, dryRun); + } + if(x509.get()) { + cqlBatch.touch(CertDAO.TABLE, 0, CertDAO.CACHE_SEG, dryRun); + } + } finally { + tt.done(); } } }