Merge "Bug 6088 - Threads problem on gathering statistics"
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / statistics / services / direct / NodeConnectorDirectStatisticsService.java
index 6f6f496cbe66283a939843aa2340986c9a546bfa..f38600ca8e184098288f5570062263f1c50172e9 100644 (file)
@@ -8,6 +8,8 @@
 
 package org.opendaylight.openflowplugin.impl.statistics.services.direct;
 
+import java.util.ArrayList;
+import java.util.List;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
@@ -40,9 +42,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.n
 import org.opendaylight.yang.gen.v1.urn.opendaylight.port.statistics.rev131214.node.connector.statistics.and.port.number.map.NodeConnectorStatisticsAndPortNumberMapKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * The Node connector direct statistics service.
  */
@@ -130,7 +129,7 @@ public class NodeConnectorDirectStatisticsService extends AbstractDirectStatisti
 
     @Override
     protected void storeStatistics(GetNodeConnectorStatisticsOutput output) throws Exception {
-        final InstanceIdentifier<Node> nodePath = getDeviceContext().getDeviceState().getNodeInstanceIdentifier();
+        final InstanceIdentifier<Node> nodePath = getDeviceInfo().getNodeInstanceIdentifier();
 
         for (final NodeConnectorStatisticsAndPortNumberMap nodeConnectorStatistics : output.getNodeConnectorStatisticsAndPortNumberMap()) {
             final InstanceIdentifier<FlowCapableNodeConnectorStatistics> nodeConnectorPath = nodePath
@@ -139,7 +138,7 @@ public class NodeConnectorDirectStatisticsService extends AbstractDirectStatisti
                     .child(FlowCapableNodeConnectorStatistics.class);
 
             final FlowCapableNodeConnectorStatistics stats = new FlowCapableNodeConnectorStatisticsBuilder(nodeConnectorStatistics).build();
-            getDeviceContext().writeToTransactionWithParentsSlow(LogicalDatastoreType.OPERATIONAL, nodeConnectorPath, stats);
+            getTxFacade().writeToTransactionWithParentsSlow(LogicalDatastoreType.OPERATIONAL, nodeConnectorPath, stats);
         }
     }
 }