X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ecomp-portal-BE-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fportalapp%2Fportal%2Fservice%2FApplicationsRestClientServiceImpl.java;h=5a354f3abb34b05d2cc012dd9c59263e5281d57e;hb=aa9b320ff93511280cf51b03d38fb9254af6b530;hp=c9f2c6eed7cb8569f150e7954f333d6d8b9e4b92;hpb=fe3a67c11b65d7989a6ef648c3f34eee8abe7394;p=portal.git 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 c9f2c6ee..5a354f3a 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 @@ -2,7 +2,7 @@ * ============LICENSE_START========================================== * ONAP Portal * =================================================================== - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed @@ -358,48 +358,6 @@ public class ApplicationsRestClientServiceImpl implements ApplicationsRestClient return post( clazz, appId, payload, restPath, SystemType.APPLICATION); } - //@Override - public T postForClass(Class clazz, long appId, Object payload, String restPath, Class forClass) throws HTTPException { - WebClient client = null; - Response response = null; - T t = null; - logger.debug(EELFLoggerDelegate.debugLogger, "Entering to createClientForApp method for payload: {} and restPath: {} and appId: {}", payload.toString(), restPath, appId); - client = createClientForApp(appId, restPath); - EcompPortalUtils.logAndSerializeObject(logger, restPath, "POST request =", payload); - logger.debug(EELFLoggerDelegate.debugLogger, "Finished createClientForApp method for payload: {} and restPath: {} and appId: {}", payload.toString(), restPath, appId); - try { - if (client != null) { - logger.debug(EELFLoggerDelegate.debugLogger, "Entering to POST for payload: {} and restPath: {} and appId: {}", payload.toString(), restPath, appId); - response = client.post(payload); - logger.debug(EELFLoggerDelegate.debugLogger, "Finished to POST for payload: {} and restPath: {} and appId: {}", payload.toString(), restPath, appId); - } else { - logger.error(EELFLoggerDelegate.errorLogger, - "Unable to create the Webclient to make the '" + restPath + "' API call."); - } - } catch (Exception e) { - MDC.put(EPCommonSystemProperties.EXTERNAL_API_RESPONSE_CODE, - Integer.toString(HttpServletResponse.SC_INTERNAL_SERVER_ERROR)); - EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeRestApiGeneralError, e); - logger.error(EELFLoggerDelegate.errorLogger, "Exception occurred while making the POST REST API call", e); - } - - if (response != null) { - verifyResponse(response); - - // String contentType = response.getHeaderString("Content-Type"); - if (clazz != null) { - String str = ((ResponseImpl)response).readEntity(String.class); - EcompPortalUtils.logAndSerializeObject(logger, restPath, "POST result =", str); - try { - t = gson.fromJson(str, clazz); - } catch (Exception e) { - EPLogUtil.logEcompError(logger, EPAppMessagesEnum.BeInvalidJsonInput, e); - } - } - } - return t; - } - @Override public T put(Class clazz, long appId, Object payload, String restPath) throws HTTPException {