From 77097fadf2dc4e5356bb2fa9ba370c75bf4a9439 Mon Sep 17 00:00:00 2001 From: krishna Date: Mon, 13 May 2019 20:14:48 +0530 Subject: Ignore additional fields in FM and PM messages Change-Id: I59dedd9f92bbbd39ba8ddd9c18c1f06afd30d349 Issue-ID: DCAEGEN2-1497 Signed-off-by: krishna --- .../java/org/onap/dcaegen2/services/sonhms/CommonEventHeader.java | 3 +++ src/main/java/org/onap/dcaegen2/services/sonhms/Event.java | 3 +++ src/main/java/org/onap/dcaegen2/services/sonhms/FaultFields.java | 3 +++ .../org/onap/dcaegen2/services/sonhms/dmaap/NotificationConsumer.java | 4 +--- .../onap/dcaegen2/services/sonhms/model/AdditionalMeasurements.java | 3 +++ src/main/java/org/onap/dcaegen2/services/sonhms/model/Event.java | 3 +++ .../org/onap/dcaegen2/services/sonhms/model/MeasurementFields.java | 3 +++ 7 files changed, 19 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/CommonEventHeader.java b/src/main/java/org/onap/dcaegen2/services/sonhms/CommonEventHeader.java index 013dc66..5863bd8 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/CommonEventHeader.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/CommonEventHeader.java @@ -21,6 +21,9 @@ package org.onap.dcaegen2.services.sonhms; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) public class CommonEventHeader { private String version; diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/Event.java b/src/main/java/org/onap/dcaegen2/services/sonhms/Event.java index 3a71f2b..7338911 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/Event.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/Event.java @@ -21,6 +21,9 @@ package org.onap.dcaegen2.services.sonhms; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) public class Event { private CommonEventHeader commonEventHeader; private FaultFields faultFields; diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/FaultFields.java b/src/main/java/org/onap/dcaegen2/services/sonhms/FaultFields.java index a2c877d..e95d38e 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/FaultFields.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/FaultFields.java @@ -21,6 +21,9 @@ package org.onap.dcaegen2.services.sonhms; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown = true) public class FaultFields { @Override diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/dmaap/NotificationConsumer.java b/src/main/java/org/onap/dcaegen2/services/sonhms/dmaap/NotificationConsumer.java index 3860311..12113ce 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/dmaap/NotificationConsumer.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/dmaap/NotificationConsumer.java @@ -23,8 +23,6 @@ package org.onap.dcaegen2.services.sonhms.dmaap; import com.att.nsa.cambria.client.CambriaConsumer; -import java.io.IOException; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -51,7 +49,7 @@ public class NotificationConsumer implements Runnable { log.debug(msg); notificationCallback.activateCallBack(msg); } - } catch (IOException e) { + } catch (Exception e) { log.debug("exception when fetching msgs from dmaap", e); } diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/model/AdditionalMeasurements.java b/src/main/java/org/onap/dcaegen2/services/sonhms/model/AdditionalMeasurements.java index c55c6d6..f71df00 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/model/AdditionalMeasurements.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/model/AdditionalMeasurements.java @@ -21,8 +21,11 @@ package org.onap.dcaegen2.services.sonhms.model; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + import java.util.Map; +@JsonIgnoreProperties(ignoreUnknown = true) public class AdditionalMeasurements { String name; diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/model/Event.java b/src/main/java/org/onap/dcaegen2/services/sonhms/model/Event.java index 73edc39..e6a1869 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/model/Event.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/model/Event.java @@ -21,8 +21,11 @@ package org.onap.dcaegen2.services.sonhms.model; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + import org.onap.dcaegen2.services.sonhms.CommonEventHeader; +@JsonIgnoreProperties(ignoreUnknown = true) public class Event { CommonEventHeader commonEventHeader; MeasurementFields measurementFields; diff --git a/src/main/java/org/onap/dcaegen2/services/sonhms/model/MeasurementFields.java b/src/main/java/org/onap/dcaegen2/services/sonhms/model/MeasurementFields.java index 477a2d3..fea6271 100644 --- a/src/main/java/org/onap/dcaegen2/services/sonhms/model/MeasurementFields.java +++ b/src/main/java/org/onap/dcaegen2/services/sonhms/model/MeasurementFields.java @@ -21,8 +21,11 @@ package org.onap.dcaegen2.services.sonhms.model; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + import java.util.List; +@JsonIgnoreProperties(ignoreUnknown = true) public class MeasurementFields { String measurementInterval; -- cgit 1.2.3-korg