import org.apache.felix.dm.Component;
import org.opendaylight.controller.protocol_plugin.openflow.IReadFilterInternalListener;
import org.opendaylight.controller.protocol_plugin.openflow.IReadServiceFilter;
+import org.opendaylight.controller.sal.connection.IPluginOutConnectionService;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.core.Node.NodeIDType;
import org.opendaylight.controller.sal.core.NodeConnector;
private IReadServiceFilter filter;
private Set<IPluginOutReadService> pluginOutReadServices;
private String containerName;
+ private IPluginOutConnectionService connectionOutService;
/**
* Function called by the dependency manager when all the required
return null;
}
+ if (!connectionOutService.isLocal(node)) {
+ logger.debug("This Controller is not the master for the node : " + node);
+ return null;
+ }
return filter.readFlow(containerName, node, flow, cached);
}
return null;
}
+ if (!connectionOutService.isLocal(node)) {
+ logger.debug("This Controller is not the master for the node : " + node);
+ return null;
+ }
+
return filter.readAllFlow(containerName, node, cached);
}
return null;
}
+ if (!connectionOutService.isLocal(node)) {
+ logger.debug("This Controller is not the master for the node : " + node);
+ return null;
+ }
+
return filter.readDescription(node, cached);
}
logger.error("Invalid node type");
return null;
}
+
+ if (!connectionOutService.isLocal(connector.getNode())) {
+ logger.debug("This Controller is not the master for connector : "+connector);
+ return null;
+ }
+
return filter.readNodeConnector(containerName, connector, cached);
}
return null;
}
+ if (!connectionOutService.isLocal(node)) {
+ logger.debug("This Controller is not the master for node : " + node);
+ return null;
+ }
+
return filter.readAllNodeConnector(containerName, node, cached);
}
logger.error("Invalid node type");
return 0;
}
+
+ if (!connectionOutService.isLocal(connector.getNode())) {
+ logger.debug("This Controller is not the master for connector : "+connector);
+ return 0;
+ }
+
return filter.getTransmitRate(containerName, connector);
}
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);
}
return null;
}
+ if (!connectionOutService.isLocal(node)) {
+ logger.debug("This Controller is not the master for node : " + node);
+ return null;
+ }
+
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;
+ }
+ }
}