diff options
author | Thomas Nelson <nelson24@att.com> | 2019-02-20 18:55:43 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-02-20 18:55:43 +0000 |
commit | d5fc44114502279cd20a65a420e18f03b205c9ad (patch) | |
tree | 03924c4e5dc3562cb76a58e5657901f571950dc6 /src/main/java/org | |
parent | 50bd365f7e30337a21806cd292e75c3f03985b79 (diff) | |
parent | fb745184ca27f81f270884023a10dd2219a526c1 (diff) |
Merge "MusicHealthCheck.java - Multiple Sonar Fixes"
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java | 19 |
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 3e962a02..1f9fe5ba 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() { @@ -108,10 +100,7 @@ public class MusicHealthCheck { } catch (MusicServiceException e) { logger.error(EELFLoggerDelegate.errorLogger, e.getMessage(),AppMessages.UNKNOWNERROR, ErrorSeverity.ERROR, ErrorTypes.UNKNOWN); } - if(rs != null && rs.getResult().toLowerCase().contains("success")) - return true; - else - return false; + return rs != null && rs.getResult().toLowerCase().contains("success"); } public String getZookeeperStatus() { |