diff options
author | st782s <statta@research.att.com> | 2017-07-14 14:19:22 -0400 |
---|---|---|
committer | st782s <statta@research.att.com> | 2017-07-14 14:29:49 -0400 |
commit | 3aec9d2ab7f373a12e052d5e2c1c59b2a19770dc (patch) | |
tree | fd13e4b474891a3efa1320524026d7ddad757297 /ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/RestApiRequestBuilder.java | |
parent | 30b8e1fd4328ea37fc5599f8a9723ea79ae0e369 (diff) |
[Portal 21] Role management
This push includes continuation of the changes required to handle
cetralized roles,user management
Change-Id: I38e9dc946ff53ac61dd3b580c335f4ad52b372f7
Signed-off-by: st782s <statta@research.att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/RestApiRequestBuilder.java')
-rw-r--r-- | ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/RestApiRequestBuilder.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/RestApiRequestBuilder.java b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/RestApiRequestBuilder.java index 6a2f7a47..f7a9cbec 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/RestApiRequestBuilder.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/openecomp/portalsdk/core/service/RestApiRequestBuilder.java @@ -19,7 +19,7 @@ public class RestApiRequestBuilder { public static String content_type = "application/json"; - public String getViaREST(String restEndPoint, boolean isBasicAuth,String userId) { + public String getViaREST(String restEndPoint, boolean isBasicAuth,String userId) throws Exception { String appName = ""; String requestId = ""; String appUserName = ""; @@ -51,13 +51,14 @@ public class RestApiRequestBuilder { response = RestWebServiceClient.getInstance().getPortalContent(restEndPoint, userId,appName, requestId, appUserName, decryptedPwd, isBasicAuth); } catch (Exception ex) { - response = "Failed to get roles " + ex.toString(); + response = "Failed to perform GET " + ex.toString(); + throw new Exception(ex.getMessage()); } logger.debug(EELFLoggerDelegate.debugLogger, "getRoles response: {}", response); return response; } - public void postViaREST(String restEndPoint, boolean isBasicAuth, String content,String userId) { + public void postViaREST(String restEndPoint, boolean isBasicAuth, String content,String userId) throws Exception { String appName = ""; String requestId = ""; String appUserName = ""; @@ -90,12 +91,13 @@ public class RestApiRequestBuilder { decryptedPwd, content_type, content, isBasicAuth); } catch (Exception ex) { logger.error(EELFLoggerDelegate.debugLogger, "POST response: {}", ex); + throw new Exception("Save Failed"); } logger.debug(EELFLoggerDelegate.debugLogger, "POST response: {}"); } - public void deleteViaRest(String restEndPoint, boolean isBasicAuth, String content, String filter , String userId) { + public void deleteViaRest(String restEndPoint, boolean isBasicAuth, String content, String filter , String userId) throws Exception { String appName = ""; String requestId = ""; String appUserName = ""; @@ -128,6 +130,7 @@ public class RestApiRequestBuilder { decryptedPwd, content_type, content, isBasicAuth, filter); } catch (Exception ex) { logger.error(EELFLoggerDelegate.debugLogger, "DELETE response: {}", ex); + throw new Exception("Delete Failed"); } logger.debug(EELFLoggerDelegate.debugLogger, "DELETE response: {}"); |