+
+ @Override
+ public NodeTableStatistics readNodeTable(NodeTable table, boolean cached) {
+ if (!table.getNode().getType()
+ .equals(NodeIDType.OPENFLOW)) {
+ logger.error("Invalid node type");
+ return null;
+ }
+
+ if (!connectionOutService.isLocal(table.getNode())) {
+ logger.debug("This Controller is not the master for connector : "+table);
+ 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 Collections.emptyList();
+ }
+
+ if (!connectionOutService.isLocal(node)) {
+ logger.debug("This Controller is not the master for node : " + node);
+ return Collections.emptyList();
+ }
+
+ return filter.readAllNodeTable(containerName, node, cached);
+ }
+
+ @Override
+ public void nodeFlowStatisticsUpdated(Node node, List<FlowOnNode> flowStatsList) {
+ if (!connectionOutService.isLocal(node)) {
+ logger.debug("This Controller is not the master for node : " + node);
+ return;
+ }
+ for (IPluginOutReadService service : pluginOutReadServices) {
+ service.nodeFlowStatisticsUpdated(node, flowStatsList);
+ }
+ }
+
+ @Override
+ public void nodeConnectorStatisticsUpdated(Node node, List<NodeConnectorStatistics> ncStatsList) {
+ if (!connectionOutService.isLocal(node)) {
+ logger.debug("This Controller is not the master for node : " + node);
+ return;
+ }
+ for (IPluginOutReadService service : pluginOutReadServices) {
+ service.nodeConnectorStatisticsUpdated(node, ncStatsList);
+ }
+ }
+
+ @Override
+ public void nodeTableStatisticsUpdated(Node node, List<NodeTableStatistics> tableStatsList) {
+ if (!connectionOutService.isLocal(node)) {
+ logger.debug("This Controller is not the master for node : " + node);
+ return;
+ }
+ for (IPluginOutReadService service : pluginOutReadServices) {
+ service.nodeTableStatisticsUpdated(node, tableStatsList);
+ }
+ }
+
+ @Override
+ public void nodeDescriptionStatisticsUpdated(Node node, NodeDescription nodeDescription) {
+ if (!connectionOutService.isLocal(node)) {
+ logger.debug("This Controller is not the master for node : " + node);
+ return;
+ }
+ for (IPluginOutReadService service : pluginOutReadServices) {
+ service.descriptionStatisticsUpdated(node, nodeDescription);
+ }
+ }
+
+ void setIPluginOutConnectionService(IPluginOutConnectionService s) {
+ connectionOutService = s;
+ }
+
+ void unsetIPluginOutConnectionService(IPluginOutConnectionService s) {
+ if (connectionOutService == s) {
+ connectionOutService = null;
+ }
+ }