Search in sources :

Example 1 with NetconfNode

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode in project lispflowmapping by opendaylight.

the class VppNetconfConnectionProbe method onDataTreeChanged.

@Override
public void onDataTreeChanged(@Nonnull Collection<DataTreeModification<Node>> changes) {
    changes.forEach(modification -> {
        final DataObjectModification<Node> rootNode = modification.getRootNode();
        final Node node = rootNode.getDataAfter();
        final NetconfNode netconfNode = getNodeAugmentation(node);
        if (node == null || node.getNodeId() == null) {
            return;
        }
        if (netconfNode == null || netconfNode.getConnectionStatus() == null) {
            connectionStatusFuture.set(false);
            unregister();
        } else {
            final NetconfNodeConnectionStatus.ConnectionStatus status = netconfNode.getConnectionStatus();
            if (status.equals(Connected)) {
                connectionStatusFuture.set(true);
                unregister();
            } else if (!status.equals(Connecting)) {
                connectionStatusFuture.set(false);
                unregister();
            }
        }
    });
}
Also used : NetconfNode(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode) Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node) NetconfNodeConnectionStatus(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeConnectionStatus) NetconfNode(org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode)

Aggregations

NetconfNode (org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode)1 NetconfNodeConnectionStatus (org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeConnectionStatus)1 Node (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node)1