X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fmusic%2Fauthentication%2FMusicAuthentication.java;h=6c38e6dfe6659bafeb04ac60b0313a08d155551d;hb=b58e1d3db05aed02b62a557bf14db6ea7b8df5f5;hp=10f1e30c413e38afaadc395d750496881d6fd3fb;hpb=7c2316f479f338c4b0fd9a150d8b858cea3b377c;p=music.git 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();