use of org.opendaylight.lispflowmapping.neutron.intenthandler.util.VppNetconfConnectionProbe in project lispflowmapping by opendaylight.
the class VppEndpointListener method processNodeOnConnection.
private void processNodeOnConnection(final Node newOrModifiedNode) {
for (SupportingNode supportingNode : newOrModifiedNode.getSupportingNode()) {
final NodeId nodeMount = supportingNode.getNodeRef();
final VppNetconfConnectionProbe probe = new VppNetconfConnectionProbe(supportingNode.getNodeRef(), dataBroker);
try {
// Verify netconf connection
boolean connectionReady = probe.startProbing();
if (connectionReady) {
LOG.debug("Node {} is connected, creating ...", supportingNode.getNodeRef());
final TopologyId topologyMount = supportingNode.getTopologyRef();
final KeyedInstanceIdentifier<Node, NodeKey> iiToVpp = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(topologyMount)).child(Node.class, new NodeKey(nodeMount));
nodeIdToKeyedInstanceIdentifierMap.put(newOrModifiedNode.getNodeId(), iiToVpp);
} else {
LOG.debug("Failed while connecting to node {}", supportingNode.getNodeRef());
}
} catch (InterruptedException | ExecutionException e) {
LOG.warn("Exception while processing node {} ... ", supportingNode.getNodeRef(), e);
} catch (TimeoutException e) {
LOG.warn("Node {} was not connected within {} seconds. " + "Check node configuration and connectivity to proceed", supportingNode.getNodeRef(), VppNetconfConnectionProbe.NODE_CONNECTION_TIMER);
}
}
}
Aggregations