Fix for bug - 369
[controller.git] / opendaylight / md-sal / compatibility / sal-compatibility / src / main / java / org / opendaylight / controller / sal / compatibility / InventoryAndReadAdapter.xtend
index 21af047c3d79a5cb2d6c2508e05f9121b119be71..6d209f3b172f5f90b1d075190b4be4fa31fdfb6d 100644 (file)
@@ -142,11 +142,11 @@ class InventoryAndReadAdapter implements IPluginInReadService,
                val table= it.readConfigurationData(tableRef) as Table;
                
                if(table != null){
-                       LOG.info("Number of flows installed in table 0 of node {} : {}",node,table.flow.size);
+                       LOG.trace("Number of flows installed in table 0 of node {} : {}",node,table.flow.size);
                        
                        for(flow : table.flow){
                                
-                               val adsalFlow = ToSalConversionsUtils.toFlow(flow);
+                               val adsalFlow = ToSalConversionsUtils.toFlow(flow,node);
                                val statsFromDataStore = flow.getAugmentation(FlowStatisticsData);
                                
                                if(statsFromDataStore != null){
@@ -248,7 +248,7 @@ class InventoryAndReadAdapter implements IPluginInReadService,
                val table= it.readConfigurationData(tableRef) as Table;
                
                if(table != null){
-                       LOG.info("Number of flows installed in table 0 of node {} : {}",node,table.flow.size);
+                       LOG.trace("Number of flows installed in table 0 of node {} : {}",node,table.flow.size);
                        
                        for(mdsalFlow : table.flow){
                                if(FromSalConversionsUtils.flowEquals(mdsalFlow, MDFlowMapping.toMDSalflow(targetFlow))){
@@ -517,14 +517,14 @@ class InventoryAndReadAdapter implements IPluginInReadService,
        override onFlowsStatisticsUpdate(FlowsStatisticsUpdate notification) {
                
                val adsalFlowsStatistics = new ArrayList<FlowOnNode>();
+               val nodeRef = InstanceIdentifier.builder(Nodes).child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node,new NodeKey(notification.id)).toInstance;
                
                for(flowStats : notification.flowAndStatisticsMapList){
                        if(flowStats.tableId == 0)
-                               adsalFlowsStatistics.add(toFlowOnNode(flowStats));
+                               adsalFlowsStatistics.add(toFlowOnNode(flowStats,nodeRef.toADNode));
                }
                
                for (statsPublisher : statisticsPublisher){
-                       val nodeRef = InstanceIdentifier.builder(Nodes).child(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node,new NodeKey(notification.id)).toInstance;
                        statsPublisher.nodeFlowStatisticsUpdated(nodeRef.toADNode,adsalFlowsStatistics);
                }
                
@@ -569,9 +569,9 @@ class InventoryAndReadAdapter implements IPluginInReadService,
                
        }
        
-       private static def toFlowOnNode (FlowAndStatisticsMapList flowAndStatsMap){
+       private static def toFlowOnNode (FlowAndStatisticsMapList flowAndStatsMap,Node node){
                
-               val it = new FlowOnNode(ToSalConversionsUtils.toFlow(flowAndStatsMap));
+               val it = new FlowOnNode(ToSalConversionsUtils.toFlow(flowAndStatsMap,node));
                
                byteCount = flowAndStatsMap.byteCount.value.longValue;
                packetCount = flowAndStatsMap.packetCount.value.longValue;