aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-10-06 10:51:24 +0000
committerGerrit Code Review <gerrit@onap.org>2019-10-06 10:51:24 +0000
commit85f3d5c59775259524ac2a51c5976d09a004e56c (patch)
treeed2f30cfa9f014a5485ae18aa43e219207f3b097 /vid-app-common/src/main
parent69257dc9c6f3e04b677eecffbf8f3ebb535b0be1 (diff)
parent87e29ea8b915550e1c9c65aabb6a01c767938bd7 (diff)
Merge "send X-ONAP-RequestID and X-InvocationID headers to AAI"
Diffstat (limited to 'vid-app-common/src/main')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java
index 8c05a8e6f..4369c17fc 100644
--- a/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java
@@ -22,8 +22,8 @@ package org.onap.vid.aai.util;
import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;
+import static org.onap.vid.logging.Headers.INVOCATION_ID;
import static org.onap.vid.logging.Headers.PARTNER_NAME;
-import static org.onap.vid.utils.Logging.REQUEST_ID_HEADER_KEY;
import com.att.eelf.configuration.EELFLogger;
import java.io.UnsupportedEncodingException;
@@ -43,6 +43,7 @@ import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.vid.aai.ExceptionWithRequestInfo;
import org.onap.vid.aai.ResponseWithRequestInfo;
import org.onap.vid.aai.exceptions.InvalidPropertyException;
+import org.onap.vid.logging.RequestIdHeader;
import org.onap.vid.utils.Logging;
import org.onap.vid.utils.Unchecked;
import org.springframework.beans.factory.annotation.Autowired;
@@ -191,6 +192,9 @@ public class AAIRestInterface {
loggingService.logRequest(outgoingRequestsLogger, method, url, payload);
final Response response;
+
+ String requestId = extractOrGenerateRequestId();
+
Invocation.Builder requestBuilder = client.target(url)
.request()
.accept(xml ? MediaType.APPLICATION_XML : MediaType.APPLICATION_JSON)
@@ -198,7 +202,10 @@ public class AAIRestInterface {
.header(TRANSACTION_ID_HEADER, transId)
.header(FROM_APP_ID_HEADER, fromAppId)
.header("Content-Type", MediaType.APPLICATION_JSON)
- .header(REQUEST_ID_HEADER_KEY, extractOrGenerateRequestId());
+ .header(RequestIdHeader.ONAP_ID.getHeaderName(), requestId)
+ .header(RequestIdHeader.ECOMP_ID.getHeaderName(), requestId)
+ .header(INVOCATION_ID.getHeaderName(), INVOCATION_ID.getHeaderValue())
+ ;
requestBuilder = systemPropertyHelper.isClientCertEnabled() ?
requestBuilder : authenticateRequest(requestBuilder);