aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main
diff options
context:
space:
mode:
authorEylon Malin <eylon.malin@intl.att.com>2019-10-02 14:57:35 +0300
committerEylon Malin <eylon.malin@intl.att.com>2019-10-02 14:57:35 +0300
commitea46d04a9bc5569bd29b83bdeb58f52a88d876c3 (patch)
tree4a612cbdf01b5bbb288cb4b6a8de4013d7d1664e /vid-app-common/src/main
parenta92741c73951498d10644635da2335391ac56e02 (diff)
send INVOCATION_ID header via RestMsoImplementation
Issue-ID: VID-253 Signed-off-by: Eylon Malin <eylon.malin@intl.att.com> Change-Id: Ifc199a3ef0faf2c02b73a065667866f25c20bd56
Diffstat (limited to 'vid-app-common/src/main')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/logging/Headers.kt6
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java3
2 files changed, 8 insertions, 1 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/logging/Headers.kt b/vid-app-common/src/main/java/org/onap/vid/logging/Headers.kt
index b2969feb2..e9f83ef22 100644
--- a/vid-app-common/src/main/java/org/onap/vid/logging/Headers.kt
+++ b/vid-app-common/src/main/java/org/onap/vid/logging/Headers.kt
@@ -4,6 +4,7 @@ package org.onap.vid.logging
import org.onap.portalsdk.core.util.SystemProperties
import org.onap.vid.logging.RequestIdHeader.*
+import java.util.*
import javax.servlet.http.HttpServletRequest
interface Header {
@@ -20,6 +21,11 @@ val PARTNER_NAME = object : NamedHeader("X-ONAP-PartnerName") {
override fun getHeaderValue() = "VID.VID"
}
+@JvmField
+val INVOCATION_ID = object : NamedHeader("X-InvocationID") {
+ override fun getHeaderValue() = UUID.randomUUID().toString()
+}
+
enum class RequestIdHeader(override val headerName: String) : Header {
ONAP_ID("X-ONAP-RequestID"),
REQUEST_ID("X-RequestID"),
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java b/vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java
index 9c8902d00..b105fab5c 100644
--- a/vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java
@@ -20,6 +20,7 @@
package org.onap.vid.mso;
+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.ONAP_REQUEST_ID_HEADER_KEY;
import static org.onap.vid.utils.Logging.REQUEST_ID_HEADER_KEY;
@@ -115,7 +116,7 @@ public class RestMsoImplementation implements RestInterface {
String requestIdValue = Logging.extractOrGenerateRequestId();
commonHeaders.put(REQUEST_ID_HEADER_KEY, Collections.singletonList(requestIdValue));
commonHeaders.put(ONAP_REQUEST_ID_HEADER_KEY, Collections.singletonList(requestIdValue));
-
+ commonHeaders.put(INVOCATION_ID.getHeaderName(), Collections.singletonList(INVOCATION_ID.getHeaderValue()));
boolean useSsl = true;
if ( (mso_url != null) && ( !(mso_url.isEmpty()) ) ) {