long newDomain = 0;
boolean newBD = false;
- if (oldDomain < newDomain)
- return -1;
- else if (oldDomain > newDomain)
+ if (oldDomain < newDomain) {
+ return -1;
+ } else if (oldDomain > newDomain) {
return 1;
-
+ }
// Give preference to OFPP_LOCAL always
if (!oldAP.getPort().getType().equals(NodeConnectorIDType.SWSTACK)
&& newAP.getPort().getType()
@Override
public Set<HostNodeConnector> getInactiveStaticHosts() {
- // TODO Auto-generated method stub
- return null;
+ Collection<Entity> devices = Collections
+ .unmodifiableCollection(inactiveStaticDevices.values());
+ Iterator<Entity> i = devices.iterator();
+ Set<HostNodeConnector> nc = new HashSet<HostNodeConnector>();
+ while (i.hasNext()) {
+ Entity ent = i.next();
+ nc.add(ent.toHostNodeConnector());
+
+ }
+ return nc;
}
@Override
listener.deviceRemoved(d);
}
}
+ //go through inactive entites.
+ Set<HostNodeConnector> inactive = this.getInactiveStaticHosts();
+ for(HostNodeConnector nc : inactive){
+ Integer ip =toIPv4Address(nc.getNetworkAddress().getAddress());
+ if(ip.equals(addr)){
+ this.inactiveStaticDevices.remove(nc.getnodeConnector());
+ }
+ }
+
+
return new Status(StatusCode.SUCCESS);
}
Entity ent = inactiveStaticDevices.get(nodeConnector);
Device device = this.learnDeviceByEntity(ent);
- HostNodeConnector host = device.toHostNodeConnector();
- if (host != null) {
- inactiveStaticDevices.remove(nodeConnector);
- for (IfNewHostNotify notify : newHostNotify)
- notify.notifyHTClient(host);
- for (IDeviceListener listener : listeners)
- listener.deviceAdded(device);
- } else {
- logger.debug("handleNodeConnectorStatusDown {}", nodeConnector);
+ if(device!=null){
+ HostNodeConnector host = device.toHostNodeConnector();
+ if (host != null) {
+ inactiveStaticDevices.remove(nodeConnector);
+ for (IfNewHostNotify notify : newHostNotify)
+ notify.notifyHTClient(host);
+ for (IDeviceListener listener : listeners)
+ listener.deviceAdded(device);
+ } else {
+ logger.debug("handleNodeConnectorStatusDown {}", nodeConnector);
+ }
}
}else{
// remove all devices on the node that went down.