diff options
author | Jonathan Gathman <jonathan.gathman@att.com> | 2019-01-22 12:17:06 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-01-22 12:17:06 +0000 |
commit | a5bcce655e339151445fbce2c129687e3bc8610a (patch) | |
tree | eecae9c6a801fd913d825bb3e29e0a943a307dbd /auth/auth-cass/src | |
parent | 061beab89414fa7c855f6356a407e6ace36f438a (diff) | |
parent | 47ec53e7f982e8d75c7a70810d51bb094980b699 (diff) |
Merge "Sonar Fix: ConfigDAO.java"
Diffstat (limited to 'auth/auth-cass/src')
-rw-r--r-- | auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/ConfigDAO.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/ConfigDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/ConfigDAO.java index 398e7323..9f402adc 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/ConfigDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/ConfigDAO.java @@ -3,6 +3,8 @@ * org.onap.aaf * =========================================================================== * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * Modifications Copyright (C) 2018-19 IBM. * =========================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,21 +45,21 @@ import com.datastax.driver.core.Row; * Date: 6/25/18 */ public class ConfigDAO extends CassDAOImpl<AuthzTrans,ConfigDAO.Data> { - public static final String TABLE = "config"; + public static final String TABLE_NAME = "config"; public static final int CACHE_SEG = 0x40; // yields segment 0x0-0x3F + public static final int KEYLIMIT = 2; private PSInfo psName; public ConfigDAO(AuthzTrans trans, Cluster cluster, String keyspace) throws APIException, IOException { - super(trans, ConfigDAO.class.getSimpleName(),cluster, keyspace, Data.class,TABLE, readConsistency(trans,TABLE), writeConsistency(trans,TABLE)); + super(trans, ConfigDAO.class.getSimpleName(),cluster, keyspace, Data.class,TABLE_NAME, readConsistency(trans,TABLE_NAME), writeConsistency(trans,TABLE_NAME)); init(trans); } public ConfigDAO(AuthzTrans trans, AbsCassDAO<AuthzTrans,?> aDao) throws APIException, IOException { - super(trans, ConfigDAO.class.getSimpleName(),aDao, Data.class,TABLE, readConsistency(trans,TABLE), writeConsistency(trans,TABLE)); + super(trans, ConfigDAO.class.getSimpleName(),aDao, Data.class,TABLE_NAME, readConsistency(trans,TABLE_NAME), writeConsistency(trans,TABLE_NAME)); init(trans); } - - public static final int KEYLIMIT = 2; + public static class Data { public String name; public String tag; @@ -113,9 +115,9 @@ public class ConfigDAO extends CassDAOImpl<AuthzTrans,ConfigDAO.Data> { } private void init(AuthzTrans trans) throws APIException, IOException { - String[] helpers = setCRUD(trans, TABLE, Data.class, ConfigLoader.deflt); + String[] helpers = setCRUD(trans, TABLE_NAME, Data.class, ConfigLoader.deflt); - psName = new PSInfo(trans, SELECT_SP + helpers[FIELD_COMMAS] + " FROM " + TABLE + + psName = new PSInfo(trans, SELECT_SP + helpers[FIELD_COMMAS] + " FROM " + TABLE_NAME + " WHERE name = ?", ConfigLoader.deflt,readConsistency); } |