diff options
author | Michael Dürre <michael.duerre@highstreet-technologies.com> | 2024-08-15 10:04:54 +0200 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2024-09-12 15:48:04 -0400 |
commit | 7964e8aa9b9748678f6dadfe7b0c17c936679351 (patch) | |
tree | f4859812acd6ccccdaa698c567bb121f03f7b985 /sdnr/wt/devicemanager-o-ran-sc | |
parent | 556306410bc9c3a421cde351d287adeb705d1e8c (diff) |
migrate sdnr features to potassium
adapt features and poms for potassium-sr2
Issue-ID: CCSDK-4046
Change-Id: I67e8fc442811eca40c19f1f3777f1a36812d3e35
Signed-off-by: Michael Dürre <michael.duerre@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/devicemanager-o-ran-sc')
9 files changed, 115 insertions, 98 deletions
diff --git a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/pom.xml b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/pom.xml index ddc3181e5..99b5689db 100644 --- a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/pom.xml +++ b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/pom.xml @@ -55,15 +55,9 @@ <dependencies> <dependency> - <groupId>org.json</groupId> - <artifactId>json</artifactId> - <scope>provided</scope> - </dependency> - <dependency> <groupId>${project.groupId}</groupId> <artifactId>sdnr-wt-devicemanager-o-ran-sc-oran-model</artifactId> <version>${project.version}</version> - <scope>provided</scope> </dependency> <dependency> <groupId>${project.groupId}</groupId> @@ -95,25 +89,41 @@ <version>${project.version}</version> <scope>provided</scope> </dependency> + <dependency> - <groupId>org.opendaylight.netconf</groupId> - <artifactId>sal-netconf-connector</artifactId> + <groupId>${project.groupId}</groupId> + <artifactId>rfc7317-ietf-system</artifactId> + <version>${project.version}</version> <scope>provided</scope> </dependency> <dependency> - <groupId>org.opendaylight.netconf</groupId> - <artifactId>callhome-model</artifactId> - <!-- <scope>provided</scope> --> + <groupId>org.opendaylight.mdsal</groupId> + <artifactId>mdsal-common-api</artifactId> + <scope>provided</scope> </dependency> <dependency> <groupId>org.opendaylight.mdsal</groupId> - <artifactId>mdsal-singleton-common-api</artifactId> + <artifactId>mdsal-dom-api</artifactId> <scope>provided</scope> </dependency> <dependency> - <groupId>${project.groupId}</groupId> - <artifactId>rfc7317-ietf-system</artifactId> - <version>${project.version}</version> + <groupId>org.opendaylight.netconf.model</groupId> + <artifactId>rfc5277</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.opendaylight.mdsal.model</groupId> + <artifactId>ietf-topology</artifactId> + <scope>provided</scope> + </dependency> + <!--<dependency> + <groupId>org.opendaylight.yangtools</groupId> + <artifactId>yang-data-api</artifactId> + </dependency>--> + <dependency> + <groupId>org.opendaylight.netconf</groupId> + <artifactId>netconf-topology</artifactId> + <scope>provided</scope> </dependency> <!-- begin for testing --> <dependency> @@ -127,13 +137,13 @@ <version>${project.version}</version> <scope>test</scope> </dependency> - <dependency> + <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <scope>test</scope> </dependency> <!-- end for testing --> - + </dependencies> <build> 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 a1ec2fc9e..075445193 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 @@ -47,7 +47,6 @@ import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology. import org.opendaylight.yangtools.yang.binding.CodeHelpers; import org.opendaylight.yangtools.yang.common.Uint32; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.MapNode; @@ -195,13 +194,13 @@ public class ORanDOMToInternalDataModel { * @param sys * @return */ - public static Optional<Guicutthrough> getGuicutthrough(@Nullable AugmentationNode onapSysAugData, + public static Optional<Guicutthrough> getGuicutthrough(@Nullable ContainerNode sysData, @NonNull OnapSystem onapSys) { - if (onapSysAugData != null) { - String name = ORanDMDOMUtility.getLeafValue(onapSysAugData, onapSys.getName()); + if (sysData != null) { + String name = ORanDMDOMUtility.getLeafValue(sysData, onapSys.getName()); @Nullable - Uri uri = new Uri(ORanDMDOMUtility.getLeafValue(onapSysAugData, onapSys.getWebUi())); + Uri uri = new Uri(ORanDMDOMUtility.getLeafValue(sysData, onapSys.getWebUi())); if (uri.getValue() != null) { GuicutthroughBuilder gcBuilder = new GuicutthroughBuilder(); if (name != null) { @@ -212,7 +211,6 @@ public class ORanDOMToInternalDataModel { } LOG.warn("Uri not set to invoke a Gui cut through session to the device. Please set the Uri in the device"); } - LOG.warn("Retrieving augmented System details failed. Gui cut through information not available"); return Optional.empty(); } 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/impl/dom/ORanDOMNetworkElement.java b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/ORanDOMNetworkElement.java index 50f1411d0..8731589ac 100644 --- a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/ORanDOMNetworkElement.java +++ b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/impl/dom/ORanDOMNetworkElement.java @@ -66,7 +66,6 @@ import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.InstanceIdentifierBuilder; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.MapNode; @@ -178,7 +177,7 @@ public class ORanDOMNetworkElement implements NetworkElement, IConfigChangedList getActiveAlarms(); } if (onapSystem.isPresent()) { - AugmentationNode gcData = (AugmentationNode) onapSystem.get().getOnapSystemData(); + ContainerNode gcData = (ContainerNode) onapSystem.get().getOnapSystemData(); Optional<Guicutthrough> oGuicutthrough = ORanDOMToInternalDataModel.getGuicutthrough(gcData, onapSystem.get()); if (oGuicutthrough.isPresent()) { 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/notification/ORanDOMNotificationToXPath.java b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/notification/ORanDOMNotificationToXPath.java index 697265f01..b28c11830 100644 --- a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/notification/ORanDOMNotificationToXPath.java +++ b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/notification/ORanDOMNotificationToXPath.java @@ -29,7 +29,9 @@ import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.mdsal.dom.api.DOMEvent; import org.opendaylight.mdsal.dom.api.DOMNotification; import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; @@ -64,61 +66,61 @@ public class ORanDOMNotificationToXPath { private void recurseDOMData(@NonNull ContainerNode notifContainer, DataContainerChild domData, DataContainerNode cn, HashMap<String, String> result, String namePath) { - PathArgument pa1 = domData.getIdentifier(); - namePath += "/" + pa1.getNodeType().getLocalName(); + NodeIdentifier id = domData.name(); + namePath += "/" + id.getNodeType().getLocalName(); if (domData.getClass().getSimpleName().equals("ImmutableContainerNode")) { try { - ContainerNode cn1 = (ContainerNode) cn.getChildByArg(pa1); + ContainerNode cn1 = (ContainerNode) cn.getChildByArg(id); for (DataContainerChild data1 : cn1.body()) { recurseDOMData(notifContainer, data1, cn1, result, namePath); } } catch (VerifyException ve) { - LOG.debug("{} does not exist", pa1); + LOG.debug("{} does not exist", id); } } if (domData.getClass().getSimpleName().equals("ImmutableChoiceNode")) { try { - ChoiceNode cn1 = (ChoiceNode) cn.getChildByArg(pa1); + ChoiceNode cn1 = (ChoiceNode) cn.getChildByArg(id); for (DataContainerChild data1 : cn1.body()) { // recurseChoiceData(data1, cn1, namePath); recurseDOMData(notifContainer, data1, cn1, result, namePath); } } catch (VerifyException ve) { - LOG.debug("{} does not exist", pa1); + LOG.debug("{} does not exist", id); } } if (domData.getClass().getSimpleName().equals("ImmutableUnkeyedListNode")) { try { - UnkeyedListNode cn1 = (UnkeyedListNode) cn.getChildByArg(pa1); + UnkeyedListNode cn1 = (UnkeyedListNode) cn.getChildByArg(id); for (UnkeyedListEntryNode data1 : cn1.body()) { recurseUnkeyedListEntryNodeData(data1, cn1, result, namePath); } } catch (VerifyException ve) { - LOG.debug("{} does not exist", pa1); + LOG.debug("{} does not exist", id); } } if (domData.getClass().getSimpleName().equals("ImmutableMapNode")) { try { - MapNode cn1 = (MapNode) cn.getChildByArg(pa1); + MapNode cn1 = (MapNode) cn.getChildByArg(id); for (MapEntryNode data1 : cn1.body()) { recurseMapEntryNodeData(notifContainer, data1, cn1, result, namePath); } } catch (VerifyException ve) { - LOG.debug("{} does not exist", pa1); + LOG.debug("{} does not exist", id); } } if (domData.getClass().getSimpleName().equals("ImmutableLeafSetNode")) { try { - LeafSetNode<?> cn1 = (LeafSetNode<?>) cn.getChildByArg(pa1); + LeafSetNode<?> cn1 = (LeafSetNode<?>) cn.getChildByArg(id); for (LeafSetEntryNode<?> data1 : cn1.body()) { recurseLeafSetEntryNodeData(data1, cn1, result, namePath); } } catch (VerifyException ve) { - LOG.debug("{} does not exist", pa1); + LOG.debug("{} does not exist", id); } } @@ -129,7 +131,7 @@ public class ORanDOMNotificationToXPath { private void recurseLeafSetEntryNodeData(LeafSetEntryNode<?> data, LeafSetNode<?> cn1, HashMap<String, String> result, String namePath) { - PathArgument pa1 = data.getIdentifier(); + NodeWithValue<?> pa1 = data.name(); namePath += "/" + pa1.getNodeType().getLocalName(); if (data.getClass().getSimpleName().equals("ImmutableLeafSetEntryNode")) { @@ -140,8 +142,8 @@ public class ORanDOMNotificationToXPath { private void recurseMapEntryNodeData(@NonNull ContainerNode notifContainer, MapEntryNode data, MapNode cn1, HashMap<String, String> result, String namePath) { - PathArgument pa1 = data.getIdentifier(); - NodeIdentifierWithPredicates ni = data.getIdentifier(); + PathArgument pa1 = data.name(); + NodeIdentifierWithPredicates ni = data.name(); for (QName qn : ni.keySet()) { namePath += "/" + ni.getValue(qn); @@ -151,12 +153,12 @@ public class ORanDOMNotificationToXPath { for (DataContainerChild data1 : data.body()) { if (data1.getClass().getSimpleName().equals("ImmutableLeafSetNode")) { try { - LeafSetNode<?> cn2 = (LeafSetNode<?>) data.getChildByArg(data1.getIdentifier()); + LeafSetNode<?> cn2 = (LeafSetNode<?>) data.getChildByArg(data1.name()); for (LeafSetEntryNode<?> data2 : cn2.body()) { recurseLeafSetEntryNodeData(data2, cn2, result, namePath); } } catch (VerifyException ve) { - LOG.debug("{} does not exist", data1.getIdentifier()); + LOG.debug("{} does not exist", data1.name()); } } else { recurseLeafNode(data1, result, namePath); @@ -166,7 +168,7 @@ public class ORanDOMNotificationToXPath { if (data.getClass().getSimpleName().equals("ImmutableLeafSetNode")) { try { - LeafSetNode<?> cn2 = (LeafSetNode<?>) notifContainer.getChildByArg(pa1); + LeafSetNode<?> cn2 = (LeafSetNode<?>) notifContainer.getChildByArg((NodeIdentifier) pa1); for (LeafSetEntryNode<?> data1 : cn2.body()) { recurseLeafSetEntryNodeData(data1, cn2, result, namePath); } @@ -183,7 +185,7 @@ public class ORanDOMNotificationToXPath { private void recurseUnkeyedListEntryNodeData(UnkeyedListEntryNode data, UnkeyedListNode cn1, HashMap<String, String> result, String namePath) { - PathArgument pa1 = data.getIdentifier(); + PathArgument pa1 = data.name(); namePath += "/" + pa1.getNodeType().getLocalName(); if (data.getClass().getSimpleName().equals("ImmutableUnkeyedListEntryNode")) { @@ -199,7 +201,7 @@ public class ORanDOMNotificationToXPath { } public void recurseLeafNode(DataContainerChild data, HashMap<String, String> result, String namePath) { - PathArgument pa1 = data.getIdentifier(); + PathArgument pa1 = data.name(); if (!(data.getClass().getSimpleName().equals("ImmutableAugmentationNode"))) namePath += "/" + pa1.getNodeType().getLocalName(); if (data.getClass().getSimpleName().equals("ImmutableLeafNode")) { @@ -210,7 +212,7 @@ public class ORanDOMNotificationToXPath { public void recurseChoiceData(HashMap<String, String> result, DataContainerChild data, ChoiceNode cn, String namePath) { - PathArgument pa1 = data.getIdentifier(); + PathArgument pa1 = data.name(); namePath += "/" + pa1.getNodeType().getLocalName(); // NodeIdentifier nodeId = new NodeIdentifier(pa1.getNodeType()); if (data.getClass().getSimpleName().equals("ImmutableLeafNode")) { 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/util/ORanDeviceManagerQNames.java b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/util/ORanDeviceManagerQNames.java index e2ad092dc..13058dc53 100644 --- a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/util/ORanDeviceManagerQNames.java +++ b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/oran/util/ORanDeviceManagerQNames.java @@ -43,16 +43,20 @@ public class ORanDeviceManagerQNames { public static final @NonNull QName IETF_HW_COMPONENT_LIST_KEY = QName.create(IETF_HW_MODULE_NAME, "name"); public static final @NonNull QName IETF_HW_COMPONENT_LIST_MFG_NAME = QName.create(IETF_HW_MODULE_NAME, "mfg-name"); //leaf:String public static final @NonNull QName IETF_HW_COMPONENT_LIST_UUID = QName.create(IETF_HW_MODULE_NAME, "uuid"); //leaf:yang:uuid - public static final @NonNull QName IETF_HW_COMPONENT_LIST_MODEL_NAME = QName.create(IETF_HW_MODULE_NAME, "model-name"); //leaf:String + public static final @NonNull QName IETF_HW_COMPONENT_LIST_MODEL_NAME = + QName.create(IETF_HW_MODULE_NAME, "model-name"); //leaf:String public static final @NonNull QName IETF_HW_COMPONENT_LIST_SER_NUM = QName.create(IETF_HW_MODULE_NAME, "serial-num"); //leaf:String - public static final @NonNull QName IETF_HW_COMPONENT_LIST_SW_REV = QName.create(IETF_HW_MODULE_NAME, "software-rev"); //leaf:String + public static final @NonNull QName IETF_HW_COMPONENT_LIST_SW_REV = + QName.create(IETF_HW_MODULE_NAME, "software-rev"); //leaf:String public static final @NonNull QName IETF_HW_COMPONENT_LIST_ALIAS = QName.create(IETF_HW_MODULE_NAME, "alias"); //leaf:String public static final @NonNull QName IETF_HW_COMPONENT_LIST_CLASS = QName.create(IETF_HW_MODULE_NAME, "class"); public static final @NonNull QName IETF_HW_COMPONENT_LIST_MFG_DATE = QName.create(IETF_HW_MODULE_NAME, "mfg-date"); //leaf:yang:date-and-time - public static final @NonNull QName IETF_HW_COMPONENT_LIST_CONTAINS_CHILD = QName.create(IETF_HW_MODULE_NAME, "contains-child"); //leaf-list:leafref + public static final @NonNull QName IETF_HW_COMPONENT_LIST_CONTAINS_CHILD = + QName.create(IETF_HW_MODULE_NAME, "contains-child"); //leaf-list:leafref public static final @NonNull QName IETF_HW_COMPONENT_LIST_PARENT = QName.create(IETF_HW_MODULE_NAME, "parent"); //leaf:leafref public static final @NonNull QName IETF_HW_COMPONENT_LIST_DESC = QName.create(IETF_HW_MODULE_NAME, "description"); //leaf:String - public static final @NonNull QName IETF_HW_COMPONENT_LIST_HW_REV = QName.create(IETF_HW_MODULE_NAME, "hardware-rev"); //leaf:String + public static final @NonNull QName IETF_HW_COMPONENT_LIST_HW_REV = + QName.create(IETF_HW_MODULE_NAME, "hardware-rev"); //leaf:String //odl-netconf-callhome-server.yang public static final String CALLHOME_SERVER_NS = "urn:opendaylight:params:xml:ns:yang:netconf-callhome-server"; @@ -71,31 +75,49 @@ public class ORanDeviceManagerQNames { //o-ran-hardware.yang public static final String ORAN_HW_NS = "urn:o-ran:hardware:1.0"; public static final String ORAN_HW_REVISION = "2019-03-28"; - public static final @NonNull QName ORAN_HW_MODULE = QName.create(ORAN_HW_NS, ORAN_HW_REVISION, "o-ran-hardware").intern(); + public static final @NonNull QName ORAN_HW_MODULE = + QName.create(ORAN_HW_NS, ORAN_HW_REVISION, "o-ran-hardware").intern(); public static final @NonNull QName ORAN_HW_COMPONENT = QName.create(ORAN_HW_MODULE, "O-RAN-HW-COMPONENT"); //ietf-netconf-notifications.yang public static final String IETF_NETCONF_NOTIFICATIONS_NS = "urn:ietf:params:xml:ns:yang:ietf-netconf-notifications"; public static final String IETF_NETCONF_NOTIFICATIONS_REVISION = "2012-02-06"; - public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_MODULE = QName.create(IETF_NETCONF_NOTIFICATIONS_NS, IETF_NETCONF_NOTIFICATIONS_REVISION, "ietf-netconf-notifications").intern(); - public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_NETCONF_CONFIG_CHANGE = QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "netconf-config-change"); - public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_NETCONF_CONFIRMED_COMMIT = QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "netconf-confirmed-commit"); - public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_NETCONF_SESSION_START = QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "netconf-session-start"); - public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_NETCONF_SESSION_END = QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "netconf-session-end"); - public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_NETCONF_CAPABILITY_CHANGE = QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "netconf-capability-change"); - public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_CHANGEDBY = QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "changed-by"); - public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_SERVERORUSER = QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "server-or-user"); - public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_EDITNODE = QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "edit"); - public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_USERNAME = QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "username"); - public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_SESSIONID = QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "session-id"); - public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_OPERATION = QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "operation"); - public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_TARGET = QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "target"); - public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_DATASTORE = QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "datastore"); + public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_MODULE = QName + .create(IETF_NETCONF_NOTIFICATIONS_NS, IETF_NETCONF_NOTIFICATIONS_REVISION, "ietf-netconf-notifications") + .intern(); + public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_NETCONF_CONFIG_CHANGE = + QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "netconf-config-change"); + public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_NETCONF_CONFIRMED_COMMIT = + QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "netconf-confirmed-commit"); + public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_NETCONF_SESSION_START = + QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "netconf-session-start"); + public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_NETCONF_SESSION_END = + QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "netconf-session-end"); + public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_NETCONF_CAPABILITY_CHANGE = + QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "netconf-capability-change"); + public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_CHANGEDBY = + QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "changed-by"); + public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_SERVERORUSER = + QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "server-or-user"); + public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_EDITNODE = + QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "edit"); + public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_USERNAME = + QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "username"); + public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_SESSIONID = + QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "session-id"); + public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_OPERATION = + QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "operation"); + public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_TARGET = + QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "target"); + public static final @NonNull QName IETF_NETCONF_NOTIFICATIONS_DATASTORE = + QName.create(IETF_NETCONF_NOTIFICATIONS_MODULE, "datastore"); //o-ran-supervision.yang public static final String ORAN_SUPERVISION_NS = "urn:o-ran:supervision:1.0"; public static final String ORAN_SUPERVISION_REVISION = "2022-12-05"; - public static final @NonNull QName ORAN_SUPERVISION_MODULE = QName.create(ORAN_SUPERVISION_NS, ORAN_SUPERVISION_REVISION, "o-ran-supervision"); - public static final @NonNull QName ORAN_SUPERVISION_NOTIFICATION = QName.create(ORAN_SUPERVISION_MODULE, "supervision-notification"); + public static final @NonNull QName ORAN_SUPERVISION_MODULE = + QName.create(ORAN_SUPERVISION_NS, ORAN_SUPERVISION_REVISION, "o-ran-supervision"); + public static final @NonNull QName ORAN_SUPERVISION_NOTIFICATION = + QName.create(ORAN_SUPERVISION_MODULE, "supervision-notification"); } 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/OnapSystem.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/OnapSystem.java index 03ed89111..6ca61ffbb 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/OnapSystem.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/OnapSystem.java @@ -21,7 +21,6 @@ */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.yangspecs; -import com.google.common.collect.Sets; import java.util.Arrays; import java.util.List; import java.util.Optional; @@ -36,7 +35,6 @@ import org.opendaylight.yangtools.yang.common.QNameModule; import org.opendaylight.yangtools.yang.common.Revision; import org.opendaylight.yangtools.yang.common.XMLNamespace; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.AugmentationIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.InstanceIdentifierBuilder; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.slf4j.Logger; @@ -89,19 +87,9 @@ public class OnapSystem extends YangModule { @NonNull InstanceIdentifierBuilder ietfSystemIID = YangInstanceIdentifier.builder().node(ORanDeviceManagerQNames.IETF_SYSTEM_CONTAINER); - @NonNull - AugmentationIdentifier onapSystemIID = null; - if (netconfDomAccessor.getCapabilites().isSupportingNamespaceAndRevision(ONAPSYSTEM_2020_10_26)) - onapSystemIID = YangInstanceIdentifier.AugmentationIdentifier.create(Sets.newHashSet(NAME, WEB_UI)); - else if (netconfDomAccessor.getCapabilites().isSupportingNamespaceAndRevision(ONAPSYSTEM_2022_11_04)) - onapSystemIID = YangInstanceIdentifier.AugmentationIdentifier - .create(Sets.newHashSet(NAME, WEB_UI, GEOGRAPHICAL_LOCATION)); - - InstanceIdentifierBuilder augmentedOnapSystem = - YangInstanceIdentifier.builder(ietfSystemIID.build()).node(onapSystemIID); Optional<NormalizedNode> res = - netconfDomAccessor.readDataNode(LogicalDatastoreType.OPERATIONAL, augmentedOnapSystem.build()); + netconfDomAccessor.readDataNode(LogicalDatastoreType.OPERATIONAL, ietfSystemIID.build()); LOG.debug("Result of System1 = {}", res); return res.isPresent() ? res.get() : null; 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 b86177cdb..46d0b851a 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 @@ -24,7 +24,6 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.impl.dom; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; -import com.google.common.collect.Sets; import java.io.IOException; import java.io.InputStream; import java.net.URISyntaxException; @@ -33,6 +32,7 @@ import java.util.List; import java.util.Optional; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; +import org.eclipse.jdt.annotation.NonNull; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; @@ -53,19 +53,18 @@ import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.QNameModule; import org.opendaylight.yangtools.yang.common.Revision; import org.opendaylight.yangtools.yang.common.XMLNamespace; -import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; -import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListEntryNode; import org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode; +import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizationResult; import org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter; import org.opendaylight.yangtools.yang.data.codec.xml.XmlParserStream; import org.opendaylight.yangtools.yang.data.impl.schema.Builders; import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes; import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNormalizedNodeStreamWriter; -import org.opendaylight.yangtools.yang.data.impl.schema.NormalizedNodeResult; +import org.opendaylight.yangtools.yang.data.impl.schema.NormalizationResultHolder; import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute; import org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.Inference; @@ -135,7 +134,7 @@ public class TestORanDOMToInternalDataModel { */ final XMLStreamReader reader = UntrustedXML.createXMLStreamReader(resourceAsStream); - final NormalizedNodeResult result = new NormalizedNodeResult(); + final NormalizationResultHolder result = new NormalizationResultHolder(); final NormalizedNodeStreamWriter streamWriter = ImmutableNormalizedNodeStreamWriter.from(result); final XmlParserStream xmlParser = XmlParserStream.create(streamWriter, hwContainerSchema); @@ -144,7 +143,7 @@ public class TestORanDOMToInternalDataModel { xmlParser.flush(); xmlParser.close(); - NormalizedNode transformedInput = result.getResult(); + NormalizedNode transformedInput = result.getResult().data(); List<Inventory> inventoryList = ORanDOMToInternalDataModel.getInventoryList(nodeId, transformedInput); assertEquals("All elements", 27, inventoryList.size()); @@ -160,7 +159,7 @@ public class TestORanDOMToInternalDataModel { final XMLStreamReader reader = UntrustedXML.createXMLStreamReader(resourceAsStream); - final NormalizedNodeResult result = new NormalizedNodeResult(); + final NormalizationResultHolder result = new NormalizationResultHolder(); final NormalizedNodeStreamWriter streamWriter = ImmutableNormalizedNodeStreamWriter.from(result); final XmlParserStream xmlParser = XmlParserStream.create(streamWriter, systemSchema); @@ -169,14 +168,10 @@ public class TestORanDOMToInternalDataModel { xmlParser.flush(); xmlParser.close(); - NormalizedNode transformedInput = result.getResult(); + NormalizedNode transformedInput = result.getResult().data(); ContainerNode cn = (ContainerNode) transformedInput; - AugmentationNode gcData = (AugmentationNode) cn.childByArg( - YangInstanceIdentifier.AugmentationIdentifier.create(Sets.newHashSet(onapSystem.get().getName(), - onapSystem.get().getWebUi(), onapSystem.get().getGeoLocation()))); - Optional<Guicutthrough> gc = ORanDOMToInternalDataModel.getGuicutthrough(gcData, onapSystem.get()); + Optional<Guicutthrough> gc = ORanDOMToInternalDataModel.getGuicutthrough(cn, onapSystem.get()); assertEquals(gc.isPresent(), true); - } @Test @@ -193,7 +188,7 @@ public class TestORanDOMToInternalDataModel { TestORanDOMToInternalDataModel.class.getResourceAsStream("/oran-fm-active-alarm.xml"); final XMLStreamReader reader = UntrustedXML.createXMLStreamReader(resourceAsStream); - final NormalizedNodeResult result = new NormalizedNodeResult(); + final NormalizationResultHolder result = new NormalizationResultHolder(); final NormalizedNodeStreamWriter streamWriter = ImmutableNormalizedNodeStreamWriter.from(result); final XmlParserStream xmlParser = XmlParserStream.create(streamWriter, activeAlarmSchema); @@ -201,8 +196,8 @@ public class TestORanDOMToInternalDataModel { xmlParser.flush(); xmlParser.close(); - NormalizedNode transformedInput = result.getResult(); - ContainerNode cn = (ContainerNode) transformedInput; + @NonNull NormalizationResult<?> transformedInput = result.getResult(); + ContainerNode cn = (ContainerNode) transformedInput.data(); UnkeyedListNode activeAlarmsList = (UnkeyedListNode) cn.childByArg(new NodeIdentifier(oranfm.get().getFaultActiveAlarmsQName())); 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/util/TestYangParserUtil.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/util/TestYangParserUtil.java index 611d18141..3c4da3ab4 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/util/TestYangParserUtil.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/util/TestYangParserUtil.java @@ -33,11 +33,11 @@ import java.util.Iterator; import java.util.ServiceLoader; import java.util.Set; import java.util.stream.Collectors; - import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.YangConstants; import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext; +import org.opendaylight.yangtools.yang.model.api.stmt.FeatureSet; import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation; import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource; import org.opendaylight.yangtools.yang.parser.api.YangParser; @@ -98,7 +98,7 @@ public final class TestYangParserUtil { final Set<QName> supportedFeatures, final Collection<? extends SchemaSourceRepresentation> sources) { final YangParser parser = PARSER_FACTORY.createParser(config); if (supportedFeatures != null) { - parser.setSupportedFeatures(supportedFeatures); + parser.setSupportedFeatures(FeatureSet.of(supportedFeatures)); } try { diff --git a/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/test1.properties b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/test1.properties new file mode 100644 index 000000000..26be56092 --- /dev/null +++ b/sdnr/wt/devicemanager-o-ran-sc/o-ran/ru-fh/provider/test1.properties @@ -0,0 +1,3 @@ +[ORAN-SUPERVISION] +supervision-notification-interval=60 +guard-timer-overhead=10 |