From b58e1d3db05aed02b62a557bf14db6ea7b8df5f5 Mon Sep 17 00:00:00 2001 From: "Tschaen, Brendan" Date: Mon, 25 Feb 2019 17:31:00 -0500 Subject: Remove zookeeper reference Test cachingUtil, and other test coverage increase Remove unused code Rebased ontop of authentication changes Change-Id: I795a9a90d0863b03cc2a4917d4ff13a0a6fca1cc Issue-ID: MUSIC-341 Signed-off-by: Tschaen, Brendan --- .../onap/music/authentication/MusicAuthentication.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/main/java/org/onap/music/authentication/MusicAuthentication.java') diff --git a/src/main/java/org/onap/music/authentication/MusicAuthentication.java b/src/main/java/org/onap/music/authentication/MusicAuthentication.java index 10f1e30c..6c38e6df 100644 --- a/src/main/java/org/onap/music/authentication/MusicAuthentication.java +++ b/src/main/java/org/onap/music/authentication/MusicAuthentication.java @@ -62,8 +62,7 @@ public class MusicAuthentication implements MusicAuthenticator { */ @Deprecated public static Map autheticateUser(String nameSpace, String userId, - String password, String keyspace, String aid, String operation) - throws Exception { + String password, String keyspace, String aid, String operation) { logger.info(EELFLoggerDelegate.applicationLogger,"Inside User Authentication......."); Map resultMap = new HashMap<>(); String uuid = null; @@ -132,10 +131,17 @@ public class MusicAuthentication implements MusicAuthenticator { PreparedQueryObject pQuery = new PreparedQueryObject(); pQuery.appendQueryString( "select uuid from admin.keyspace_master where application_name=? and username=? and keyspace_name=? allow filtering"); - pQuery.addValue(MusicUtil.convertToActualDataType(DataType.text(), nameSpace)); - pQuery.addValue(MusicUtil.convertToActualDataType(DataType.text(), userId)); - pQuery.addValue(MusicUtil.convertToActualDataType(DataType.text(), - MusicUtil.DEFAULTKEYSPACENAME)); + try { + pQuery.addValue(MusicUtil.convertToActualDataType(DataType.text(), nameSpace)); + pQuery.addValue(MusicUtil.convertToActualDataType(DataType.text(), userId)); + pQuery.addValue(MusicUtil.convertToActualDataType(DataType.text(), + MusicUtil.DEFAULTKEYSPACENAME)); + } catch (Exception e1) { + logger.error(EELFLoggerDelegate.errorLogger, e1, "Can not authenticate for createkeyspace", AppMessages.MISSINGINFO ,ErrorSeverity.WARN, ErrorTypes.AUTHENTICATIONERROR); + resultMap.put("Exception", "Cannot authenticate for createKeyspace"); + return resultMap; + } + try { Row rs = MusicCore.get(pQuery).one(); -- cgit 1.2.3-korg