Merge "HA sync for samples simpleforwarding"
[controller.git] / opendaylight / samples / simpleforwarding / src / main / java / org / opendaylight / controller / samples / simpleforwarding / internal / SimpleForwardingImpl.java
index c2fee970ac00c8354140de8318786cd0bfcac7c4..7f4c98a6483969fabfd14f6bc54219873ae00cd8 100644 (file)
@@ -50,12 +50,15 @@ import org.opendaylight.controller.sal.routing.IRouting;
 import org.opendaylight.controller.sal.utils.EtherTypes;
 import org.opendaylight.controller.sal.utils.NodeConnectorCreator;
 import org.opendaylight.controller.sal.utils.Status;
+import org.opendaylight.controller.samples.simpleforwarding.HostNodePair;
 import org.opendaylight.controller.switchmanager.IInventoryListener;
 import org.opendaylight.controller.switchmanager.ISwitchManager;
 import org.opendaylight.controller.topologymanager.ITopologyManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+
+
 public class SimpleForwardingImpl implements IfNewHostNotify,
         IListenRoutingUpdates, IInventoryListener {
     private static Logger log = LoggerFactory
@@ -147,7 +150,7 @@ public class SimpleForwardingImpl implements IfNewHostNotify,
     }
 
     @SuppressWarnings("deprecation")
-       private void allocateCaches() {
+        private void allocateCaches() {
         if (this.clusterContainerService == null) {
             log.info("un-initialized clusterContainerService, can't create cache");
             return;
@@ -178,7 +181,7 @@ public class SimpleForwardingImpl implements IfNewHostNotify,
     }
 
     @SuppressWarnings("deprecation")
-       private void destroyCaches() {
+        private void destroyCaches() {
         if (this.clusterContainerService == null) {
             log.info("un-initialized clusterContainerService, can't destroy cache");
             return;
@@ -367,7 +370,7 @@ public class SimpleForwardingImpl implements IfNewHostNotify,
                 }
 
             } else {
-                log.debug("Adding policyMatch(DIP = {}) Action(outPort= {}) " + 
+                log.debug("Adding policyMatch(DIP = {}) Action(outPort= {}) " +
                         "to node {}", new Object[] {
                         host.getNetworkAddress().getHostAddress(), outPort,
                         currNode});
@@ -482,7 +485,7 @@ public class SimpleForwardingImpl implements IfNewHostNotify,
         updatePerHostRuleInSW(host, rootNode, rootNode, null, new HostNodePair(
                 host, rootNode), ports);
 
-        //             log.debug("Getting out at the end!");
+        //      log.debug("Getting out at the end!");
         return switchesToProgram;
     }
 
@@ -575,10 +578,10 @@ public class SimpleForwardingImpl implements IfNewHostNotify,
         // rest of the world
         // switchesToProgram.add(rootNode);
         //updatePerHostRuleInSW(host, rootNode,
-        //                                       rootNode, null,
-        //                                       new HostNodePair(host, rootNode),ports);
+        //                                        rootNode, null,
+        //                                        new HostNodePair(host, rootNode),ports);
 
-        //             log.debug("Getting out at the end!");
+        //      log.debug("Getting out at the end!");
         return switchesToProgram;
     }
 
@@ -617,7 +620,7 @@ public class SimpleForwardingImpl implements IfNewHostNotify,
                     Status poStatus = this.frm.installFlowEntry(po);
                     if (!poStatus.isSuccess()) {
                         log.error("Failed to install policy: "
-                                + po.getGroupName() + " (" 
+                                + po.getGroupName() + " ("
                                 + poStatus.getDescription() + ")");
 
                         retCode = RulesProgrammingReturnCode.FAILED_FEW_SWITCHES;
@@ -632,8 +635,8 @@ public class SimpleForwardingImpl implements IfNewHostNotify,
                               swId, host);
                     /* // Now dump every single rule */
                     /* for (HostNodePair dumpkey : this.rulesDB.keySet()) { */
-                    /*         po = this.rulesDB.get(dumpkey); */
-                    /*         log.debug("Dumping entry H{" + dumpkey.getHost() + "} S{" + dumpkey.getSwitchId() + "} = {" + (po == null ? "null policy" : po)); */
+                    /*  po = this.rulesDB.get(dumpkey); */
+                    /*  log.debug("Dumping entry H{" + dumpkey.getHost() + "} S{" + dumpkey.getSwitchId() + "} = {" + (po == null ? "null policy" : po)); */
                     /* } */
                 }
             }