aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/music/rest/RestMusicAdminAPI.java
diff options
context:
space:
mode:
authorThomas Nelson Jr (arthurdent3) tn1381@att.com <tn1381@att.com>2018-03-22 00:25:28 -0400
committerThomas Nelson Jr (arthurdent3) tn1381@att.com <tn1381@att.com>2018-03-22 00:25:28 -0400
commitde47cea9e656dabfbf3608287238041ab263f05e (patch)
treea05e73a52dd1ff7458ffbc9c341c42a7bc052f0b /src/main/java/org/onap/music/rest/RestMusicAdminAPI.java
parente0a891de60058eab2b92082f7cc2dde59f0f42be (diff)
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 <tn1381@att.com>
Diffstat (limited to 'src/main/java/org/onap/music/rest/RestMusicAdminAPI.java')
-rwxr-xr-xsrc/main/java/org/onap/music/rest/RestMusicAdminAPI.java18
1 files changed, 12 insertions, 6 deletions
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;