Skip to content
Snippets Groups Projects
Commit 6e38f554 authored by Srinivasan Ramasubramanian's avatar Srinivasan Ramasubramanian
Browse files

Device manager should implement ITopologyListener to clear out attachment...

Device manager should implement ITopologyListener to clear out attachment points when topology changes.
parent b721c692
No related branches found
No related tags found
No related merge requests found
......@@ -66,6 +66,7 @@ import net.floodlightcontroller.storage.IStorageSourceService;
import net.floodlightcontroller.storage.OperatorPredicate;
import net.floodlightcontroller.storage.StorageException;
import net.floodlightcontroller.threadpool.IThreadPoolService;
import net.floodlightcontroller.topology.ITopologyListener;
import net.floodlightcontroller.topology.ITopologyService;
import net.floodlightcontroller.util.EventHistory;
import net.floodlightcontroller.util.EventHistory.EvAction;
......@@ -91,7 +92,7 @@ import org.slf4j.LoggerFactory;
*/
public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListener,
IOFSwitchListener, ILinkDiscoveryListener, IFloodlightModule, IStorageSourceListener,
IInfoProvider {
ITopologyListener, IInfoProvider {
/**
* Class to maintain all the device manager maps which consists of four
* main maps.
......@@ -1457,7 +1458,8 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
/**
* Iterates through all devices and cleans up attachment points
*/
public void clusterMerged() {
@Override
public void topologyChanged() {
deviceUpdateTask.reschedule(10, TimeUnit.MILLISECONDS);
}
......@@ -2107,10 +2109,15 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
if (linkDiscovery != null) {
// Register to get updates from topology
linkDiscovery.addListener(this);
} else {
log.error("Could not add linkdiscovery listener");
}
if (topology != null) {
topology.addListener(this);
} else {
log.error("Could not add topology listener");
}
// Create our database tables
storageSource.createTable(DEVICE_TABLE_NAME, null);
storageSource.setTablePrimaryKeyName(
......@@ -2162,5 +2169,4 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
return info;
}
}
......@@ -4,5 +4,5 @@ public interface ITopologyListener {
/**
* Happens when the switch clusters are recomputed
*/
void toplogyChanged();
void topologyChanged();
}
......@@ -104,7 +104,7 @@ IRoutingService, ILinkDiscoveryListener {
public void informListeners() {
for(int i=0; i<topologyAware.size(); ++i) {
ITopologyListener listener = topologyAware.get(i);
listener.toplogyChanged();
listener.topologyChanged();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment