package org.opendaylight.controller.protocol_plugin.openflow.internal;
+import java.util.Collections;
import java.util.Dictionary;
import java.util.List;
import java.util.Set;
private static final Logger logger = LoggerFactory
.getLogger(ReadService.class);
private IReadServiceFilter filter;
- private Set<IPluginOutReadService> pluginOutReadServices;
+ private Set<IPluginOutReadService> pluginOutReadServices = new CopyOnWriteArraySet<IPluginOutReadService>();
private String containerName;
private IPluginOutConnectionService connectionOutService;
@SuppressWarnings("unchecked")
void init(Component c) {
Dictionary<Object, Object> props = c.getServiceProperties();
- containerName = (props != null) ? (String) props.get("containerName")
- : null;
- pluginOutReadServices = new CopyOnWriteArraySet<IPluginOutReadService>();
+ containerName = (props != null) ? (String) props.get("containerName") : null;
}
/**
*
*/
void destroy() {
+ pluginOutReadServices.clear();
}
/**
public List<FlowOnNode> readAllFlow(Node node, boolean cached) {
if (!node.getType().equals(NodeIDType.OPENFLOW)) {
logger.error("Invalid node type");
- return null;
+ return Collections.emptyList();
}
if (!connectionOutService.isLocal(node)) {
logger.debug("This Controller is not the master for the node : " + node);
- return null;
+ return Collections.emptyList();
}
return filter.readAllFlow(containerName, node, cached);
boolean cached) {
if (!node.getType().equals(NodeIDType.OPENFLOW)) {
logger.error("Invalid node type");
- return null;
+ return Collections.emptyList();
}
if (!connectionOutService.isLocal(node)) {
logger.debug("This Controller is not the master for node : " + node);
- return null;
+ return Collections.emptyList();
}
return filter.readAllNodeConnector(containerName, node, cached);
public List<NodeTableStatistics> readAllNodeTable(Node node, boolean cached) {
if (!node.getType().equals(NodeIDType.OPENFLOW)) {
logger.error("Invalid node type");
- return null;
+ return Collections.emptyList();
}
if (!connectionOutService.isLocal(node)) {
logger.debug("This Controller is not the master for node : " + node);
- return null;
+ return Collections.emptyList();
}
return filter.readAllNodeTable(containerName, node, cached);