X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=vid-app-common%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fvid%2Faai%2FPombaRestInterface.java;h=e9895e635b2ba3c75559a3897a7bf903500a1262;hb=ecd0453d3ca7c54d32af7b033f8098e25ca4392b;hp=2f69e397c38a3c9319c084032b90dbed2d1e275f;hpb=29ca338bd8db61a4dbf1547e9ae740bd4a7186ab;p=vid.git diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/PombaRestInterface.java b/vid-app-common/src/main/java/org/onap/vid/aai/PombaRestInterface.java index 2f69e397c..e9895e635 100644 --- a/vid-app-common/src/main/java/org/onap/vid/aai/PombaRestInterface.java +++ b/vid-app-common/src/main/java/org/onap/vid/aai/PombaRestInterface.java @@ -22,25 +22,31 @@ package org.onap.vid.aai; -import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.onap.vid.aai.util.*; -import org.onap.vid.utils.Logging; -import org.springframework.http.HttpMethod; +import static org.onap.vid.utils.Logging.REQUEST_ID_HEADER_KEY; +import java.util.UUID; import javax.ws.rs.client.Client; import javax.ws.rs.client.Entity; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import java.util.UUID; - -import static org.onap.vid.utils.Logging.REQUEST_ID_HEADER_KEY; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.vid.aai.util.AAIRestInterface; +import org.onap.vid.aai.util.HttpClientMode; +import org.onap.vid.aai.util.HttpsAuthClient; +import org.onap.vid.aai.util.ServletRequestHelper; +import org.onap.vid.aai.util.SystemPropertyHelper; +import org.onap.vid.utils.Logging; +import org.springframework.http.HttpMethod; public class PombaRestInterface extends AAIRestInterface { private Client client = null; - public PombaRestInterface (HttpsAuthClient httpsAuthClientFactory, ServletRequestHelper servletRequestHelper, SystemPropertyHelper systemPropertyHelper) { - super(httpsAuthClientFactory, servletRequestHelper, systemPropertyHelper); + public PombaRestInterface (HttpsAuthClient httpsAuthClientFactory, + ServletRequestHelper servletRequestHelper, + SystemPropertyHelper systemPropertyHelper, + Logging loggingService) { + super(httpsAuthClientFactory, servletRequestHelper, systemPropertyHelper, loggingService); } @Override @@ -64,7 +70,7 @@ public class PombaRestInterface extends AAIRestInterface { try { initRestClient(); - Logging.logRequest(outgoingRequestsLogger, HttpMethod.POST, url, payload); + loggingService.logRequest(outgoingRequestsLogger, HttpMethod.POST, url, payload); final Response cres = client.target(url) .request() .accept(MediaType.APPLICATION_JSON) @@ -72,7 +78,7 @@ public class PombaRestInterface extends AAIRestInterface { .header(FROM_APP_ID_HEADER, fromAppId) .header(REQUEST_ID_HEADER_KEY, extractOrGenerateRequestId()) .post(Entity.entity(payload, MediaType.APPLICATION_JSON)); - Logging.logResponse(outgoingRequestsLogger, HttpMethod.POST, url, cres); + loggingService.logResponse(outgoingRequestsLogger, HttpMethod.POST, url, cres); if (cres.getStatusInfo().getFamily().equals(Response.Status.Family.SUCCESSFUL)) { logger.info(EELFLoggerDelegate.errorLogger, getValidResponseLogMessage(methodName));