diff options
author | Thomas Nelson Jr (arthurdent3) tn1381@att.com <tn1381@att.com> | 2018-03-08 01:55:21 -0500 |
---|---|---|
committer | Thomas Nelson Jr (arthurdent3) tn1381@att.com <tn1381@att.com> | 2018-03-08 01:55:21 -0500 |
commit | ed47d0c5d004b1ce099090100dda6dc1d963782c (patch) | |
tree | c8ed27f9b18206ddd68bd1cdd20d687b965ae8c3 /src/main/java/org/onap/music/main/CachingUtil.java | |
parent | 64cf8e703644f01ef1efde65c86a60ec3e377a5a (diff) |
Docker Updates for CSIT
Udates fro Docker and also a few bug fixes.
Change-Id: I48d8ee81412c7ce664e6b3e33c06e952afad734e
Issue-ID: MUSIC-32, MUSIC-51
Signed-off-by: Thomas Nelson Jr (arthurdent3) tn1381@att.com <tn1381@att.com>
Diffstat (limited to 'src/main/java/org/onap/music/main/CachingUtil.java')
-rwxr-xr-x | src/main/java/org/onap/music/main/CachingUtil.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/main/java/org/onap/music/main/CachingUtil.java b/src/main/java/org/onap/music/main/CachingUtil.java index 40dffa2d..aee3abbf 100755 --- a/src/main/java/org/onap/music/main/CachingUtil.java +++ b/src/main/java/org/onap/music/main/CachingUtil.java @@ -392,11 +392,9 @@ public class CachingUtil implements Runnable { } PreparedQueryObject queryObject = new PreparedQueryObject(); queryObject.appendQueryString( - "select * from admin.keyspace_master where application_name = ? and username = ? and password = ? allow filtering"); + "select * from admin.keyspace_master where application_name = ? allow filtering"); try { queryObject.addValue(MusicUtil.convertToActualDataType(DataType.text(), ns)); - queryObject.addValue(MusicUtil.convertToActualDataType(DataType.text(), userId)); - queryObject.addValue(MusicUtil.convertToActualDataType(DataType.text(), password)); } catch(Exception e) { resultMap.put("Exception", "Unable to process input data. Invalid input data type. Please check ns, userId and password values. "+e.getMessage()); @@ -412,16 +410,20 @@ public class CachingUtil implements Runnable { return resultMap; } if (rs == null) { - logger.error(EELFLoggerDelegate.errorLogger,"", AppMessages.AUTHENTICATIONERROR, ErrorSeverity.WARN, ErrorTypes.AUTHENTICATIONERROR); - logger.error(EELFLoggerDelegate.errorLogger,"Namespace, UserId and password doesn't match. namespace: "+ns+" and userId: "+userId); - - resultMap.put("Exception", "Namespace, UserId and password doesn't match. namespace: "+ns+" and userId: "+userId); + logger.error(EELFLoggerDelegate.errorLogger,"Application is not onboarded. Please contact admin."); + resultMap.put("Exception", "Application is not onboarded. Please contact admin."); } else { + if(!(rs.getString("username").equals(userId)) && !(rs.getString("password").equals("password"))) { + logger.error(EELFLoggerDelegate.errorLogger,"", AppMessages.AUTHENTICATIONERROR, ErrorSeverity.WARN, ErrorTypes.AUTHENTICATIONERROR); + logger.error(EELFLoggerDelegate.errorLogger,"Namespace, UserId and password doesn't match. namespace: "+ns+" and userId: "+userId); + resultMap.put("Exception", "Namespace, UserId and password doesn't match. namespace: "+ns+" and userId: "+userId); + return resultMap; + } boolean is_aaf = rs.getBool("is_aaf"); String keyspace = rs.getString("keyspace_name"); if (!is_aaf) { if (!keyspace.equals(MusicUtil.DEFAULTKEYSPACENAME)) { - logger.error(EELFLoggerDelegate.errorLogger,"", AppMessages.MISSINGINFO ,ErrorSeverity.WARN, ErrorTypes.DATAERROR); + logger.error(EELFLoggerDelegate.errorLogger,"", AppMessages.MISSINGINFO ,ErrorSeverity.WARN, ErrorTypes.DATAERROR); logger.error(EELFLoggerDelegate.errorLogger,"Non AAF applications are allowed to have only one keyspace per application."); resultMap.put("Exception", "Non AAF applications are allowed to have only one keyspace per application."); |