2 * ============LICENSE_START========================================================================
3 * ONAP : ccsdk feature sdnr wt
4 * =================================================================================================
5 * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. All rights reserved.
6 * =================================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8 * in compliance with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software distributed under the License
13 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14 * or implied. See the License for the specific language governing permissions and limitations under
16 * ============LICENSE_END==========================================================================
18 package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf14.impl;
20 import java.util.ArrayList;
21 import java.util.Collection;
22 import java.util.List;
23 import java.util.Optional;
24 import org.eclipse.jdt.annotation.NonNull;
25 import org.eclipse.jdt.annotation.Nullable;
26 import org.onap.ccsdk.features.sdnr.wt.common.YangHelper;
27 import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
28 import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElement;
29 import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElementService;
30 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
31 import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
32 import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData;
33 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities;
34 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
35 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
36 import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.LAYERPROTOCOLNAMETYPEAIRLAYER;
37 import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.air._interface.lp.spec.AirInterfacePac;
38 import org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.air._interface.pac.AirInterfaceCurrentProblems;
39 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.ControlConstruct;
40 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.LAYERPROTOCOLNAMETYPE;
41 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.UniversalId;
42 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.control.construct.Equipment;
43 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.control.construct.EquipmentKey;
44 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.control.construct.LogicalTerminationPoint;
45 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.control.construct.LogicalTerminationPointKey;
46 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.equipment.ContainedHolder;
47 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.logical.termination.point.LayerProtocol;
48 import org.opendaylight.yang.gen.v1.urn.onf.yang.core.model._1._4.rev191127.logical.termination.point.LayerProtocolKey;
49 import org.opendaylight.yang.gen.v1.urn.onf.yang.ethernet.container._2._0.rev200121.LAYERPROTOCOLNAMETYPEETHERNETCONTAINERLAYER;
50 import org.opendaylight.yang.gen.v1.urn.onf.yang.ethernet.container._2._0.rev200121.ethernet.container.lp.spec.EthernetContainerPac;
51 import org.opendaylight.yang.gen.v1.urn.onf.yang.ethernet.container._2._0.rev200121.ethernet.container.pac.EthernetContainerCurrentProblems;
52 import org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.LAYERPROTOCOLNAMETYPEWIRELAYER;
53 import org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.wire._interface.lp.spec.WireInterfacePac;
54 import org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.wire._interface.pac.WireInterfaceCurrentProblems;
55 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
56 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementConnectionBuilder;
57 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementDeviceType;
58 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
59 import org.opendaylight.yangtools.concepts.ListenerRegistration;
60 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
61 import org.opendaylight.yangtools.yang.binding.NotificationListener;
62 import org.opendaylight.yangtools.yang.common.QName;
63 import org.slf4j.Logger;
64 import org.slf4j.LoggerFactory;
67 * Repesentation of ONF Core model 1.4 device Top level element is "ControlConstruct" (replaces "NetworkElement" of
70 public class Onf14NetworkElement implements NetworkElement {
72 private static final Logger log = LoggerFactory.getLogger(Onf14NetworkElement.class);
74 protected static final InstanceIdentifier<ControlConstruct> CONTROLCONSTRUCT_IID =
75 InstanceIdentifier.builder(ControlConstruct.class).build();
77 private static final int EQUIPMENTROOTLEVEL = 0;
79 private final NetconfAccessor netconfAccessor;
80 private final DataProvider databaseService;
81 private final Onf14ToInternalDataModel onf14Mapper;
82 private final @NonNull FaultService faultService;
84 // for storing the Equipment UUIDs that are inserted in the DB
85 private final List<String> equipmentUuidList = new ArrayList<String>();
87 // air interface related members
88 private final List<TechnologySpecificPacKeys> airInterfaceList = new ArrayList<TechnologySpecificPacKeys>();
89 private ListenerRegistration<NotificationListener> airInterfaceNotificationListenerHandler;
90 private @NonNull final Onf14AirInterfaceNotificationListener airInterfaceNotificationListener;
92 // ethernet container related members
93 private final List<TechnologySpecificPacKeys> ethernetContainerList = new ArrayList<TechnologySpecificPacKeys>();
94 private ListenerRegistration<NotificationListener> etherneContainerNotificationListenerHandler;
95 private @NonNull final Onf14EthernetContainerNotificationListener ethernetContainerNotificationListener;
97 // wire interface related members
98 private final List<TechnologySpecificPacKeys> wireInterfaceList = new ArrayList<TechnologySpecificPacKeys>();
99 private ListenerRegistration<NotificationListener> wireInterfaceNotificationListenerHandler;
100 private @NonNull final Onf14WireInterfaceNotificationListener wireInterfaceNotificationListener;
102 Onf14NetworkElement(NetconfAccessor netconfAccess, DeviceManagerServiceProvider serviceProvider) {
103 log.info("Create {}", Onf14NetworkElement.class.getSimpleName());
104 this.netconfAccessor = netconfAccess;
105 this.databaseService = serviceProvider.getDataProvider();
106 this.faultService = serviceProvider.getFaultService();
107 this.onf14Mapper = new Onf14ToInternalDataModel();
108 this.airInterfaceNotificationListenerHandler = null;
109 airInterfaceNotificationListener = new Onf14AirInterfaceNotificationListener(netconfAccess, serviceProvider);
110 this.etherneContainerNotificationListenerHandler = null;
111 ethernetContainerNotificationListener =
112 new Onf14EthernetContainerNotificationListener(netconfAccess, serviceProvider);
113 this.wireInterfaceNotificationListenerHandler = null;
114 wireInterfaceNotificationListener = new Onf14WireInterfaceNotificationListener(netconfAccess, serviceProvider);
117 public void initialReadFromNetworkElement() {
119 // reading the inventory (CoreModel 1.4 Equipment Model) and adding it to the DB
122 FaultData resultList = new FaultData();
124 int problems = faultService.removeAllCurrentProblemsOfNode(netconfAccessor.getNodeId());
125 log.debug("Removed all {} problems from database at registration", problems);
127 readAllAirInterfaceCurrentProblems(resultList);
128 problems = resultList.size();
129 log.debug("NETCONF read air interface current problems completed. Got back {} problems.", problems);
131 readAllEhernetContainerCurrentProblems(resultList);
132 problems = resultList.size() - problems;
133 log.debug("NETCONF read current problems completed. Got back {} problems.", resultList.size());
135 readAllWireInterfaceCurrentProblems(resultList);
136 problems = resultList.size();
137 log.debug("NETCONF read wire interface current problems completed. Got back {} problems.", problems);
139 faultService.initCurrentProblemStatus(netconfAccessor.getNodeId(), resultList);
140 log.debug("DB write current problems completed");
144 public void readAllAirInterfaceCurrentProblems(FaultData resultList) {
146 int idxStart; // Start index for debug messages
148 for (TechnologySpecificPacKeys key : airInterfaceList) {
149 idxStart = resultList.size();
151 readAirInterfaceCurrentProblemForLtp(key.getLtpUuid(), key.getLocalId(), resultList);
152 debugResultList(key.getLtpUuid().getValue(), resultList, idxStart);
156 public void readAllEhernetContainerCurrentProblems(FaultData resultList) {
158 int idxStart; // Start index for debug messages
160 for (TechnologySpecificPacKeys key : ethernetContainerList) {
161 idxStart = resultList.size();
163 readEthernetConainerCurrentProblemForLtp(key.getLtpUuid(), key.getLocalId(), resultList);
164 debugResultList(key.getLtpUuid().getValue(), resultList, idxStart);
168 public void readAllWireInterfaceCurrentProblems(FaultData resultList) {
170 int idxStart; // Start index for debug messages
172 for (TechnologySpecificPacKeys key : wireInterfaceList) {
173 idxStart = resultList.size();
175 readWireInterfaceCurrentProblemForLtp(key.getLtpUuid(), key.getLocalId(), resultList);
176 debugResultList(key.getLtpUuid().getValue(), resultList, idxStart);
182 * set core-model-capability
184 public void setCoreModel(@NonNull NetconfNode nNode) {
185 NetworkElementConnectionBuilder eb = new NetworkElementConnectionBuilder();
186 log.info("In setCoreModel for Onf14NetworkElement");
187 String namespaceRevision;
188 QName QNAME_COREMODEL14 = QName.create("urn:onf:yang:core-model-1-4", "2019-11-27", "core-model-1-4").intern();
190 Capabilities availableCapabilities = Capabilities.getAvailableCapabilities(nNode);
191 namespaceRevision = availableCapabilities.getRevisionForNamespace(QNAME_COREMODEL14);
192 log.info("In setCoreModel for Onf14NetworkElement- namespaceRevision = "+namespaceRevision);
193 if (Capabilities.isNamespaceSupported(namespaceRevision)) {
194 eb.setCoreModelCapability(namespaceRevision);
196 eb.setCoreModelCapability("Unsupported");
198 databaseService.updateNetworkConnection22(eb.build(), netconfAccessor.getNodeId().getValue());
202 public void register() {
203 // Set core-model revision value in "core-model-capability" field
204 setCoreModel(netconfAccessor.getNetconfNode());
205 initialReadFromNetworkElement();
207 // Register netconf stream
208 airInterfaceNotificationListenerHandler =
209 netconfAccessor.doRegisterNotificationListener(airInterfaceNotificationListener);
210 etherneContainerNotificationListenerHandler =
211 netconfAccessor.doRegisterNotificationListener(ethernetContainerNotificationListener);
212 wireInterfaceNotificationListenerHandler =
213 netconfAccessor.doRegisterNotificationListener(wireInterfaceNotificationListener);
214 netconfAccessor.registerNotificationsStream(NetconfAccessor.DefaultNotificationsStream);
218 public void deregister() {}
222 public NodeId getNodeId() {
223 return netconfAccessor.getNodeId();
227 public <L extends NetworkElementService> Optional<L> getService(Class<L> clazz) {
228 return Optional.empty();
232 public void warmstart() {}
235 public Optional<NetconfAccessor> getAcessor() {
236 return Optional.of(netconfAccessor);
240 public NetworkElementDeviceType getDeviceType() {
241 return NetworkElementDeviceType.Wireless;
244 private void readEquipmentData() {
246 Optional<ControlConstruct> controlConstruct = readControlConstruct(netconfAccessor);
248 if (controlConstruct.isPresent()) {
249 // the top-level-equipment list contains the root objects of the Equipment Model
250 log.debug("Getting list of topLevelEquipment for mountpoint {}", netconfAccessor.getNodeId());
252 List<UniversalId> topLevelEquipment = controlConstruct.get().getTopLevelEquipment();
254 if (topLevelEquipment != null) {
255 for (UniversalId uuid : topLevelEquipment) {
256 log.debug("Got back topLevelEquipment with uuid {}", uuid.getValue());
258 // adding all root Equipment objects to the DB
260 Equipment equipmentInstance = readEquipmentInstance(netconfAccessor, uuid);
261 if (equipmentInstance != null) {
262 // recursively adding the root equipment and all its children into the DB
263 addEquipmentToDb(equipmentInstance, null, EQUIPMENTROOTLEVEL);
269 // storing all the LTP UUIDs internally, for later usage, for air-interface and ethernet-container
270 readKeys(controlConstruct);
273 private void addEquipmentToDb(Equipment currentEq, Equipment parentEq, long treeLevel) {
275 // if the Equipment UUID is already in the list, it was already processed
276 // needed for solving possible circular dependencies
277 if (equipmentUuidList.contains(currentEq.getUuid().getValue())) {
278 log.debug("Not adding equipment with uuid {} because it was aleady added...",
279 currentEq.getUuid().getValue());
283 // we add this to our internal list, such that we avoid circular dependencies
284 equipmentUuidList.add(currentEq.getUuid().getValue());
285 log.debug("Adding equipment with uuid {} to the database...", currentEq.getUuid().getValue());
287 // we add our current equipment to the database
288 databaseService.writeInventory(
289 onf14Mapper.getInternalEquipment(netconfAccessor.getNodeId(), currentEq, parentEq, treeLevel));
291 // we iterate the kids of our current equipment and add them to the database recursively
292 // the actual reference is here: /core-model:control-construct/equipment/contained-holder/occupying-fru
294 Collection<ContainedHolder> holderList = YangHelper.getCollection(currentEq.nonnullContainedHolder());
296 for (ContainedHolder holder : holderList) {
298 UniversalId occupyingFru = holder.getOccupyingFru();
299 if (occupyingFru != null) {
301 Equipment childEq = readEquipmentInstance(netconfAccessor, occupyingFru);
303 if (childEq != null) {
304 // current becomes parent and tree level increases by 1
305 addEquipmentToDb(childEq, currentEq, treeLevel + 1);
311 private void readKeys(Optional<ControlConstruct> controlConstruct) {
313 if (controlConstruct.isPresent()) {
315 Collection<LogicalTerminationPoint> ltpList = YangHelper.getCollection(controlConstruct.get().nonnullLogicalTerminationPoint());
316 log.debug("Iterating the LTP list for node {}", netconfAccessor.getNodeId().getValue());
318 // iterating all the Logical Termination Point list
319 for (LogicalTerminationPoint ltp : ltpList) {
321 List<LayerProtocol> lpList = YangHelper.getList(ltp.nonnullLayerProtocol());
322 // the Layer Protocol list should contain only one item, since we have an 1:1 relationship between the LTP and the LP
323 if (lpList.size() != 1) {
324 log.debug("Layer protocol has no 1:1 relationship with the LTP.");
327 // accessing the LP, which should be only 1
328 LayerProtocol lp = lpList.get(0);
330 Class<? extends LAYERPROTOCOLNAMETYPE> layerProtocolName = lp.getLayerProtocolName();
331 if (layerProtocolName != null) {
332 // if the LTP has an airInterface technology extension, the layer protocol name is air-layer
333 if (layerProtocolName.getTypeName() == LAYERPROTOCOLNAMETYPEAIRLAYER.class.getName()) {
334 TechnologySpecificPacKeys airInterfaceKey =
335 new TechnologySpecificPacKeys(ltp.getUuid(), lp.getLocalId());
336 airInterfaceList.add(airInterfaceKey);
337 log.debug("Adding Ltp with uuid {} and local-id {} to the air-interface list",
338 ltp.getUuid().getValue(), lp.getLocalId());
340 // if the LTP has an ethernetContainier technology extension, the layer protocol name is ethernet-container-layer
341 else if (layerProtocolName.getTypeName() == LAYERPROTOCOLNAMETYPEETHERNETCONTAINERLAYER.class
343 TechnologySpecificPacKeys ethernetContainerKey =
344 new TechnologySpecificPacKeys(ltp.getUuid(), lp.getLocalId());
345 ethernetContainerList.add(ethernetContainerKey);
346 log.debug("Adding Ltp with uuid {} and local-id {} to the ethernet-contatinier list",
347 ltp.getUuid().getValue(), lp.getLocalId());
348 } else if (layerProtocolName.getTypeName() == LAYERPROTOCOLNAMETYPEWIRELAYER.class.getName()) {
349 TechnologySpecificPacKeys wireInterfaceKey =
350 new TechnologySpecificPacKeys(ltp.getUuid(), lp.getLocalId());
351 wireInterfaceList.add(wireInterfaceKey);
352 log.debug("Adding Ltp with uuid {} and local-id {} to the wire-interface list",
353 ltp.getUuid().getValue(), lp.getLocalId());
360 private void readAirInterfaceCurrentProblemForLtp(UniversalId ltpUuid, String localId, FaultData resultList) {
362 final Class<AirInterfacePac> clazzPac = AirInterfacePac.class;
364 log.info("DBRead Get current problems for class {} from mountpoint {} for LTP uuid {} and local-id {}",
365 clazzPac.getSimpleName(), netconfAccessor.getNodeId().getValue(), ltpUuid.getValue(), localId);
367 // constructing the IID needs the augmentation exposed byy the air-interface-2-0 model
368 InstanceIdentifier<AirInterfaceCurrentProblems> airInterfaceCurrentProblem_IID = InstanceIdentifier
369 .builder(ControlConstruct.class)
370 .child(LogicalTerminationPoint.class, new LogicalTerminationPointKey(ltpUuid))
371 .child(LayerProtocol.class, new LayerProtocolKey(localId))
373 org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.LayerProtocol1.class)
374 .child(AirInterfacePac.class).child(AirInterfaceCurrentProblems.class).build();
376 // reading all the current-problems list for this specific LTP and LP
377 AirInterfaceCurrentProblems problems = netconfAccessor.getTransactionUtils().readData(
378 netconfAccessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL, airInterfaceCurrentProblem_IID);
380 if (problems == null) {
381 log.debug("DBRead Id {} no AirInterfaceCurrentProblems", ltpUuid);
382 } else if (problems.getCurrentProblemList() == null) {
383 log.debug("DBRead Id {} empty CurrentProblemList", ltpUuid);
385 for (org.opendaylight.yang.gen.v1.urn.onf.yang.air._interface._2._0.rev200121.air._interface.current.problems.CurrentProblemList problem : YangHelper.getCollection(problems
386 .nonnullCurrentProblemList())) {
387 resultList.add(netconfAccessor.getNodeId(), (int) problem.getSequenceNumber(), problem.getTimestamp(),
388 ltpUuid.getValue(), problem.getProblemName(),
389 Onf14AirInterface.mapSeverity(problem.getProblemSeverity()));
394 private void readEthernetConainerCurrentProblemForLtp(UniversalId ltpUuid, String localId, FaultData resultList) {
396 final Class<EthernetContainerPac> clazzPac = EthernetContainerPac.class;
398 log.info("DBRead Get current problems for class {} from mountpoint {} for LTP uuid {} and local-id {}",
399 clazzPac.getSimpleName(), netconfAccessor.getNodeId().getValue(), ltpUuid.getValue(), localId);
401 // constructing the IID needs the augmentation exposed by the ethernet-container-2-0 model
402 InstanceIdentifier<EthernetContainerCurrentProblems> etherneContainerCurrentProblem_IID = InstanceIdentifier
403 .builder(ControlConstruct.class)
404 .child(LogicalTerminationPoint.class, new LogicalTerminationPointKey(ltpUuid))
405 .child(LayerProtocol.class, new LayerProtocolKey(localId))
407 org.opendaylight.yang.gen.v1.urn.onf.yang.ethernet.container._2._0.rev200121.LayerProtocol1.class)
408 .child(EthernetContainerPac.class).child(EthernetContainerCurrentProblems.class).build();
410 // reading all the current-problems list for this specific LTP and LP
411 EthernetContainerCurrentProblems problems = netconfAccessor.getTransactionUtils().readData(
412 netconfAccessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL, etherneContainerCurrentProblem_IID);
414 if (problems == null) {
415 log.debug("DBRead Id {} no EthernetContainerCurrentProblems", ltpUuid);
416 } else if (problems.getCurrentProblemList() == null) {
417 log.debug("DBRead Id {} empty CurrentProblemList", ltpUuid);
419 for (org.opendaylight.yang.gen.v1.urn.onf.yang.ethernet.container._2._0.rev200121.ethernet.container.current.problems.CurrentProblemList problem : YangHelper.getCollection(problems
420 .nonnullCurrentProblemList())) {
421 resultList.add(netconfAccessor.getNodeId(), (int) problem.getSequenceNumber(), problem.getTimestamp(),
422 ltpUuid.getValue(), problem.getProblemName(),
423 Onf14EthernetContainer.mapSeverity(problem.getProblemSeverity()));
428 private void readWireInterfaceCurrentProblemForLtp(UniversalId ltpUuid, String localId, FaultData resultList) {
430 final Class<WireInterfacePac> clazzPac = WireInterfacePac.class;
432 log.info("DBRead Get current problems for class {} from mountpoint {} for LTP uuid {} and local-id {}",
433 clazzPac.getSimpleName(), netconfAccessor.getNodeId().getValue(), ltpUuid.getValue(), localId);
435 // constructing the IID needs the augmentation exposed by the wire-interface-2-0 model
436 InstanceIdentifier<WireInterfaceCurrentProblems> wireInterfaceCurrentProblem_IID = InstanceIdentifier
437 .builder(ControlConstruct.class)
438 .child(LogicalTerminationPoint.class, new LogicalTerminationPointKey(ltpUuid))
439 .child(LayerProtocol.class, new LayerProtocolKey(localId))
441 org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.LayerProtocol1.class)
442 .child(WireInterfacePac.class).child(WireInterfaceCurrentProblems.class).build();
444 // reading all the current-problems list for this specific LTP and LP
445 WireInterfaceCurrentProblems problems = netconfAccessor.getTransactionUtils().readData(
446 netconfAccessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL, wireInterfaceCurrentProblem_IID);
448 if (problems == null) {
449 log.debug("DBRead Id {} no WireInterfaceCurrentProblems", ltpUuid);
450 } else if (problems.getCurrentProblemList() == null) {
451 log.debug("DBRead Id {} empty CurrentProblemList", ltpUuid);
453 for (org.opendaylight.yang.gen.v1.urn.onf.yang.wire._interface._2._0.rev200123.wire._interface.current.problems.CurrentProblemList problem : YangHelper.getCollection(problems
454 .nonnullCurrentProblemList())) {
455 resultList.add(netconfAccessor.getNodeId(), (int) problem.getSequenceNumber(), problem.getTimestamp(),
456 ltpUuid.getValue(), problem.getProblemName(),
457 Onf14WireInterface.mapSeverity(problem.getProblemSeverity()));
462 private Optional<ControlConstruct> readControlConstruct(NetconfAccessor netconfAccessor) {
463 return Optional.ofNullable(netconfAccessor.getTransactionUtils().readData(netconfAccessor.getDataBroker(),
464 LogicalDatastoreType.CONFIGURATION, CONTROLCONSTRUCT_IID));
467 private @Nullable Equipment readEquipmentInstance(NetconfAccessor accessData, UniversalId equipmentUuid) {
469 final Class<?> clazzPac = Equipment.class;
471 log.info("DBRead Get equipment for class {} from mountpoint {} for uuid {}", clazzPac.getSimpleName(),
472 accessData.getNodeId().getValue(), equipmentUuid.getValue());
474 InstanceIdentifier<Equipment> equipmentIID = InstanceIdentifier.builder(ControlConstruct.class)
475 .child(Equipment.class, new EquipmentKey(equipmentUuid)).build();
477 return accessData.getTransactionUtils().readData(accessData.getDataBroker(), LogicalDatastoreType.CONFIGURATION,
481 // defining a structure that can map the LP local-id and its corresponding LTP uuid
482 private class TechnologySpecificPacKeys {
484 private UniversalId ltpUuid;
485 private String localId;
487 public TechnologySpecificPacKeys(UniversalId uuid, String lId) {
492 public UniversalId getLtpUuid() {
496 public String getLocalId() {
500 public void setLtpUuid(UniversalId uuid) {
504 public void setLocalId(String lId) {
511 * LOG the newly added problems of the interface pac
517 private void debugResultList(String uuid, FaultData resultList, int idxStart) {
518 StringBuilder sb = new StringBuilder();
520 for (int t = idxStart; t < resultList.size(); t++) {
523 sb.append(resultList.get(t));
526 log.debug("Found problems {} {}", uuid, sb);