diff options
author | pwielebs <piotr.wielebski@nokia.com> | 2018-08-23 11:58:45 +0200 |
---|---|---|
committer | pwielebs <piotr.wielebski@nokia.com> | 2018-08-23 11:58:45 +0200 |
commit | 0a64f9a3f976a2472c42729353773839deea5e02 (patch) | |
tree | 9bf718efaa2d13cbb6d0a56943747c6ad083dbbd /prh-app-server/src/main/java | |
parent | 11a8eaf768babfdd0eaef985981a73947177f594 (diff) |
Fix for PRH against VES 7.0
Change-Id: I1e4ca7d1a163eed6fadb1f52d0cc9fc675ea6b7f
Issue-ID: DCAEGEN2-600
Signed-off-by: pwielebs <piotr.wielebski@nokia.com>
Diffstat (limited to 'prh-app-server/src/main/java')
-rw-r--r-- | prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/service/DmaapConsumerJsonParser.java | 5 |
1 files changed, 3 insertions, 2 deletions
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<ConsumerDmaapModel> 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) { |