Change-Id: I2ccdf1a6d2ed38e1e78242ae99d9bb1711f20040
Signed-off-by: Pramila Singh <pramisin@cisco.com>
switchConfig = new SwitchConfig(nodeId, updateProperties);
} else {
// check if description is configured or was published by any other node
switchConfig = new SwitchConfig(nodeId, updateProperties);
} else {
// check if description is configured or was published by any other node
- for (Node n : nodeProps.keySet()) {
+ for (Map.Entry<Node, Map<String, Property>> entry : nodeProps.entrySet()) {
+ Node n = entry.getKey();
Description desc = (Description) getNodeProp(n, Description.propertyName);
NodeDescription nDesc = (this.statisticsManager == null) ? null : this.statisticsManager
.getNodeDescription(n);
Description desc = (Description) getNodeProp(n, Description.propertyName);
NodeDescription nDesc = (this.statisticsManager == null) ? null : this.statisticsManager
.getNodeDescription(n);
return new Status(StatusCode.SUCCESS);
}
Map<String, Property> propMap = new HashMap<String, Property>(propMapCurr);
return new Status(StatusCode.SUCCESS);
}
Map<String, Property> propMap = new HashMap<String, Property>(propMapCurr);
- for (String prop : prevNodeProperties.keySet()) {
+ for (Map.Entry<String, Property> entry : prevNodeProperties.entrySet()) {
+ String prop = entry.getKey();
if (!updateProperties.containsKey(prop)) {
if (prop.equals(Description.propertyName)) {
if (!advertisedDesc.isEmpty()) {
if (!updateProperties.containsKey(prop)) {
if (prop.equals(Description.propertyName)) {
if (!advertisedDesc.isEmpty()) {
Map<String, Property> propMapCurr = nodeProps.get(node);
if ((propMapCurr != null) && (nodeProperties != null) && (!nodeProperties.isEmpty())) {
Map<String, Property> propMap = new HashMap<String, Property>(propMapCurr);
Map<String, Property> propMapCurr = nodeProps.get(node);
if ((propMapCurr != null) && (nodeProperties != null) && (!nodeProperties.isEmpty())) {
Map<String, Property> propMap = new HashMap<String, Property>(propMapCurr);
- for (String prop : nodeProperties.keySet()) {
+ for (Map.Entry<String, Property> entry : nodeProperties.entrySet()) {
+ String prop = entry.getKey();
if (prop.equals(Description.propertyName)) {
Map<Node, Map<String, Property>> nodeProp = this.inventoryService.getNodeProps();
if (nodeProp.get(node) != null) {
if (prop.equals(Description.propertyName)) {
Map<Node, Map<String, Property>> nodeProp = this.inventoryService.getNodeProps();
if (nodeProp.get(node) != null) {
return;
}
nodeProps.remove(node);
return;
}
nodeProps.remove(node);
+ nodeConnectorNames.remove(node);
+ Set<NodeConnector> removeNodeConnectorSet = new HashSet<NodeConnector>();
+ for (Map.Entry<NodeConnector, Map<String, Property>> entry : nodeConnectorProps.entrySet()) {
+ NodeConnector nodeConnector = entry.getKey();
+ if (nodeConnector.getNode().equals(node)) {
+ removeNodeConnectorSet.add(nodeConnector);
+ }
+ }
+ for (NodeConnector nc : removeNodeConnectorSet) {
+ nodeConnectorProps.remove(nc);
+ }
// check if span ports need to be cleaned up
removeSpanPorts(node);
// check if span ports need to be cleaned up
removeSpanPorts(node);
}
Set<NodeConnector> nodeConnectorSet = new HashSet<NodeConnector>();
}
Set<NodeConnector> nodeConnectorSet = new HashSet<NodeConnector>();
- for (NodeConnector nodeConnector : nodeConnectorProps.keySet()) {
+ for (Map.Entry<NodeConnector, Map<String, Property>> entry : nodeConnectorProps.entrySet()) {
+ NodeConnector nodeConnector = entry.getKey();
if (!nodeConnector.getNode().equals(node)) {
continue;
}
if (!nodeConnector.getNode().equals(node)) {
continue;
}
}
Set<NodeConnector> nodeConnectorSet = new HashSet<NodeConnector>();
}
Set<NodeConnector> nodeConnectorSet = new HashSet<NodeConnector>();
- for (NodeConnector nodeConnector : nodeConnectorProps.keySet()) {
+ for (Map.Entry<NodeConnector, Map<String, Property>> entry : nodeConnectorProps.entrySet()) {
+ NodeConnector nodeConnector = entry.getKey();
if (!nodeConnector.getNode().equals(node)) {
continue;
}
if (!nodeConnector.getNode().equals(node)) {
continue;
}
}
Set<NodeConnector> nodeConnectorSet = new HashSet<NodeConnector>();
}
Set<NodeConnector> nodeConnectorSet = new HashSet<NodeConnector>();
- for (NodeConnector nodeConnector : nodeConnectorProps.keySet()) {
+ for (Map.Entry<NodeConnector, Map<String, Property>> entry : nodeConnectorProps.entrySet()) {
+ NodeConnector nodeConnector = entry.getKey();
if (!nodeConnector.getNode().equals(node)
|| isSpecial(nodeConnector)) {
continue;
if (!nodeConnector.getNode().equals(node)
|| isSpecial(nodeConnector)) {
continue;
Map<String, NodeConnector> mapCurr = nodeConnectorNames.get(node);
Map<String, NodeConnector> map = new HashMap<String, NodeConnector>();
if (mapCurr != null) {
Map<String, NodeConnector> mapCurr = nodeConnectorNames.get(node);
Map<String, NodeConnector> map = new HashMap<String, NodeConnector>();
if (mapCurr != null) {
- for (String s : mapCurr.keySet()) {
+ for (Map.Entry<String, NodeConnector> entry : mapCurr.entrySet()) {
+ String s = entry.getKey();
- map.put(s, new NodeConnector(mapCurr.get(s)));
+ map.put(s, new NodeConnector(entry.getValue()));
} catch (ConstructionException e) {
e.printStackTrace();
}
} catch (ConstructionException e) {
e.printStackTrace();
}
Map<String, NodeConnector> mapCurr = nodeConnectorNames.get(node);
if (mapCurr != null) {
Map<String, NodeConnector> map = new HashMap<String, NodeConnector>();
Map<String, NodeConnector> mapCurr = nodeConnectorNames.get(node);
if (mapCurr != null) {
Map<String, NodeConnector> map = new HashMap<String, NodeConnector>();
- for (String s : mapCurr.keySet()) {
+ for (Map.Entry<String, NodeConnector> entry : mapCurr.entrySet()) {
+ String s = entry.getKey();
- map.put(s, new NodeConnector(mapCurr.get(s)));
+ map.put(s, new NodeConnector(entry.getValue()));
} catch (ConstructionException e) {
e.printStackTrace();
}
} catch (ConstructionException e) {
e.printStackTrace();
}
Map<String, NodeConnector> mapCurr = nodeConnectorNames.get(node);
if (mapCurr != null) {
Map<String, NodeConnector> map = new HashMap<String, NodeConnector>();
Map<String, NodeConnector> mapCurr = nodeConnectorNames.get(node);
if (mapCurr != null) {
Map<String, NodeConnector> map = new HashMap<String, NodeConnector>();
- for (String s : mapCurr.keySet()) {
+ for (Map.Entry<String, NodeConnector> entry : mapCurr.entrySet()) {
+ String s = entry.getKey();
- map.put(s, new NodeConnector(mapCurr.get(s)));
+ map.put(s, new NodeConnector(entry.getValue()));
} catch (ConstructionException e) {
e.printStackTrace();
}
} catch (ConstructionException e) {
e.printStackTrace();
}
service.notifyNode(node, type, propMap);
}
service.notifyNode(node, type, propMap);
}
- for (NodeConnector nodeConnector : nodeConnectorProps.keySet()) {
+ for (Map.Entry<NodeConnector, Map<String, Property>> entry : nodeConnectorProps.entrySet()) {
+ NodeConnector nodeConnector = entry.getKey();
propMap = nodeConnectorProps.get(nodeConnector);
service.notifyNodeConnector(nodeConnector, type, propMap);
}
propMap = nodeConnectorProps.get(nodeConnector);
service.notifyNodeConnector(nodeConnector, type, propMap);
}