summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-common/src/main
diff options
context:
space:
mode:
authorHima Elisetty <hbindu@research.att.com>2018-04-12 16:25:57 -0400
committerHima Elisetty <hbindu@research.att.com>2018-04-12 16:25:57 -0400
commit507bf0a9a79507c9df08b03825d5ea3d7ea0daef (patch)
tree190276eb23d8cf86663671ef50b0beb1b89a84a4 /ecomp-portal-BE-common/src/main
parenteb135ec4f996bcfff4eb4130a7d461830fb9e511 (diff)
Get Roles on Users page for ext app
Issue-ID: PORTAL-241 Get Roles on Users page for ext app Change-Id: I7f57b681c43dbf59cdb19e7da8eb40e523768d3e Signed-off-by: Hima Elisetty <hbindu@research.att.com>
Diffstat (limited to 'ecomp-portal-BE-common/src/main')
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ApplicationsRestClientServiceImpl.java22
1 files changed, 16 insertions, 6 deletions
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ApplicationsRestClientServiceImpl.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ApplicationsRestClientServiceImpl.java
index 1460a61c..cfe5557c 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ApplicationsRestClientServiceImpl.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/service/ApplicationsRestClientServiceImpl.java
@@ -52,6 +52,7 @@ import javax.ws.rs.core.Response;
import org.apache.commons.lang.StringUtils;
import org.apache.cxf.jaxrs.client.WebClient;
+import org.apache.cxf.jaxrs.impl.ResponseImpl;
import org.apache.cxf.transport.http.HTTPException;
import org.onap.portalapp.portal.domain.EPApp;
import org.onap.portalapp.portal.logging.aop.EPAuditLog;
@@ -221,7 +222,12 @@ public class ApplicationsRestClientServiceImpl implements ApplicationsRestClient
if (response != null) {
verifyResponse(response);
- String str = response.readEntity(String.class);
+
+ /* It is not recommendable to use the implementation class org.apache.cxf.jaxrs.impl.ResponseImpl in the code,
+ but had to force this in-order to prevent conflict with the ResponseImpl class of Jersey Client which
+ doesn't work as expected. Created Portal-253 for tracking */
+ String str = ((ResponseImpl)response).readEntity(String.class);
+
EcompPortalUtils.logAndSerializeObject(logger, restPath, "GET result =", str);
try {
t = gson.fromJson(str, clazz);
@@ -239,7 +245,11 @@ public class ApplicationsRestClientServiceImpl implements ApplicationsRestClient
if (response != null) {
verifyResponse(response);
- String incomingJson = response.readEntity(String.class);
+
+ /* It is not recommendable to use the implementation class org.apache.cxf.jaxrs.impl.ResponseImpl in the code,
+ but had to force this in-order to prevent conflict with the ResponseImpl class of Jersey Client which
+ doesn't work as expected. Created Portal-253 for tracking */
+ String incomingJson = ((ResponseImpl)response).readEntity(String.class);
return incomingJson;
}
@@ -265,7 +275,7 @@ public class ApplicationsRestClientServiceImpl implements ApplicationsRestClient
if (response != null) {
verifyResponse(response);
- String str = response.readEntity(String.class);
+ String str = ((ResponseImpl)response).readEntity(String.class);
EcompPortalUtils.logAndSerializeObject(logger, restPath, "GET result =", str);
try {
@@ -331,7 +341,7 @@ public class ApplicationsRestClientServiceImpl implements ApplicationsRestClient
// String contentType = response.getHeaderString("Content-Type");
if (clazz != null) {
- String str = response.readEntity(String.class);
+ String str = ((ResponseImpl)response).readEntity(String.class);
EcompPortalUtils.logAndSerializeObject(logger, restPath, "POST result =", str);
try {
t = gson.fromJson(str, clazz);
@@ -378,7 +388,7 @@ public class ApplicationsRestClientServiceImpl implements ApplicationsRestClient
// String contentType = response.getHeaderString("Content-Type");
if (clazz != null) {
- String str = response.readEntity(String.class);
+ String str = ((ResponseImpl)response).readEntity(String.class);
EcompPortalUtils.logAndSerializeObject(logger, restPath, "POST result =", str);
try {
t = gson.fromJson(str, clazz);
@@ -425,7 +435,7 @@ public class ApplicationsRestClientServiceImpl implements ApplicationsRestClient
if (response != null) {
verifyResponse(response);
- String str = response.readEntity(String.class);
+ String str = ((ResponseImpl)response).readEntity(String.class);
EcompPortalUtils.logAndSerializeObject(logger, restPath, "PUT result =", str);
try {
t = gson.fromJson(str, clazz);