use of org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingListener in project openflowplugin by opendaylight.
the class PacketInDispatcherImpl method onPacketReceived.
@Override
public void onPacketReceived(PacketReceived notification) {
// find corresponding handler
/*
* Notification contains reference to ingress port
* in a form of path in inventory: /nodes/node/node-connector
*
* In order to get path we shorten path to the first node reference
* by using firstIdentifierOf helper method provided by InstanceIdentifier,
* this will effectively shorten the path to /nodes/node.
*/
InstanceIdentifier<?> ingressPort = notification.getIngress().getValue();
InstanceIdentifier<Node> nodeOfPacket = ingressPort.firstIdentifierOf(Node.class);
/**
* We lookup up the the packet-in listener for this node.
*/
PacketProcessingListener nodeHandler = handlerMapping.get(nodeOfPacket);
/**
* If we have packet-processing listener, we delegate notification.
*/
if (nodeHandler != null) {
nodeHandler.onPacketReceived(notification);
}
}
Aggregations