summaryrefslogtreecommitdiffstats
path: root/dblib/provider/src/main/java/org
diff options
context:
space:
mode:
authorRich Tabedzki <richard.tabedzki@att.com>2018-03-08 14:50:22 +0000
committerRich Tabedzki <richard.tabedzki@att.com>2018-03-08 20:30:06 +0000
commita9e89cccc344b5f1aecbe3936f6bb917cfe7b20f (patch)
treeb1e22599114a52ec585fc9c85a6b85368bf0cd2f /dblib/provider/src/main/java/org
parent168181418de462c53f7c0c326ea3ce5200467f09 (diff)
Fix sonar related items
Changes made: * Optimized TerminatingCachedDataSource * Added additional unit tests Change-Id: I0a83c993898e2bee11b8d3c5df8f95b4b216e9b8 Issue-ID: CCSDK-151 Signed-off-by: Rich Tabedzki <richard.tabedzki@att.com>
Diffstat (limited to 'dblib/provider/src/main/java/org')
-rwxr-xr-xdblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java3
-rwxr-xr-xdblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/TerminatingCachedDataSource.java46
-rwxr-xr-xdblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/jdbc/JdbcDBCachedDataSource.java1
3 files changed, 2 insertions, 48 deletions
diff --git a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java
index 27c14d2a4..9acae340b 100755
--- a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java
+++ b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java
@@ -248,7 +248,8 @@ public class DBResourceManager implements DataSource, DataAccessor, DBResourceOb
} catch(Exception exc) {
LOGGER.warn("", exc);
}
- LOGGER.info("Thread DataSourceTester terminated {} for {}", this.getName(), ds.getDbConnectionName());
+ if(ds != null)
+ LOGGER.info("Thread DataSourceTester terminated {} for {}", this.getName(), ds.getDbConnectionName());
}
}
diff --git a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/TerminatingCachedDataSource.java b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/TerminatingCachedDataSource.java
index 92b31470e..e1afcc22e 100755
--- a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/TerminatingCachedDataSource.java
+++ b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/TerminatingCachedDataSource.java
@@ -39,53 +39,7 @@ public class TerminatingCachedDataSource extends CachedDataSource implements SQL
}
@Override
- public long getInterval() {
- return 1000;
- }
-
- @Override
- public long getInitialDelay() {
- return 1000;
- }
-
- @Override
- public long getExpectedCompletionTime() {
- return 50;
- }
-
- @Override
- public void setExpectedCompletionTime(long value) {
-
- }
-
- @Override
- public void setInterval(long value) {
-
- }
-
- @Override
- public void setInitialDelay(long value) {
-
- }
-
- @Override
- public long getUnprocessedFailoverThreshold() {
- return 3;
- }
-
- @Override
- public void setUnprocessedFailoverThreshold(long value) {
-
- }
-
- public int compareTo(CachedDataSource ods)
- {
- return 0;
- }
-
- @Override
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
- // TODO Auto-generated method stub
return null;
}
diff --git a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/jdbc/JdbcDBCachedDataSource.java b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/jdbc/JdbcDBCachedDataSource.java
index a6582b9e7..80ca577cf 100755
--- a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/jdbc/JdbcDBCachedDataSource.java
+++ b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/jdbc/JdbcDBCachedDataSource.java
@@ -180,7 +180,6 @@ public class JdbcDBCachedDataSource extends CachedDataSource {
public java.util.logging.Logger getParentLogger()
throws SQLFeatureNotSupportedException {
- // TODO Auto-generated method stub
return null;
}