Fix comments in Path.java. Also, Max Throughput dijkstra modification.
[controller.git] / opendaylight / routing / dijkstra_implementation / src / main / java / org / opendaylight / controller / routing / dijkstra_implementation / internal / DijkstraImplementation.java
index 1fed3e1c036d53b89c2bb9ee6689128f3d937234..64cc3fbe01045f8e2bf372fbae0ee8e360f9f908 100644 (file)
@@ -61,7 +61,7 @@ public class DijkstraImplementation implements IRouting, ITopologyManagerAware {
     private IReadService readService;
     private static final long DEFAULT_LINK_SPEED = Bandwidth.BW1Gbps;
 
-    public void setLIstenRoutingUpdates(IListenRoutingUpdates i) {
+    public void setListenRoutingUpdates(IListenRoutingUpdates i) {
         if (this.routingAware == null) {
             this.routingAware = new HashSet<IListenRoutingUpdates>();
         }
@@ -71,7 +71,7 @@ public class DijkstraImplementation implements IRouting, ITopologyManagerAware {
         }
     }
 
-    public void unsetRoutingUpdates(IListenRoutingUpdates i) {
+    public void unsetListenRoutingUpdates(IListenRoutingUpdates i) {
         if (this.routingAware == null) {
             return;
         }
@@ -111,22 +111,14 @@ public class DijkstraImplementation implements IRouting, ITopologyManagerAware {
                             .getNodeConnectorProp(dstNC,
                                     Bandwidth.BandwidthPropName);
 
-                    if ((bwSrc == null) || (bwDst == null)) {
-                        log.error("bwSrc:{} or bwDst:{} is null", bwSrc, bwDst);
-                        return (double) -1;
-                    }
-
-                    long srcLinkSpeed = bwSrc.getValue();
-                    if (srcLinkSpeed == 0) {
-                        log.trace("Edge {}: srcLinkSpeed is 0. Setting to {}!",
-                                e, DEFAULT_LINK_SPEED);
-                        srcLinkSpeed = DEFAULT_LINK_SPEED;
+                    long srcLinkSpeed = 0, dstLinkSpeed = 0;
+                    if ((bwSrc == null) || ((srcLinkSpeed = bwSrc.getValue()) == 0)) {
+                        log.debug("srcNC: {} - Setting srcLinkSpeed to Default!",srcNC);
+                         srcLinkSpeed = DEFAULT_LINK_SPEED;
                     }
-
-                    long dstLinkSpeed = bwDst.getValue();
-                    if (dstLinkSpeed == 0) {
-                        log.trace("Edge {}: dstLinkSpeed is 0. Setting to {}!",
-                                e, DEFAULT_LINK_SPEED);
+                    if ((bwDst == null) || ((dstLinkSpeed = bwDst.getValue()) == 0)) {
+                        log.debug("dstNC: {} - Setting dstLinkSpeed to Default!",dstNC);
                         dstLinkSpeed = DEFAULT_LINK_SPEED;
                     }