summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/devicemanager-onf/provider/src/main/java
diff options
context:
space:
mode:
authorMichael Dürre <michael.duerre@highstreet-technologies.com>2020-07-29 08:35:29 +0200
committerKAPIL SINGAL <ks220y@att.com>2020-07-29 13:23:01 +0000
commit461cc15c741776837b59b8779e0f5bb683657a10 (patch)
tree2bee62133b014b975b659fdd3daba641ce27a2cd /sdnr/wt/devicemanager-onf/provider/src/main/java
parent4aaaeb525cb04023147527da0164bbf7152fc9fd (diff)
update devicemanager onf
sodium fixes and some small other changes Issue-ID: CCSDK-2576 Signed-off-by: Michael Dürre <michael.duerre@highstreet-technologies.com> Change-Id: I58670cbfbd10c90bd6ade65a0e59d2e7d543cebe
Diffstat (limited to 'sdnr/wt/devicemanager-onf/provider/src/main/java')
-rw-r--r--sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ONFCoreNetworkElement12Equipment.java30
-rw-r--r--sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Base.java4
-rw-r--r--sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java9
-rw-r--r--sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java11
-rw-r--r--sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElementBase.java15
5 files changed, 36 insertions, 33 deletions
diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ONFCoreNetworkElement12Equipment.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ONFCoreNetworkElement12Equipment.java
index 5641f2873..fdaaf4f76 100644
--- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ONFCoreNetworkElement12Equipment.java
+++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ONFCoreNetworkElement12Equipment.java
@@ -27,7 +27,6 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.OnfInterfacePac;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.EquipmentData;
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.netconfnodestateservice.Capabilities;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
@@ -54,32 +53,41 @@ public class ONFCoreNetworkElement12Equipment {
private static final int EQUIPMENTROOTLEVEL = 0;
private final NetworkElementCoreData coreData;
- private final OnfInterfacePac equipmentPac;
+ private final @Nullable OnfInterfacePac equipmentPac;
private final NetconfAccessor acessor;
private final ValueNameList extensionList;
- private final List<UniversalId> topLevelEqUuidList;
+ private final @NonNull List<UniversalId> topLevelEqUuidList;
private final @NonNull FaultData globalProblemList;
private final @NonNull List<ExtendedEquipment> globalEquipmentList;
+ public ONFCoreNetworkElement12Equipment(NetconfAccessor acessor, NetworkElementCoreData coreData) {
+ this(acessor, coreData, false);
+ }
+
public ONFCoreNetworkElement12Equipment(NetconfAccessor acessor, NetworkElementCoreData coreData,
- Capabilities capabilities) {
+ Boolean disabled) {
LOG.debug("Initialize class: {} " + ONFCoreNetworkElement12Equipment.class.getName());
this.acessor = acessor;
this.coreData = coreData;
- if (capabilities.isSupportingNamespaceAndRevision(WrapperEquipmentPacRev170402.QNAME)) {
+ String reason;
+ if (disabled) {
+ this.equipmentPac = null;
+ reason = "disabled";
+ } else if (acessor.getCapabilites().isSupportingNamespaceAndRevision(WrapperEquipmentPacRev170402.QNAME)) {
this.equipmentPac = new WrapperEquipmentPacRev170402(acessor);
- LOG.debug("Equipement pac supported {}", WrapperEquipmentPacRev170402.QNAME);
+ reason = "WrapperEquipmentPacRev170402.QNAME";
} else {
this.equipmentPac = null;
- LOG.debug("Equipement pac not supported {}", WrapperEquipmentPacRev170402.QNAME);
+ reason = "unsupported";
}
+ LOG.debug("Equipement pac initialization '{}'", reason);
+
+ globalEquipmentList = new ArrayList<>();
extensionList = new ValueNameList();
topLevelEqUuidList = new ArrayList<>();
- globalEquipmentList = new ArrayList<>();
globalProblemList = new FaultData();
-
initClassVars();
}
@@ -192,8 +200,8 @@ public class ONFCoreNetworkElement12Equipment {
equipmentList.add(
new ExtendedEquipment(this.getMountpoint(), parentUuid.getValue(), equipment, path, treeLevel));
- if (this.equipmentPac != null) {
- this.equipmentPac.readTheFaults(uuid, problemList);
+ if (equipmentPac != null) {
+ equipmentPac.readTheFaults(uuid, problemList);
List<ContainedHolder> containedHolderListe = equipment.getContainedHolder();
if (containedHolderListe != null) {
diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Base.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Base.java
index 698a39ab6..6ffdd0ce9 100644
--- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Base.java
+++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Base.java
@@ -102,7 +102,7 @@ public abstract class ONFCoreNetworkElement12Base extends ONFCoreNetworkElementB
this.nodeId = getAcessor().get().getNodeId();
this.isNetworkElementCurrentProblemsSupporting12 =
acessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkElementPac.QNAME);
- this.equipment = new ONFCoreNetworkElement12Equipment(acessor, this, acessor.getCapabilites());
+ this.equipment = new ONFCoreNetworkElement12Equipment(acessor, this);
WrapperPTPModelRev170208.initSynchronizationExtension(acessor);
LOG.debug("support necurrent-problem-list={}", this.isNetworkElementCurrentProblemsSupporting12);
}
@@ -141,7 +141,7 @@ public abstract class ONFCoreNetworkElement12Base extends ONFCoreNetworkElementB
* Read from NetworkElement and verify LTPs have changed. If the NE has changed, update to the new structure. From
* initial state it changes also.
*/
- protected synchronized boolean readNetworkElementAndInterfaces() {
+ protected boolean readNetworkElementAndInterfaces() {
LOG.debug("Update mountpoint if changed {}", getMountpoint());
diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java
index 05402f895..19be0281a 100644
--- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java
+++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java
@@ -131,7 +131,7 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base {
* Read during startup all relevant structure and status parameters from device
*/
@Override
- public synchronized void initialReadFromNetworkElement() {
+ public void initialReadFromNetworkElement() {
LOG.debug("Get info about {}", getMountpoint());
@@ -143,13 +143,18 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base {
// Step 2.2: read ne from data store
readNetworkElementAndInterfaces();
+ LOG.debug("NETCONF read network element and interfaces completed");
equipment.readNetworkElementEquipment();
+ LOG.debug("NETCONF read equipment completed");
// Step 2.3: read the existing faults and add to DB
FaultData resultList = readAllCurrentProblemsOfNode();
+ LOG.debug("NETCONF read current problems completed");
equipment.addProblemsofNode(resultList);
faultService.initCurrentProblemStatus(nodeId, resultList);
+ LOG.debug("DB write current problems completed");
+
equipmentService.writeEquipment(equipment.getEquipmentData());
LOG.info("Found info at {} for device {} number of problems: {}", getMountpoint(), getUuId(),
@@ -184,7 +189,7 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base {
// -- Register NE to performance manager
performanceManager.registration(mountPointNodeName, this);
- //events will be already pushed by base devmgr (needs more clarification SDNC-1123)
+ //events will be already pushed by base devmgr (needs more clarification SDNC-1123)
//eventListenerHandler.registration(mountPointNodeName, acessor.getNetconfNode());
//LOG.debug("refresh necon entry for {} with type {} not",mountPointNodeName,this.getDeviceType());
//eventListenerHandler.connectIndication(mountPointNodeName, getDeviceType());
diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java
index a8384ea61..0fc5b15f4 100644
--- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java
+++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java
@@ -172,7 +172,7 @@ public class ONFCoreNetworkElement12Microwave extends ONFCoreNetworkElement12Bas
*
* @param uuidString of the equipment-pac
*/
- private synchronized void syncEquipmentPac(String uuidString) {
+ private void syncEquipmentPac(String uuidString) {
int problems = microwaveEventListener.removeObjectsCurrentProblemsOfNode(nodeId, uuidString);
LOG.debug("Removed {} problems for uuid {}", problems, uuidString);
@@ -192,7 +192,7 @@ public class ONFCoreNetworkElement12Microwave extends ONFCoreNetworkElement12Bas
* Read during startup all relevant structure and status parameters from device
*/
@Override
- public synchronized void initialReadFromNetworkElement() {
+ public void initialReadFromNetworkElement() {
LOG.debug("Get info about {}", getMountpoint());
int problems = microwaveEventListener.removeAllCurrentProblemsOfNode(nodeId);
@@ -203,13 +203,17 @@ public class ONFCoreNetworkElement12Microwave extends ONFCoreNetworkElement12Bas
// Step 2.2: read ne from data store
readNetworkElementAndInterfaces();
+ LOG.debug("NETCONF read network element and interfaces completed");
equipment.readNetworkElementEquipment();
+ LOG.debug("NETCONF read equipment completed");
// Step 2.3: read the existing faults and add to DB
FaultData resultList = readAllCurrentProblemsOfNode();
+ LOG.debug("NETCONF read current problems completed");
equipment.addProblemsofNode(resultList);
microwaveEventListener.initCurrentProblemStatus(nodeId, resultList);
+ LOG.debug("DB write current problems completed");
equipmentService.writeEquipment(equipment.getEquipmentData());
LOG.info("Found info at {} for device {} number of problems: {}", getMountpoint(), getUuId(),
@@ -256,6 +260,7 @@ public class ONFCoreNetworkElement12Microwave extends ONFCoreNetworkElement12Bas
idxStart = resultList.size();
uuid = Helper.nnGetUniversalId(lp.getUuid());
+ @Nullable
Class<?> lpClass = getLpExtension(lp);
ONFLayerProtocolName lpName = ONFLayerProtocolName.valueOf(lp.getLayerProtocolName());
@@ -321,7 +326,7 @@ public class ONFCoreNetworkElement12Microwave extends ONFCoreNetworkElement12Bas
QName qName = QName.create(capability, revision, conditionalPackage);
res = this.microwaveModel.getClassForLtpExtension(qName);
} catch (IllegalArgumentException e) {
- LOG.debug("Can not create QName from ({}{}{}): {}", capability, revision, conditionalPackage,
+ LOG.warn("Can not create QName from ({}{}{}): {}", capability, revision, conditionalPackage,
e.getMessage());
}
}
diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElementBase.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElementBase.java
index 40a6d323b..deacab8f2 100644
--- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElementBase.java
+++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElementBase.java
@@ -21,24 +21,10 @@
package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ne;
import java.util.Optional;
-import javax.annotation.Nonnull;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ONFCoreNetworkElementRepresentation;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.InternalConnectionStatus;
-import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
import org.opendaylight.mdsal.binding.api.DataBroker;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Host;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
-import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.NetworkElement;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.Credentials;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.credentials.credentials.LoginPassword;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ConnectionLogStatus;
-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.NetworkElementConnectionEntity;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementDeviceType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.network.element.connection.entity.NodeDetailsBuilder;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -47,7 +33,6 @@ import org.slf4j.LoggerFactory;
* @author herbert
*
*/
-@SuppressWarnings("deprecation")
public abstract class ONFCoreNetworkElementBase implements AutoCloseable, ONFCoreNetworkElementRepresentation {
private static final Logger LOG = LoggerFactory.getLogger(ONFCoreNetworkElementBase.class);