use of org.opendaylight.yang.gen.v1.urn.tech.pantheon.netconfdevice.network.topology.rpcs.rev180320.node.data.Node in project netvirt by opendaylight.
the class HAOpNodeListener method readAndCopyChildPsOpToParent.
private void readAndCopyChildPsOpToParent(Node childNode, ReadWriteTransaction tx) {
String childGlobalNodeId = childNode.getNodeId().getValue();
List<InstanceIdentifier> childPsIids = new ArrayList<>();
HwvtepGlobalAugmentation hwvtepGlobalAugmentation = childNode.getAugmentation(HwvtepGlobalAugmentation.class);
if (hwvtepGlobalAugmentation == null || HwvtepHAUtil.isEmpty(hwvtepGlobalAugmentation.getSwitches())) {
haOpClusteredListener.getConnectedNodes().stream().filter((connectedIid) -> IS_PS_CHILD_TO_GLOBAL_NODE.test(childGlobalNodeId, connectedIid)).forEach((connectedIid) -> childPsIids.add(connectedIid));
} else {
hwvtepGlobalAugmentation.getSwitches().forEach((switches) -> childPsIids.add(switches.getSwitchRef().getValue()));
}
if (childPsIids.isEmpty()) {
LOG.info("No child ps found for global {}", childGlobalNodeId);
}
childPsIids.forEach((psIid) -> {
try {
InstanceIdentifier<Node> childPsIid = psIid;
Optional<Node> childPsNode = tx.read(LogicalDatastoreType.OPERATIONAL, childPsIid).checkedGet();
if (childPsNode.isPresent()) {
LOG.debug("Child oper PS node found");
onPsNodeAdd(childPsIid, childPsNode.get(), tx);
} else {
LOG.debug("Child oper ps node not found {}", childPsIid);
}
} catch (ReadFailedException e) {
LOG.error("Failed to read child ps node {}", psIid);
}
});
}
use of org.opendaylight.yang.gen.v1.urn.tech.pantheon.netconfdevice.network.topology.rpcs.rev180320.node.data.Node in project netvirt by opendaylight.
the class HwvtepNodeBaseListener method processConnectedNodes.
void processConnectedNodes(Collection<DataTreeModification<Node>> changes, ReadWriteTransaction tx) throws ReadFailedException {
for (DataTreeModification<Node> change : changes) {
InstanceIdentifier<Node> key = change.getRootPath().getRootIdentifier();
DataObjectModification<Node> mod = change.getRootNode();
Node node = HwvtepHAUtil.getCreated(mod);
String nodeId = key.firstKeyOf(Node.class).getNodeId().getValue();
if (node != null) {
if (!nodeId.contains(HwvtepHAUtil.PHYSICALSWITCH)) {
LOG.trace("Handle global node add {}", node.getNodeId().getValue());
onGlobalNodeAdd(key, node, tx);
} else {
LOG.trace("Handle ps node add {}", node.getNodeId().getValue());
onPsNodeAdd(key, node, tx);
}
}
}
}
use of org.opendaylight.yang.gen.v1.urn.tech.pantheon.netconfdevice.network.topology.rpcs.rev180320.node.data.Node in project netvirt by opendaylight.
the class ClassifierEntryTest method suppressNodeEntry.
@Test
public void suppressNodeEntry() throws Exception {
NodeId nodeId = new NodeId("node");
ClassifierEntry entry = ClassifierEntry.buildNodeEntry(nodeId);
entry.suppress(renderer);
verify(renderer).suppressNode(nodeId);
verifyNoMoreInteractions(renderer);
}
use of org.opendaylight.yang.gen.v1.urn.tech.pantheon.netconfdevice.network.topology.rpcs.rev180320.node.data.Node in project netvirt by opendaylight.
the class ClassifierEntryTest method suppressPathEntry.
@Test
public void suppressPathEntry() throws Exception {
NodeId nodeId = new NodeId("node");
Long nsp = 2L;
short nsi = (short) 254;
short nsl = (short) 252;
String firstHopIp = "127.0.0.1";
ClassifierEntry entry = ClassifierEntry.buildPathEntry(nodeId, nsp, nsi, nsl, firstHopIp);
entry.suppress(renderer);
verify(renderer).suppressPath(nodeId, nsp, nsi, nsl, firstHopIp);
verifyNoMoreInteractions(renderer);
}
use of org.opendaylight.yang.gen.v1.urn.tech.pantheon.netconfdevice.network.topology.rpcs.rev180320.node.data.Node in project netvirt by opendaylight.
the class ClassifierEntryTest method suppressMatchEntry.
@Test
public void suppressMatchEntry() throws Exception {
NodeId nodeId = new NodeId("node");
String connector = "openflow:0123456789:1";
Long nsp = 2L;
Short nsi = (short) 254;
Matches matches = new MatchesBuilder().build();
ClassifierEntry entry = ClassifierEntry.buildMatchEntry(nodeId, connector, matches, nsp, nsi);
entry.suppress(renderer);
verify(renderer).suppressMatch(nodeId, connector, matches, nsp, nsi);
verifyNoMoreInteractions(renderer);
}
Aggregations