summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/devicemanager-onap/onf12
diff options
context:
space:
mode:
authorKAPIL SINGAL <ks220y@att.com>2021-09-24 14:15:03 +0000
committerGerrit Code Review <gerrit@onap.org>2021-09-24 14:15:03 +0000
commit49043c23a17b769ecd0494c2555fa3b262da7b8d (patch)
tree6342770864832be58ed36dc7ada852ebdfbbd897 /sdnr/wt/devicemanager-onap/onf12
parent6e27e7ad9643731e607a103cfd04ba3c78b9a6c8 (diff)
parent0a67cd894779602b8da5b9158fa68a4c5b5e99e6 (diff)
Merge "Support GuiCutThrough for ONF12 devicemanager" into istanbul
Diffstat (limited to 'sdnr/wt/devicemanager-onap/onf12')
-rw-r--r--sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Base.java28
-rw-r--r--sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java3
2 files changed, 27 insertions, 4 deletions
diff --git a/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Base.java b/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Base.java
index af2b2405b..0e1a448b5 100644
--- a/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Base.java
+++ b/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Base.java
@@ -27,26 +27,30 @@ import java.util.concurrent.CopyOnWriteArrayList;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.onap.ccsdk.features.sdnr.wt.common.YangHelper;
+import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElementService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.NetworkElementCoreData;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.WrapperPTPModelRev170208;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.equipment.ONFCoreNetworkElement12Equipment;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.Helper;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.WrapperMicrowaveModelRev181010;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.InventoryInformationDcae;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.PerformanceDataLtp;
-import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor;
import org.opendaylight.mdsal.binding.api.MountPoint;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.NetworkElement;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.extension.g.Extension;
+import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.extension.g.ExtensionKey;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.logical.termination.point.g.Lp;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.network.element.Ltp;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.onf.core.model.conditional.packages.rev170402.NetworkElementPac;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.onf.core.model.conditional.packages.rev170402.network.element.pac.NetworkElementCurrentProblems;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Guicutthrough;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.GuicutthroughBuilder;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
@@ -77,7 +81,7 @@ public abstract class ONFCoreNetworkElement12Base extends ONFCoreNetworkElementB
@SuppressWarnings("null")
private final @NonNull List<Lp> interfaceList = Collections.synchronizedList(new CopyOnWriteArrayList<>());
private Optional<NetworkElement> optionalNe;
-
+ private final DataProvider databaseService;
// Performance monitoring specific part
/** Lock for the PM access specific elements that could be null */
private final @NonNull Object pmLock = new Object();
@@ -99,13 +103,14 @@ public abstract class ONFCoreNetworkElement12Base extends ONFCoreNetworkElementB
* Constructor
*/
- protected ONFCoreNetworkElement12Base(@NonNull NetconfBindingAccessor acessor) {
+ protected ONFCoreNetworkElement12Base(@NonNull NetconfBindingAccessor acessor, @NonNull DeviceManagerServiceProvider serviceProvider) {
super(acessor);
this.optionalNe = Optional.empty();
this.nodeId = getAcessor().get().getNodeId();
this.isNetworkElementCurrentProblemsSupporting12 =
acessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkElementPac.QNAME);
this.equipment = new ONFCoreNetworkElement12Equipment(acessor, this);
+ this.databaseService = serviceProvider.getDataProvider();
WrapperPTPModelRev170208.initSynchronizationExtension(acessor);
LOG.debug("support necurrent-problem-list={}", this.isNetworkElementCurrentProblemsSupporting12);
}
@@ -163,6 +168,10 @@ public abstract class ONFCoreNetworkElement12Base extends ONFCoreNetworkElementB
} else {
NetworkElement ne = optionalNe.get();
+ Optional<Guicutthrough> oGuicutthrough = getGuicutthrough(ne);
+ if (oGuicutthrough.isPresent()) {
+ databaseService.writeGuiCutThroughData(oGuicutthrough.get(), getAcessor().get().getNodeId().getValue());
+ }
LOG.debug("Mountpoint '{}' NE-Name '{}'", getMountpoint(), ne.getName());
List<Lp> actualInterfaceList = getLtpList(ne);
if (!interfaceList.equals(actualInterfaceList)) {
@@ -435,4 +444,17 @@ public abstract class ONFCoreNetworkElement12Base extends ONFCoreNetworkElementB
return Optional.empty();
}
+ //Guicutthrough
+ public Optional<Guicutthrough> getGuicutthrough(NetworkElement ne) {
+ Extension extension = ne.nonnullExtension().get(new ExtensionKey("webUri"));
+ if (extension != null) {
+ GuicutthroughBuilder gcBuilder = new GuicutthroughBuilder();
+ gcBuilder.setName(getAcessor().get().getNodeId().getValue());
+ gcBuilder.setWeburi(extension.getValue());
+ return Optional.of(gcBuilder.build());
+ } else {
+ return Optional.empty();
+ }
+ }
+
}
diff --git a/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java b/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java
index 9bd1ddb93..da9b45fd3 100644
--- a/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java
+++ b/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java
@@ -83,7 +83,7 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base {
public ONFCoreNetworkElement12Basic(@NonNull NetconfBindingAccessor acessor,
@NonNull DeviceManagerServiceProvider serviceProvider, DeviceManagerOnfConfiguration configuration) {
- super(acessor);
+ super(acessor, serviceProvider);
this.mountPointNodeId = acessor.getNodeId();
this.acessor = acessor;
this.pollAlarmConfig = configuration;
@@ -235,6 +235,7 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base {
performanceManager.deRegistration(mountPointNodeId);
aaiProviderClient.onDeviceUnregistered(mountPointNodeId);
faultService.removeAllCurrentProblemsOfNode(acessor.getNodeId());
+ dataProvider.clearGuiCutThroughEntriesOfNode(acessor.getNodeId().getValue());
}
@Override