aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/music/authentication/MusicAuthentication.java
diff options
context:
space:
mode:
authorTschaen, Brendan <ctschaen@att.com>2019-02-25 17:31:00 -0500
committerTschaen, Brendan <ctschaen@att.com>2019-02-26 11:51:24 -0500
commitb58e1d3db05aed02b62a557bf14db6ea7b8df5f5 (patch)
tree52efe61d7a948c98d088b6c09e3a31fdc41f801f /src/main/java/org/onap/music/authentication/MusicAuthentication.java
parent7c2316f479f338c4b0fd9a150d8b858cea3b377c (diff)
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 <ctschaen@att.com>
Diffstat (limited to 'src/main/java/org/onap/music/authentication/MusicAuthentication.java')
-rw-r--r--src/main/java/org/onap/music/authentication/MusicAuthentication.java18
1 files changed, 12 insertions, 6 deletions
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<String, Object> 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<String, Object> 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();