From de47cea9e656dabfbf3608287238041ab263f05e Mon Sep 17 00:00:00 2001 From: "Thomas Nelson Jr (arthurdent3) tn1381@att.com" Date: Thu, 22 Mar 2018 00:25:28 -0400 Subject: Fix for HAS to run its CSIT Default action of AID(AuthID) was to allow only one keyspace. HAS required the ability to create more than one. Also included are some Logging and response fixes. Change-Id: I30b7d0f5a5c6e535ff2b737dc58b8d4fbd427d02 Issue-ID: MUSIC-64, OPTFRA-191 Signed-off-by: Thomas Nelson Jr (arthurdent3) tn1381@att.com --- .../java/org/onap/music/rest/RestMusicAdminAPI.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/main/java/org/onap/music/rest/RestMusicAdminAPI.java') diff --git a/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java b/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java index b8008791..2d7aa833 100755 --- a/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java +++ b/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java @@ -92,6 +92,7 @@ public class RestMusicAdminAPI { if (!rs.all().isEmpty()) { resultMap.put("Exception", "Application " + appName + " has already been onboarded. Please contact admin."); + response.setStatus(400); return resultMap; } @@ -113,6 +114,7 @@ public class RestMusicAdminAPI { if (returnStr.contains("Failure")) { resultMap.put("Exception", "Oops. Something wrong with onboarding process. Please retry later or contact admin."); + response.setStatus(400); return resultMap; } CachingUtil.updateisAAFCache(appName, isAAF); @@ -173,11 +175,15 @@ public class RestMusicAdminAPI { resultMap.put( row.getUUID("uuid").toString(),row.getString("keyspace_name")); } if (resultMap.isEmpty()) { - if(uuid != null) + if(uuid != null) { resultMap.put("Exception", "Please make sure Aid is correct and application is onboarded."); - else { + response.setStatus(400); + return resultMap; + }else { resultMap.put("Exception", "Application is not onboarded. Please make sure all the information is correct."); + response.setStatus(400); + return resultMap; } } return resultMap; @@ -224,7 +230,7 @@ public class RestMusicAdminAPI { if (result==ResultType.SUCCESS) { resultMap.put("Success", "Your application has been deleted successfully"); } else { - resultMap.put("Exception","Oops. Spomething went wrong. Please make sure Aid is correct or Application is onboarded"); + resultMap.put("Exception","Oops. Something went wrong. Please make sure Aid is correct or Application is onboarded"); logger.error(EELFLoggerDelegate.errorLogger,"", AppMessages.INCORRECTDATA ,ErrorSeverity.CRITICAL, ErrorTypes.DATAERROR); response.setStatus(400); return resultMap; @@ -273,9 +279,8 @@ public class RestMusicAdminAPI { resultMap.put("Failure", "More than one Aid exists for this application, so please provide Aid."); logger.error(EELFLoggerDelegate.errorLogger,"", AppMessages.MULTIPLERECORDS ,ErrorSeverity.CRITICAL, ErrorTypes.DATAERROR); response.setStatus(400); + return resultMap; } - - return resultMap; } @@ -355,9 +360,10 @@ public class RestMusicAdminAPI { resultMap.put("Success", "Your application has been updated successfully"); } else { resultMap.put("Exception", - "Oops. Spomething went wrong. Please make sure Aid is correct and application is onboarded"); + "Oops. Something went wrong. Please make sure Aid is correct and application is onboarded"); logger.error(EELFLoggerDelegate.errorLogger,"", AppMessages.INCORRECTDATA ,ErrorSeverity.CRITICAL, ErrorTypes.DATAERROR); response.setStatus(400); + return resultMap; } return resultMap; -- cgit 1.2.3-korg