Controller to listen to expired flow removal message
[controller.git] / opendaylight / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / internal / TopologyServiceShim.java
index b62b068b8164cbb9f2857ade33a291d8dad7cc25..ab7ab2eca8d23620c067c8f09b2db94f5b96c505 100644 (file)
@@ -226,7 +226,7 @@ public class TopologyServiceShim implements IDiscoveryService,
 
         for (NodeConnector connector : globalContainerEdges.keySet()) {
             // Skip if node connector belongs to production switch
-            if (connector.getType() == NodeConnector.NodeConnectorIDType.PRODUCTION) {
+            if (connector.getType().equals(NodeConnector.NodeConnectorIDType.PRODUCTION)) {
                 continue;
             }
 
@@ -326,7 +326,8 @@ public class TopologyServiceShim implements IDiscoveryService,
             return;
         }
         if ((this.topologyServiceShimListeners != null)
-                && !this.topologyServiceShimListeners.containsKey(s)) {
+                && !this.topologyServiceShimListeners
+                       .containsKey(containerName)) {
             this.topologyServiceShimListeners.put(containerName, s);
             logger.trace("Added topologyServiceShimListener for container:"
                     + containerName);
@@ -345,7 +346,11 @@ public class TopologyServiceShim implements IDiscoveryService,
             return;
         }
         if ((this.topologyServiceShimListeners != null)
-                && this.topologyServiceShimListeners.containsKey(s)) {
+                && this.topologyServiceShimListeners
+                .containsKey(containerName)
+                && this.topologyServiceShimListeners
+                .get(containerName).equals(s)
+                ) {
             this.topologyServiceShimListeners.remove(containerName);
             logger.trace("Removed topologyServiceShimListener for container: "
                     + containerName);
@@ -552,14 +557,14 @@ public class TopologyServiceShim implements IDiscoveryService,
         }
 
         ci.println("Container: " + container);
-        ci
-                .println("                             Edge                                          Bandwidth");
+        ci.println("                             Edge                                          Bandwidth");
 
         Map<NodeConnector, Pair<Edge, Set<Property>>> edgePropsMap = edgeMap
                 .get(container);
         if (edgePropsMap == null) {
             return;
         }
+        int count = 0;
         for (Pair<Edge, Set<Property>> edgeProps : edgePropsMap.values()) {
             if (edgeProps == null) {
                 continue;
@@ -571,9 +576,10 @@ public class TopologyServiceShim implements IDiscoveryService,
                     bw = ((Bandwidth) prop).getValue();
                 }
             }
-
+            count++;
             ci.println(edgeProps.getLeft() + "          " + bw);
         }
+        ci.println("Total number of Edges: " + count);
     }
 
     public void _bwfactor(CommandInterpreter ci) {