diff options
author | 2021-10-30 08:42:47 +0000 | |
---|---|---|
committer | 2021-10-30 08:42:47 +0000 | |
commit | f1958e194b60cd244db9e482ab4d6a84b33476fe (patch) | |
tree | 28532ee7ce3671bf9cbc41cfef4049e7628204c2 /holmes-actions/src/main/java | |
parent | 5d42272560178e4ecf72776e52e0ac143d62c2d6 (diff) |
Add support to 7.1 VES data-stream in-parallel to 5.4
Change-Id: I9ee1d712c419cb95547e5f6125ff8f7b8c686b08
Issue-ID: HOLMES-308
Signed-off-by: Venkata Molluru <venkatamuralimohanreddy.molluru@techmahindra.com>
Diffstat (limited to 'holmes-actions/src/main/java')
3 files changed, 21 insertions, 15 deletions
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/api/entity/AlarmInfo.java b/holmes-actions/src/main/java/org/onap/holmes/common/api/entity/AlarmInfo.java index c7881d1..47aeb0d 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/api/entity/AlarmInfo.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/api/entity/AlarmInfo.java @@ -44,6 +44,9 @@ public class AlarmInfo { @SerializedName(value = "sourcename")
private String sourceName;
+ @SerializedName(value = "sequence")
+ private int sequence;
+
@SerializedName(value = "alarmiscleared")
private int alarmIsCleared;
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/api/stat/VesAlarm.java b/holmes-actions/src/main/java/org/onap/holmes/common/api/stat/VesAlarm.java index ae71ad4..09daf54 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/api/stat/VesAlarm.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/api/stat/VesAlarm.java @@ -17,8 +17,9 @@ package org.onap.holmes.common.api.stat; import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; +import java.util.Map; +import java.util.HashMap; +import java.util.TimeZone; import lombok.Getter; import lombok.Setter; @@ -41,20 +42,23 @@ public class VesAlarm implements Cloneable, Serializable{ private String sourceId; private String sourceName; private Long startEpochMicrosec; - private Long version; + private String version; - private List<AlarmAdditionalField> alarmAdditionalInformation; + private Map<String, String> alarmAdditionalInformation; private String alarmCondition; private String alarmInterfaceA; private String eventCategory; private String eventSeverity; private String eventSourceType; - private Long faultFieldsVersion; + private String faultFieldsVersion; private String specificProblem; private String vfStatus; private String parentId; private int alarmIsCleared = 0; //mark as 1 when alarm type is cleared, else mark as 0 private int rootFlag = 0; // mark as 1 when alarm is a root alarm , else mark as 0 + private String nfVendorName; + private String vesEventListenerVersion; + private TimeZone timeZoneOffset; @Override public int hashCode() { @@ -91,18 +95,13 @@ public class VesAlarm implements Cloneable, Serializable{ vesAlarm.setSourceName(this.getSourceName()); vesAlarm.setStartEpochMicrosec(this.getStartEpochMicrosec()); vesAlarm.setVersion(this.getVersion()); - if (alarmAdditionalInformation != null) { - List<AlarmAdditionalField> alarmAdditionalFields = new ArrayList<>(); - alarmAdditionalInformation.forEach(alarmAdditionalField -> { - AlarmAdditionalField alarmAdditionalField1 = new AlarmAdditionalField(); - alarmAdditionalField1.setName(alarmAdditionalField.getName()); - alarmAdditionalField1.setName(alarmAdditionalField.getValue()); - alarmAdditionalFields.add(alarmAdditionalField1); - }); - vesAlarm.setAlarmAdditionalInformation(alarmAdditionalFields); + Map<String, String> alarmAdditionalFields = new HashMap<String, String>(); + for(String key: alarmAdditionalInformation.keySet()) { + alarmAdditionalFields.put(key, alarmAdditionalInformation.get(key)); + } + vesAlarm.setAlarmAdditionalInformation(alarmAdditionalFields); } - vesAlarm.setAlarmCondition(this.getAlarmCondition()); vesAlarm.setAlarmInterfaceA(this.getAlarmInterfaceA()); vesAlarm.setEventCategory(this.getEventCategory()); @@ -113,6 +112,9 @@ public class VesAlarm implements Cloneable, Serializable{ vesAlarm.setVfStatus(this.vfStatus); vesAlarm.setAlarmIsCleared(this.alarmIsCleared); vesAlarm.setRootFlag(this.rootFlag); + vesAlarm.setVesEventListenerVersion(this.vesEventListenerVersion); + vesAlarm.setNfVendorName(this.nfVendorName); + vesAlarm.setTimeZoneOffset(this.timeZoneOffset); return vesAlarm; } diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/utils/AlarmInfoMapper.java b/holmes-actions/src/main/java/org/onap/holmes/common/utils/AlarmInfoMapper.java index 0c7d756..e5b0830 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/utils/AlarmInfoMapper.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/utils/AlarmInfoMapper.java @@ -32,6 +32,7 @@ public class AlarmInfoMapper implements ResultSetMapper<AlarmInfo> { alarmInfo.setEventName(resultSet.getString("eventname"));
alarmInfo.setSourceId(resultSet.getString("sourceid"));
alarmInfo.setSourceName(resultSet.getString("sourcename"));
+ alarmInfo.setSequence(resultSet.getInt("sequence"));
alarmInfo.setStartEpochMicroSec(resultSet.getLong("startepochmicrosec"));
alarmInfo.setLastEpochMicroSec(resultSet.getLong("lastepochmicrosec"));
return alarmInfo;
|