diff options
author | Arundathi Patil <arundpil@in.ibm.com> | 2019-01-18 13:00:22 +0530 |
---|---|---|
committer | IBM602-PC0F1E3C\Arundathi <arundpil@in.ibm.com> | 2019-01-18 13:00:30 +0530 |
commit | 47ec53e7f982e8d75c7a70810d51bb094980b699 (patch) | |
tree | 5dda6d726bfcf98252f113912973e9ca27d4cdfb /auth/auth-cass/src/main/java | |
parent | 9076ab59dd12c15163fe3db948ab554557d545d6 (diff) |
Sonar Fix: ConfigDAO.java
Fixed sonar issues/code-smells across this file
Issue-ID: AAF-721
Change-Id: I14862446a984d07eadc55f1f1ccf7a6d6b1e2a4c
Signed-off-by: Arundathi Patil <arundpil@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/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); } |