From 96c89c2fa3858e9228c15e3573c88268710361d0 Mon Sep 17 00:00:00 2001 From: Instrumental Date: Sat, 8 Dec 2018 00:48:42 -0600 Subject: Refactor Batch: Remove Issue-ID: AAF-670 Change-Id: If5c961500340826e63fb224c10b44d9aed1d6b5e Signed-off-by: Instrumental --- .../java/org/onap/aaf/auth/dao/cass/HistoryDAO.java | 18 ++++++++++++++++++ .../main/java/org/onap/aaf/auth/dao/hl/Question.java | 10 +++++----- 2 files changed, 23 insertions(+), 5 deletions(-) (limited to 'auth/auth-cass') diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/HistoryDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/HistoryDAO.java index a40b28fb..69d1d26e 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/HistoryDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/HistoryDAO.java @@ -171,6 +171,24 @@ public class HistoryDAO extends CassDAOImpl { // data.day_time = Integer.parseInt(dayTimeFormat.format(now)); return data; } + + public void createBatch(StringBuilder sb, Data data) { + sb.append("INSERT INTO history ("); + sb.append(helpers[FIELD_COMMAS]); + sb.append(") VALUES(now(),"); + sb.append(data.yr_mon); + sb.append(",'"); + sb.append(data.user); + sb.append("','"); + sb.append(data.action); + sb.append("','"); + sb.append(data.target); + sb.append("','"); + sb.append(data.subject); + sb.append("','"); + sb.append(data.memo); + sb.append("',null);\n"); + } public Result> readByYYYYMM(AuthzTrans trans, int yyyymm) { Result rs = readByYRMN.exec(trans, "yr_mon", yyyymm); diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Question.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Question.java index f55e1c1c..4a307693 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Question.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Question.java @@ -953,27 +953,27 @@ public class Question { rv = cacheInfoDAO.touch(trans, NsDAO.TABLE, seg); } if (all || PermDAO.TABLE.equals(cname)) { - int seg[] = series(NsDAO.CACHE_SEG); + int seg[] = series(PermDAO.CACHE_SEG); for (int i: seg) {cacheClear(trans, PermDAO.TABLE,i);} rv = cacheInfoDAO.touch(trans, PermDAO.TABLE,seg); } if (all || RoleDAO.TABLE.equals(cname)) { - int seg[] = series(NsDAO.CACHE_SEG); + int seg[] = series(RoleDAO.CACHE_SEG); for (int i: seg) {cacheClear(trans, RoleDAO.TABLE,i);} rv = cacheInfoDAO.touch(trans, RoleDAO.TABLE,seg); } if (all || UserRoleDAO.TABLE.equals(cname)) { - int seg[] = series(NsDAO.CACHE_SEG); + int seg[] = series(UserRoleDAO.CACHE_SEG); for (int i: seg) {cacheClear(trans, UserRoleDAO.TABLE,i);} rv = cacheInfoDAO.touch(trans, UserRoleDAO.TABLE,seg); } if (all || CredDAO.TABLE.equals(cname)) { - int seg[] = series(NsDAO.CACHE_SEG); + int seg[] = series(CredDAO.CACHE_SEG); for (int i: seg) {cacheClear(trans, CredDAO.TABLE,i);} rv = cacheInfoDAO.touch(trans, CredDAO.TABLE,seg); } if (all || CertDAO.TABLE.equals(cname)) { - int seg[] = series(NsDAO.CACHE_SEG); + int seg[] = series(CertDAO.CACHE_SEG); for (int i: seg) {cacheClear(trans, CertDAO.TABLE,i);} rv = cacheInfoDAO.touch(trans, CertDAO.TABLE,seg); } -- cgit 1.2.3-korg