From e1b829b6a3a71839ccd9be77680ca79f678d428b Mon Sep 17 00:00:00 2001
From: Srinivasan Ramasubramanian <srini@bigswitch.com>
Date: Fri, 12 Oct 2012 18:14:26 -0700
Subject: [PATCH] TopologyManager should not process switch removed and port
 down messages explicitly as they are processed by link discovery module and
 generate corresponding link removed events.

---
 .../topology/TopologyManager.java                   | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/main/java/net/floodlightcontroller/topology/TopologyManager.java b/src/main/java/net/floodlightcontroller/topology/TopologyManager.java
index 2c9bfe2a2..51bbd017e 100644
--- a/src/main/java/net/floodlightcontroller/topology/TopologyManager.java
+++ b/src/main/java/net/floodlightcontroller/topology/TopologyManager.java
@@ -837,12 +837,18 @@ public class TopologyManager implements
         return Command.STOP;
     }
 
+
+    /**
+     * Updates concerning switch disconnect and port down are not processed.
+     * LinkDiscoveryManager is expected to process those messages and send
+     * multiple link removed messages.  However, all the updates from
+     * LinkDiscoveryManager would be propagated to the listeners of topology.
+     */
     @LogMessageDoc(level="ERROR",
             message="Error reading link discovery update.",
             explanation="Unable to process link discovery update",
             recommendation=LogMessageDoc.REPORT_CONTROLLER_BUG)
     public void applyUpdates() {
-
         appliedUpdates.clear();
         LDUpdate update = null;
         while (ldUpdates.peek() != null) {
@@ -861,12 +867,7 @@ public class TopologyManager implements
             } else if (update.getOperation() == UpdateOperation.LINK_REMOVED){
                 removeLink(update.getSrc(), update.getSrcPort(), 
                            update.getDst(), update.getDstPort());
-            } else if (update.getOperation() == UpdateOperation.SWITCH_REMOVED) {
-                removeSwitch(update.getSrc());
-            } else if (update.getOperation() == UpdateOperation.PORT_DOWN) {
-                removeSwitchPort(update.getSrc(), update.getSrcPort());
             }
-
             // Add to the list of applied updates.
             appliedUpdates.add(update);
         }
-- 
GitLab