diff options
author | Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> | 2020-11-02 12:38:04 +0100 |
---|---|---|
committer | Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> | 2020-11-03 04:52:05 +0000 |
commit | 1d9becc737e698f3f06bca34c94fd63254052154 (patch) | |
tree | 6f71798c06b0b7b0c6588c2952cfe57eadc19765 /sdnr/wt/devicemanager-onf14 | |
parent | 562b91c16ea3670bf0c4f7a2bf4d578207eecf07 (diff) |
Set coremodel for ONF Devicemanagers
Set coremodel for ONF Devicemanagers
Issue-ID: SDNC-1383
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Change-Id: Ia6015dbf16ec7ded8066a2e68d1cb53d130670c3
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/devicemanager-onf14')
-rw-r--r-- | sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14NetworkElement.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14NetworkElement.java b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14NetworkElement.java index 92840fb3c..816aa50f4 100644 --- a/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14NetworkElement.java +++ b/sdnr/wt/devicemanager-onf14/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf14/impl/Onf14NetworkElement.java @@ -28,6 +28,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElementSe import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.LAYERPROTOCOLNAMETYPEAIRLAYER; @@ -51,11 +52,14 @@ import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.cont import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.equipment.ContainedHolder; import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.logical.termination.point.LayerProtocol; import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.logical.termination.point.LayerProtocolKey; +import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode; +import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementConnectionBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementDeviceType; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.opendaylight.yangtools.yang.binding.NotificationListener; +import org.opendaylight.yangtools.yang.common.QName; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -125,8 +129,31 @@ public class Onf14NetworkElement implements NetworkElement { } } + /** + * @param nNode + * set core-model-capability + */ + public void setCoreModel(@NonNull NetconfNode nNode) { + NetworkElementConnectionBuilder eb = new NetworkElementConnectionBuilder(); + log.info("In setCoreModel for Onf14NetworkElement"); + String namespaceRevision; + QName QNAME_COREMODEL14 = QName.create("urn:onf:yang:core-model-1-4", "2019-11-27", "core-model-1-4").intern(); + + Capabilities availableCapabilities = Capabilities.getAvailableCapabilities(nNode); + namespaceRevision = availableCapabilities.getRevisionForNamespace(QNAME_COREMODEL14); + log.info("In setCoreModel for Onf14NetworkElement- namespaceRevision = "+namespaceRevision); + if (Capabilities.isNamespaceSupported(namespaceRevision)) { + eb.setCoreModelCapability(namespaceRevision); + } else { + eb.setCoreModelCapability("Unsupported"); + } + databaseService.updateNetworkConnection22(eb.build(), netconfAccessor.getNodeId().getValue()); + } + @Override public void register() { + // Set core-model revision value in "core-model-capability" field + setCoreModel(netconfAccessor.getNetconfNode()); initialReadFromNetworkElement(); // Register netconf stream airInterfaceNotificationListenerHandler = |