From 0a64f9a3f976a2472c42729353773839deea5e02 Mon Sep 17 00:00:00 2001 From: pwielebs Date: Thu, 23 Aug 2018 11:58:45 +0200 Subject: Fix for PRH against VES 7.0 Change-Id: I1e4ca7d1a163eed6fadb1f52d0cc9fc675ea6b7f Issue-ID: DCAEGEN2-600 Signed-off-by: pwielebs --- .../onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'prh-app-server/src/main/java/org') diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java index 53c370f1..17b1ef67 100644 --- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java +++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java @@ -39,6 +39,7 @@ import reactor.core.publisher.Mono; */ public class DmaapConsumerJsonParser { + private static final String EVENT = "event"; private static final String PNF_REGISTRATION_FIELDS = "pnfRegistrationFields"; private static final String OAM_IPV_4_ADDRESS = "oamV4IpAddress"; private static final String OAM_IPV_6_ADDRESS = "oamV6IpAddress"; @@ -89,7 +90,7 @@ public class DmaapConsumerJsonParser { } private Mono transform(JsonObject monoJsonP) { - monoJsonP = monoJsonP.getAsJsonObject(PNF_REGISTRATION_FIELDS); + monoJsonP = monoJsonP.getAsJsonObject(EVENT).getAsJsonObject(PNF_REGISTRATION_FIELDS); String pnfVendorName = getValueFromJson(monoJsonP, VENDOR_NAME); String pnfSerialNumber = getValueFromJson(monoJsonP, SERIAL_NUMBER); String pnfOamIpv4Address = getValueFromJson(monoJsonP, OAM_IPV_4_ADDRESS); @@ -118,7 +119,7 @@ public class DmaapConsumerJsonParser { } private boolean containsHeader(JsonObject jsonObject) { - return jsonObject.has(PNF_REGISTRATION_FIELDS); + return jsonObject.has(EVENT) && jsonObject.getAsJsonObject(EVENT).has(PNF_REGISTRATION_FIELDS); } private String printMessage(String vendorName, String serialNumber, String oamIpv4Address, String oamIpv6Address) { -- cgit 1.2.3-korg