use of org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkDiscovered in project openflowplugin by opendaylight.
the class LLDPDiscoveryListener method onPacketReceived.
@Override
public void onPacketReceived(PacketReceived lldp) {
NodeConnectorRef src = LLDPDiscoveryUtils.lldpToNodeConnectorRef(lldp.getPayload(), true);
if (src != null) {
final NodeKey nodeKey = lldp.getIngress().getValue().firstKeyOf(Node.class);
LOG.debug("LLDP packet received for destination node {}", nodeKey);
if (nodeKey != null) {
LinkDiscoveredBuilder ldb = new LinkDiscoveredBuilder();
ldb.setDestination(lldp.getIngress());
ldb.setSource(new NodeConnectorRef(src));
LinkDiscovered ld = ldb.build();
lldpLinkAger.put(ld);
if (LLDPDiscoveryUtils.isEntityOwned(this.eos, nodeKey.getId().getValue())) {
LOG.debug("Publish add event for link {}", ld);
notificationService.publish(ld);
} else {
LOG.trace("Skip publishing the add event for link because controller is non-owner of the " + "node {}. Link : {}", nodeKey.getId().getValue(), ld);
}
} else {
LOG.debug("LLDP packet ignored. Unable to extract node-key from packet-in ingress.");
}
}
}
Aggregations