diff options
author | Sai Gandham <sai.gandham@att.com> | 2019-03-07 20:01:20 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-03-07 20:01:20 +0000 |
commit | a50007dcded86acc2dcd610810f8afac720a058a (patch) | |
tree | cc0fb58c1191da21ae6a05ce0414ec87a1b303e7 /auth/auth-cass/src | |
parent | 74ca7155fe903094350ab68f3ec6ac3dfe4e32b8 (diff) | |
parent | a174f8ddbc5eb78a648fb68b33ef18cb64d81fda (diff) |
Merge "Improve Batches"
Diffstat (limited to 'auth/auth-cass/src')
3 files changed, 29 insertions, 18 deletions
diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/ApprovalDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/ApprovalDAO.java index cc4135ee..4c66c964 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/ApprovalDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/ApprovalDAO.java @@ -76,7 +76,7 @@ public class ApprovalDAO extends CassDAOImpl<AuthzTrans,ApprovalDAO.Data> { public String status; public String memo; public String operation; - public Date last_notified; +// public Date last_notified; public Date updated; } @@ -97,11 +97,11 @@ public class ApprovalDAO extends CassDAOImpl<AuthzTrans,ApprovalDAO.Data> { data.status = row.getString(5); data.memo = row.getString(6); data.operation = row.getString(7); - data.last_notified = row.getTimestamp(8); +// data.last_notified = row.getTimestamp(8); // This is used to get "WRITETIME(STATUS)" from Approval, which gives us an "updated" - if (row.getColumnDefinitions().size()>9) { + if (row.getColumnDefinitions().size()>8) { // Rows reported in MicroSeconds - data.updated = new Date(row.getLong(9)/1000); + data.updated = new Date(row.getLong(8)/1000); } return data; } @@ -121,12 +121,12 @@ public class ApprovalDAO extends CassDAOImpl<AuthzTrans,ApprovalDAO.Data> { obj[++idx]=data.status; obj[++idx]=data.memo; obj[++idx]=data.operation; - obj[++idx]=data.last_notified; +// obj[++idx]=data.last_notified; } } private void init(AuthzTrans trans) { - String[] helpers = setCRUD(trans, TABLE, Data.class, ApprovalLoader.deflt,9); + String[] helpers = setCRUD(trans, TABLE, Data.class, ApprovalLoader.deflt,8); psByUser = new PSInfo(trans, SELECT_SP + helpers[FIELD_COMMAS] + ", WRITETIME(status) FROM " + TABLE + " WHERE user = ?", new ApprovalLoader(1) { @Override diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/CredDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/CredDAO.java index 9a47e576..01cc9237 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/CredDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/CredDAO.java @@ -84,6 +84,7 @@ public class CredDAO extends CassDAOImpl<AuthzTrans,CredDAO.Data> { public Integer other; public String ns; public String tag; + public String notes; public ByteBuffer cred; // this is a blob in cassandra @@ -129,7 +130,8 @@ public class CredDAO extends CassDAOImpl<AuthzTrans,CredDAO.Data> { data.other = row.getInt(3); data.ns = row.getString(4); data.tag = row.getString(5); - data.cred = row.getBytesUnsafe(6); + data.notes = row.getString(6); + data.cred = row.getBytesUnsafe(7); return data; } @@ -148,6 +150,7 @@ public class CredDAO extends CassDAOImpl<AuthzTrans,CredDAO.Data> { obj[i=idx] = data.other; obj[++i] = data.ns; obj[++i] = data.tag; + obj[++i] = data.notes; obj[++i] = data.cred; } @@ -160,6 +163,7 @@ public class CredDAO extends CassDAOImpl<AuthzTrans,CredDAO.Data> { os.writeInt(data.other==null?0:data.other); writeString(os, data.ns); writeString(os, data.tag); + writeString(os, data.notes); if (data.cred==null) { os.writeInt(-1); } else { @@ -182,6 +186,7 @@ public class CredDAO extends CassDAOImpl<AuthzTrans,CredDAO.Data> { data.other = is.readInt(); data.ns = readString(is,buff); data.tag = readString(is,buff); + data.notes = readString(is,buff); int i = is.readInt(); data.cred=null; diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/FutureDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/FutureDAO.java index 10c0ec97..7831815f 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/FutureDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/FutureDAO.java @@ -65,11 +65,13 @@ public class FutureDAO extends CassDAOImpl<AuthzTrans,FutureDAO.Data> { public static class Data { public UUID id; - public String target; - public String memo; - public Date start; - public Date expires; - public ByteBuffer construct; // this is a blob in cassandra + public String target; + public String memo; + public Date start; + public Date expires; + public String target_key; + public Date target_date; + public ByteBuffer construct; // this is a blob in cassandra } private static class FLoader extends Loader<Data> { @@ -83,12 +85,14 @@ public class FutureDAO extends CassDAOImpl<AuthzTrans,FutureDAO.Data> { @Override public Data load(Data data, Row row) { - data.id = row.getUUID(0); - data.target = row.getString(1); - data.memo = row.getString(2); - data.start = row.getTimestamp(3); - data.expires = row.getTimestamp(4); - data.construct = row.getBytes(5); + data.id = row.getUUID(0); + data.target = row.getString(1); + data.memo = row.getString(2); + data.start = row.getTimestamp(3); + data.expires = row.getTimestamp(4); + data.construct = row.getBytes(5); + data.target_key = row.getString(6); + data.target_date = row.getTimestamp(7); return data; } @@ -106,6 +110,8 @@ public class FutureDAO extends CassDAOImpl<AuthzTrans,FutureDAO.Data> { obj[++idx] = data.start; obj[++idx] = data.expires; obj[++idx] = data.construct; + obj[++idx] = data.target_key; + obj[++idx] = data.target_date; } } |