aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh
diff options
context:
space:
mode:
authorRavi Pendurty <ravi.pendurty@highstreet-technologies.com>2024-03-01 14:17:05 +0530
committerRavi Pendurty <ravi.pendurty@highstreet-technologies.com>2024-03-22 11:42:44 +0000
commit33bfa0221b0449018bfbf3c2f5d794990bc652ce (patch)
tree45afb5afe70825651ab90e7fe1d592f8dfdc8404 /sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh
parent907af9b57aa0db3ace5dc8fdaef9fb84c1392ec9 (diff)
Change event time mapping
Use event-time from o-ran-fm instead of eventTime from notification Issue-ID: CCSDK-3988 Change-Id: I3e3445a99315527ddcf1996fd96c269ae85748a6 Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> Signed-off-by: highstreetherbert <herbert.eiselt@highstreet-technologies.com> (cherry picked from commit 2a06bf83bac4042370715a450c7d3d83b497b50f)
Diffstat (limited to 'sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh')
-rw-r--r--sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/dataprovider/ORanDOMToInternalDataModel.java12
-rw-r--r--sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/yangspecs/ORANFM.java26
-rw-r--r--sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMFaultNotificationListener.java5
-rw-r--r--sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMToInternalDataModel.java5
4 files changed, 21 insertions, 27 deletions
diff --git a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/dataprovider/ORanDOMToInternalDataModel.java b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/dataprovider/ORanDOMToInternalDataModel.java
index 4b55f1681..4db249790 100644
--- a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/dataprovider/ORanDOMToInternalDataModel.java
+++ b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/dataprovider/ORanDOMToInternalDataModel.java
@@ -241,10 +241,12 @@ public class ORanDOMToInternalDataModel {
faultAlarm.setSeverity(getSeverityType(
ORanDMDOMUtility.getLeafValue(cn, oranfm.getFaultSeverityQName()),
ORanDMDOMUtility.getLeafValue(cn, oranfm.getFaultIsClearedQName()).equals("true")));
- faultAlarm.setCounter(counter);
+ faultAlarm.setCounter(Integer.parseInt(ORanDMDOMUtility.getLeafValue(cn, oranfm.getFaultIdQName())));
faultAlarm.setId(ORanDMDOMUtility.getLeafValue(cn, oranfm.getFaultIdQName()));
faultAlarm.setSourceType(SourceType.Netconf);
- faultAlarm.setTimestamp(getEventTime(notification));
+ faultAlarm.setTimestamp(NetconfTimeStampImpl.getConverter()
+ .getTimeStamp(ORanDMDOMUtility.getLeafValue(cn, oranfm.getFaultEventTimeQName())));
+
return faultAlarm.build();
}
@@ -257,9 +259,9 @@ public class ORanDOMToInternalDataModel {
ORanDMDOMUtility.getLeafValue(activeAlarmEntry, oranfm.getFaultTextQName()));
faultAlarm.setSeverity(getSeverityType(
ORanDMDOMUtility.getLeafValue(activeAlarmEntry, oranfm.getFaultSeverityQName()),
- ORanDMDOMUtility.getLeafValue(activeAlarmEntry, oranfm.getFaultIsClearedQName())
- .equals("true")));
- faultAlarm.setCounter(counter);
+ ORanDMDOMUtility.getLeafValue(activeAlarmEntry, oranfm.getFaultIsClearedQName()).equals("true")));
+ faultAlarm.setCounter(
+ Integer.parseInt(ORanDMDOMUtility.getLeafValue(activeAlarmEntry, oranfm.getFaultIdQName())));
faultAlarm.setId(ORanDMDOMUtility.getLeafValue(activeAlarmEntry, oranfm.getFaultIdQName()));
faultAlarm.setSourceType(SourceType.Netconf);
faultAlarm.setTimestamp(NetconfTimeStampImpl.getConverter().getTimeStamp(
diff --git a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/yangspecs/ORANFM.java b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/yangspecs/ORANFM.java
index 5be18e75b..a4ef8b9fa 100644
--- a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/yangspecs/ORANFM.java
+++ b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/yangspecs/ORANFM.java
@@ -39,23 +39,9 @@ public class ORANFM extends YangModule {
public static final QNameModule ORANFM_2022_08_15 =
QNameModule.create(XMLNamespace.of(NAMESPACE), Revision.of("2022-08-15"));
private static final List<QNameModule> MODULES = Arrays.asList(ORANFM_2019_02_04, ORANFM_2022_08_15);
-// private final QName ORAN_FM_ALARM_NOTIF;
-// private final QName ORAN_FM_FAULT_ID;
-// private final QName ORAN_FM_FAULT_SOURCE;
-// private final QName ORAN_FM_FAULT_SEVERITY;
-// private final QName ORAN_FM_FAULT_TEXT;
-// private final QName ORAN_FM_FAULT_IS_CLEARED;
-
-
ORANFM(NetconfDomAccessor netconfDomAccessor, QNameModule module) {
super(netconfDomAccessor, module);
-// ORAN_FM_ALARM_NOTIF = QName.create(module, "alarm-notif");
-// ORAN_FM_FAULT_ID = QName.create(module, "fault-id");
-// ORAN_FM_FAULT_SOURCE = QName.create(module, "fault-source");
-// ORAN_FM_FAULT_SEVERITY = QName.create(module, "fault-severity");
-// ORAN_FM_FAULT_TEXT = QName.create(module, "fault-text");
-// ORAN_FM_FAULT_IS_CLEARED = QName.create(module, "is-cleared");
}
public QName getFaultSourceQName() {
@@ -83,17 +69,17 @@ public class ORANFM extends YangModule {
}
public QName getFaultEventTimeQName() {
- return getQName("event-time");
+ return getQName("event-time");
}
-
+
public QName getFaultActiveAlarmListQName() {
- return getQName("active-alarm-list");
+ return getQName("active-alarm-list");
}
-
+
public QName getFaultActiveAlarmsQName() {
- return getQName("active-alarms");
+ return getQName("active-alarms");
}
-
+
/**
* Get specific instance, depending on capabilities
*
diff --git a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMFaultNotificationListener.java b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMFaultNotificationListener.java
index de19bf1a2..65ad9fe55 100644
--- a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMFaultNotificationListener.java
+++ b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMFaultNotificationListener.java
@@ -133,7 +133,10 @@ public class TestORanDOMFaultNotificationListener {
.withChild(ImmutableNodes.leafNode(oranfm.get().getFaultSourceQName(), "Slot-2-Port-B"))
.withChild(ImmutableNodes.leafNode(oranfm.get().getFaultSeverityQName(), "MAJOR"))
.withChild(ImmutableNodes.leafNode(oranfm.get().getFaultIsClearedQName(), "true"))
- .withChild(ImmutableNodes.leafNode(oranfm.get().getFaultTextQName(), "CPRI Port Down")).build();
+ .withChild(ImmutableNodes.leafNode(oranfm.get().getFaultTextQName(), "CPRI Port Down"))
+ .withChild(
+ ImmutableNodes.leafNode(oranfm.get().getFaultEventTimeQName(), "2024-02-29T09:33:31.000+00:00"))
+ .build();
}
public static class NetconfDeviceNotification implements DOMNotification, DOMEvent {
diff --git a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMToInternalDataModel.java b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMToInternalDataModel.java
index 01502e49c..eb4a7fa79 100644
--- a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMToInternalDataModel.java
+++ b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/TestORanDOMToInternalDataModel.java
@@ -216,7 +216,10 @@ public class TestORanDOMToInternalDataModel {
.withChild(ImmutableNodes.leafNode(oranfm.get().getFaultSourceQName(), "Slot-2-Port-B"))
.withChild(ImmutableNodes.leafNode(oranfm.get().getFaultSeverityQName(), "MAJOR"))
.withChild(ImmutableNodes.leafNode(oranfm.get().getFaultIsClearedQName(), "true"))
- .withChild(ImmutableNodes.leafNode(oranfm.get().getFaultTextQName(), "CPRI Port Down")).build();
+ .withChild(ImmutableNodes.leafNode(oranfm.get().getFaultTextQName(), "CPRI Port Down"))
+ .withChild(
+ ImmutableNodes.leafNode(oranfm.get().getFaultEventTimeQName(), "2024-02-29T09:33:31.000+00:00"))
+ .build();
}
public static class NetconfDeviceNotification implements DOMNotification, DOMEvent {