aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavi Pendurty <ravi.pendurty@highstreet-technologies.com>2021-09-24 10:30:25 +0530
committerKAPIL SINGAL <ks220y@att.com>2021-09-24 05:36:30 +0000
commitf5bd3c0b3fe9e2a813f9f34bb09f8cc3e93882d8 (patch)
treed29fc69401a6accca476537517d8631972c4d5fd
parentb3201cac7e1114a74c54841f3f3f446f3bb82c28 (diff)
Support GuiCutThrough for ONF12 devicemanager
Support GuiCutThrough for ONF12 devicemanager Issue-ID: SDNC-1498 Change-Id: Ie4b7d9f16230ea398c9dff6a5e5a534994608806 Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
-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