use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.l2gateways.rev150712.l2gateways.attributes.L2gateways in project netvirt by opendaylight.
the class L2GwValidateCli method readNodes.
private void readNodes() throws ReadFailedException {
try (ReadOnlyTransaction tx = dataBroker.newReadOnlyTransaction()) {
InstanceIdentifier<Topology> topoId = HwvtepSouthboundUtils.createHwvtepTopologyInstanceIdentifier();
Optional<Topology> operationalTopoOptional = tx.read(LogicalDatastoreType.OPERATIONAL, topoId).checkedGet();
Optional<Topology> configTopoOptional = tx.read(LogicalDatastoreType.CONFIGURATION, topoId).checkedGet();
if (operationalTopoOptional.isPresent()) {
for (Node node : operationalTopoOptional.get().getNode()) {
InstanceIdentifier<Node> nodeIid = topoId.child(Node.class, node.getKey());
operationalNodes.put(nodeIid, node);
}
}
if (configTopoOptional.isPresent()) {
for (Node node : configTopoOptional.get().getNode()) {
InstanceIdentifier<Node> nodeIid = topoId.child(Node.class, node.getKey());
configNodes.put(nodeIid, node);
}
}
fillNodesData(operationalNodes, operationalNodesData);
fillNodesData(configNodes, configNodesData);
Optional<ElanInstances> elanInstancesOptional = tx.read(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.builder(ElanInstances.class).build()).checkedGet();
if (elanInstancesOptional.isPresent() && elanInstancesOptional.get().getElanInstance() != null) {
for (ElanInstance elanInstance : elanInstancesOptional.get().getElanInstance()) {
elanInstanceMap.put(elanInstance.getElanInstanceName(), elanInstance);
}
}
l2gatewayConnections = L2GatewayConnectionUtils.getAllL2gatewayConnections(dataBroker);
l2gateways = L2GatewayConnectionUtils.getL2gatewayList(dataBroker);
for (L2gateway l2gateway : l2gateways) {
uuidToL2Gateway.put(l2gateway.getUuid(), l2gateway);
}
}
}
Aggregations