aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org
diff options
context:
space:
mode:
authorDriptaroop Das <driptaroop.das@in.ibm.com>2019-02-01 01:14:43 +0530
committerBrendan Tschaen <ctschaen@att.com>2019-01-31 21:20:49 +0000
commitfb745184ca27f81f270884023a10dd2219a526c1 (patch)
treefc6d1d4b3dc5d40109454964d089c5bb28f5e190 /src/main/java/org
parent7a6ad9831c7009f85ad881a695529fdc0246c3a6 (diff)
MusicHealthCheck.java - Multiple Sonar Fixes
MusicHealthCheck.java - Multiple Sonar Fixes Issue-ID: MUSIC-302 Change-Id: I8e9b8be0d35b5a8d3042ffe056b4d29c5bb7888e Signed-off-by: Driptaroop Das <driptaroop.das@in.ibm.com>
Diffstat (limited to 'src/main/java/org')
-rw-r--r--src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java b/src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java
index 93c44468..7cff9d30 100644
--- a/src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java
+++ b/src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java
@@ -83,20 +83,12 @@ public class MusicHealthCheck {
}
private Boolean getAdminKeySpace(String consistency) throws MusicServiceException {
-
-
PreparedQueryObject pQuery = new PreparedQueryObject();
pQuery.appendQueryString("insert into admin.healthcheck (id) values (?)");
pQuery.addValue(UUID.randomUUID());
- ResultType rs = MusicCore.nonKeyRelatedPut(pQuery, consistency);
- logger.info(rs.toString());
- if (rs != null) {
- return Boolean.TRUE;
- } else {
- return Boolean.FALSE;
- }
-
-
+ ResultType rs = MusicCore.nonKeyRelatedPut(pQuery, consistency);
+ logger.info(rs.toString());
+ return null != rs;
}
private boolean createKeyspace() {
@@ -110,10 +102,7 @@ public class MusicHealthCheck {
e.printStackTrace();
logger.error("Error", e);
}
- if(rs != null && rs.getResult().toLowerCase().contains("success"))
- return true;
- else
- return false;
+ return rs != null && rs.getResult().toLowerCase().contains("success");
}
public String getZookeeperStatus() {