class PacketDispatcher {

    public void floodPacket(String nodeId, byte[] payload, NodeConnectorRef origIngress,
            NodeConnectorRef controllerNodeConnector) {

        List<NodeConnectorRef> nodeConnectors = inventoryReader.getSwitchNodeConnectors().get(nodeId);

        if (nodeConnectors == null) {
            refreshInventoryReader();
            nodeConnectors = inventoryReader.getSwitchNodeConnectors().get(nodeId);
            if (nodeConnectors == null) {
                LOG.info("Cannot flood packets, as inventory doesn't have any node connectors for node {}", nodeId);
                return;
            }
        }
        for (NodeConnectorRef ncRef : nodeConnectors) {
            String ncId = ncRef.getValue().firstIdentifierOf(NodeConnector.class)
                    .firstKeyOf(NodeConnector.class, NodeConnectorKey.class).getId().getValue();
            // Don't flood on discarding node connectors & origIngress
            if (!ncId.equals(origIngress.getValue().firstIdentifierOf(NodeConnector.class)
                    .firstKeyOf(NodeConnector.class, NodeConnectorKey.class).getId().getValue())) {
                sendPacketOut(payload, origIngress, ncRef);
            }
        }
    }

}