diff options
author | ezhil <ezhrajam@in.ibm.com> | 2018-11-28 22:59:35 +0530 |
---|---|---|
committer | ezhil <ezhrajam@in.ibm.com> | 2018-11-28 22:59:47 +0530 |
commit | df40ceda123528e27df349a9716a1a0116235e6c (patch) | |
tree | 58e0ffd4dc1de84f293da87310032317abd3d611 /auth/auth-cass/src/main/java | |
parent | dfe29e3ea4028ff04f73606f46404baf63f81f5b (diff) |
Fixed sonar issues in FutureDAO.java
Fixed Sonar issues
Issue-ID: AAF-648
Change-Id: I45feb124a17aafd6192c024d63200b20ce3ef768
Signed-off-by: ezhil <ezhrajam@in.ibm.com>
Diffstat (limited to 'auth/auth-cass/src/main/java')
-rw-r--r-- | auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/FutureDAO.java | 17 |
1 files changed, 6 insertions, 11 deletions
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 a98f101f..96cbf28a 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 @@ -4,6 +4,8 @@ * =========================================================================== * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. * =========================================================================== + * Modifications Copyright (C) 2018 IBM. + * ============================================================================== * 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 @@ -46,9 +48,9 @@ import com.datastax.driver.core.Row; public class FutureDAO extends CassDAOImpl<AuthzTrans,FutureDAO.Data> { private static final String TABLE = "future"; private final HistoryDAO historyDAO; -// private static String createString; private PSInfo psByStartAndTarget; - + public static final int KEYLIMIT = 1; + public FutureDAO(AuthzTrans trans, Cluster cluster, String keyspace) { super(trans, FutureDAO.class.getSimpleName(),cluster, keyspace, Data.class,TABLE, readConsistency(trans,TABLE), writeConsistency(trans,TABLE)); historyDAO = new HistoryDAO(trans, this); @@ -61,7 +63,7 @@ public class FutureDAO extends CassDAOImpl<AuthzTrans,FutureDAO.Data> { init(trans); } - public static final int KEYLIMIT = 1; + public static class Data { public UUID id; public String target; @@ -112,13 +114,6 @@ public class FutureDAO extends CassDAOImpl<AuthzTrans,FutureDAO.Data> { // Set up sub-DAOs String[] helpers = setCRUD(trans, TABLE, Data.class, new FLoader(KEYLIMIT)); - // Uh, oh. Can't use "now()" in Prepared Statements (at least at this level) -// createString = "INSERT INTO " + TABLE + " ("+helpers[FIELD_COMMAS] +") VALUES (now(),"; -// -// // Need a specialty Creator to handle the "now()" -// replace(CRUD.Create, new PSInfo(trans, "INSERT INTO future (" + helpers[FIELD_COMMAS] + -// ") VALUES(now(),?,?,?,?,?)",new FLoader(0))); - // Other SELECT style statements... match with a local Method psByStartAndTarget = new PSInfo(trans, SELECT_SP + helpers[FIELD_COMMAS] + " FROM future WHERE start <= ? and target = ? ALLOW FILTERING", new FLoader(2) { @@ -134,7 +129,7 @@ public class FutureDAO extends CassDAOImpl<AuthzTrans,FutureDAO.Data> { } - public Result<List<Data>> readByStartAndTarget(AuthzTrans trans, Date start, String target) throws DAOException { + public Result<List<Data>> readByStartAndTarget(AuthzTrans trans, Date start, String target) { return psByStartAndTarget.read(trans, R_TEXT, new Object[]{start, target}); } |