Search in sources :

Example 1 with VppNetconfConnectionProbe

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);
        }
    }
}
Also used : VppNetconfConnectionProbe(org.opendaylight.lispflowmapping.neutron.intenthandler.util.VppNetconfConnectionProbe) SupportingNode(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNode) Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node) SupportingNode(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNode) NetworkTopology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology) Topology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology) TopologyKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey) NodeId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId) ExecutionException(java.util.concurrent.ExecutionException) NodeKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey) TopologyId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId) TimeoutException(java.util.concurrent.TimeoutException)

Aggregations

ExecutionException (java.util.concurrent.ExecutionException)1 TimeoutException (java.util.concurrent.TimeoutException)1 VppNetconfConnectionProbe (org.opendaylight.lispflowmapping.neutron.intenthandler.util.VppNetconfConnectionProbe)1 NetworkTopology (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology)1 NodeId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)1 TopologyId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId)1 Topology (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology)1 TopologyKey (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey)1 Node (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node)1 NodeKey (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey)1 SupportingNode (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNode)1