package org.opendaylight.controller.protocol_plugin.openflow.internal;
+import java.util.Collections;
import java.util.Dictionary;
import java.util.HashMap;
import java.util.HashSet;
import org.opendaylight.controller.protocol_plugin.openflow.IInventoryShimInternalListener;
import org.opendaylight.controller.protocol_plugin.openflow.core.IController;
import org.opendaylight.controller.protocol_plugin.openflow.core.ISwitch;
-import org.opendaylight.controller.sal.connection.IPluginOutConnectionService;
import org.opendaylight.controller.sal.core.Node;
import org.opendaylight.controller.sal.core.NodeConnector;
import org.opendaylight.controller.sal.core.Property;
IPluginInInventoryService, IInventoryProvider {
protected static final Logger logger = LoggerFactory
.getLogger(InventoryService.class);
- private Set<IPluginOutInventoryService> pluginOutInventoryServices;
+ private final Set<IPluginOutInventoryService> pluginOutInventoryServices =
+ new CopyOnWriteArraySet<IPluginOutInventoryService>();
private IController controller = null;
- private ConcurrentMap<Node, Map<String, Property>> nodeProps; // properties are maintained in global container only
- private ConcurrentMap<NodeConnector, Map<String, Property>> nodeConnectorProps; // properties are maintained in global container only
+ private ConcurrentMap<Node, Map<String, Property>> nodeProps;
+ private ConcurrentMap<NodeConnector, Map<String, Property>> nodeConnectorProps;
private boolean isDefaultContainer = false;
private String containerName = null;
nodeProps = new ConcurrentHashMap<Node, Map<String, Property>>();
nodeConnectorProps = new ConcurrentHashMap<NodeConnector, Map<String, Property>>();
- pluginOutInventoryServices = new CopyOnWriteArraySet<IPluginOutInventoryService>();
}
/**
*/
void stop() {
logger.trace("STOP called!");
+ pluginOutInventoryServices.clear();
}
public void setPluginOutInventoryServices(IPluginOutInventoryService service) {
return nodeProps;
}
+ // nothing to return
+ @Override
+ public Set<Node> getConfiguredNotConnectedNodes() {
+ return Collections.emptySet();
+ }
+
@Override
public ConcurrentMap<NodeConnector, Map<String, Property>> getNodeConnectorProps(
Boolean refresh) {
private void removeNode(Node node) {
logger.trace("{} removed", node);
- if (nodeProps == null)
+ if (nodeProps == null) {
return;
+ }
// update local cache
nodeProps.remove(node);
private void updateNode(Node node, Set<Property> properties) {
logger.trace("{} updated, props: {}", node, properties);
- if (nodeProps == null || !nodeProps.containsKey(node) ||
- properties == null || properties.isEmpty()) {
+ if ((nodeProps == null) || !nodeProps.containsKey(node) ||
+ (properties == null) || properties.isEmpty()) {
return;
}