Add 'TableStatistics' to SAL and Northbound Statistics API.
[controller.git] / opendaylight / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / internal / ReadService.java
index 9ff3d21ff0a5ddbff953066b9e2b3553f3807617..20d13b7a3dc9325244ff05f5f586cd1b8e31e1d9 100644 (file)
@@ -20,11 +20,13 @@ import org.slf4j.LoggerFactory;
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.controller.sal.core.Node.NodeIDType;
 import org.opendaylight.controller.sal.core.NodeConnector;
+import org.opendaylight.controller.sal.core.NodeTable;
 import org.opendaylight.controller.sal.flowprogrammer.Flow;
 import org.opendaylight.controller.sal.reader.FlowOnNode;
 import org.opendaylight.controller.sal.reader.IPluginInReadService;
 import org.opendaylight.controller.sal.reader.NodeConnectorStatistics;
 import org.opendaylight.controller.sal.reader.NodeDescription;
+import org.opendaylight.controller.sal.reader.NodeTableStatistics;
 
 /**
  * Container Instance of IPluginInReadService implementation class
@@ -146,4 +148,24 @@ public class ReadService implements IPluginInReadService {
         }
         return filter.getTransmitRate(containerName, connector);
     }
+
+    @Override
+    public NodeTableStatistics readNodeTable(NodeTable table, boolean cached) {
+        if (!table.getNode().getType()
+                .equals(NodeIDType.OPENFLOW)) {
+            logger.error("Invalid node type");
+            return null;
+        }
+        return filter.readNodeTable(containerName, table, cached);
+    }
+
+    @Override
+    public List<NodeTableStatistics> readAllNodeTable(Node node, boolean cached) {
+        if (!node.getType().equals(NodeIDType.OPENFLOW)) {
+            logger.error("Invalid node type");
+            return null;
+        }
+
+        return filter.readAllNodeTable(containerName, node, cached);
+    }
 }