diff options
author | 2019-09-12 07:47:32 +0000 | |
---|---|---|
committer | 2019-09-12 07:47:32 +0000 | |
commit | ca6f40516028602d3551856301cd9d7cda65f812 (patch) | |
tree | c114fcde5bd53e1b1aaaaa8625eaa553a7b043fa /vid-app-common/src/main/java/org/onap/vid/aai/PombaRestInterface.java | |
parent | 4996ccfb67d22533da5d5021284e41b6612e4aec (diff) | |
parent | 2265215c803291e029add2db7912c7b1e25e0a8e (diff) |
Merge "make Logging a service and inject it to SyncRestClient"
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/aai/PombaRestInterface.java')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/aai/PombaRestInterface.java | 28 |
1 files changed, 17 insertions, 11 deletions
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)); |