Merge "Fixing ForwardingRulesManager code that got lost in a previous merge"
authorAlessandro Boch <aboch@cisco.com>
Wed, 24 Apr 2013 00:31:27 +0000 (00:31 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 24 Apr 2013 00:31:27 +0000 (00:31 +0000)
12 files changed:
opendaylight/arphandler/src/main/java/org/opendaylight/controller/arphandler/internal/ArpHandler.java
opendaylight/clustering/services_implementation/src/main/java/org/opendaylight/controller/clustering/services_implementation/internal/ClusterManager.java
opendaylight/clustering/services_implementation/src/main/java/org/opendaylight/controller/clustering/services_implementation/internal/ClusterManagerCommon.java
opendaylight/clustering/stub/src/main/java/org/opendaylight/controller/clustering/stub/internal/ClusterManagerCommon.java
opendaylight/configuration/implementation/src/main/java/org/opendaylight/controller/configuration/internal/ConfigurationContainerImpl.java
opendaylight/configuration/implementation/src/main/java/org/opendaylight/controller/configuration/internal/ConfigurationImpl.java
opendaylight/forwarding/staticrouting/src/main/java/org/opendaylight/controller/forwarding/staticrouting/internal/StaticRoutingImplementation.java
opendaylight/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/HostTracker.java
opendaylight/logging/bridge/src/main/java/org/opendaylight/controller/logging/bridge/internal/Activator.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/ServiceHelper.java
opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/internal/UserManagerImpl.java
opendaylight/usermanager/src/main/java/org/opendaylight/controller/usermanager/security/SessionManager.java

index d4c1fd3..3730a71 100644 (file)
@@ -130,9 +130,11 @@ public class ArpHandler implements IHostFinder, IListenDataPacket {
 
     protected void handleARPPacket(Ethernet eHeader, ARP pkt, NodeConnector p) {
         if (pkt.getOpCode() == 0x1) {
-            logger.debug("Received ARP REQUEST Packet from NodeConnector:" + p);
+            logger.debug("Received ARP REQUEST Packet from NodeConnector: {}",
+                         p);
         } else {
-            logger.debug("Received ARP REPLY Packet from NodeConnector:" + p);
+            logger.debug("Received ARP REPLY Packet from NodeConnector: {}",
+                         p);
         }
         InetAddress targetIP = null;
         try {
@@ -328,13 +330,13 @@ public class ArpHandler implements IHostFinder, IListenDataPacket {
         Node n = host.getnodeconnectorNode();
         if (n == null) {
             logger.error("cannot send UcastARP because cannot extract node "
-                    + "from HostNodeConnector:" + host);
+                    + "from HostNodeConnector: {}", host);
             return;
         }
         NodeConnector outPort = host.getnodeConnector();
         if (outPort == null) {
             logger.error("cannot send UcastARP because cannot extract "
-                    + "outPort from HostNodeConnector:" + host);
+                    + "outPort from HostNodeConnector: {}", host);
             return;
         }
 
@@ -489,8 +491,8 @@ public class ArpHandler implements IHostFinder, IListenDataPacket {
             return PacketResult.IGNORED;
         }
         logger
-                .trace("Received a frame of size:"
-                        inPkt.getPacketData().length);
+                .trace("Received a frame of size: {}",
+                        inPkt.getPacketData().length);
         Packet formattedPak = this.dataPacketService.decodeDataPacket(inPkt);
         if (formattedPak instanceof Ethernet) {
             Object nextPak = formattedPak.getPayload();
index 476b1b1..3034d3c 100644 (file)
@@ -113,15 +113,15 @@ public class ClusterManager implements IClusterServices {
         }
         while (supernodes.hasMoreTokens()) {
             String curr_supernode = supernodes.nextToken();
-            logger.debug("Examining supernode " + curr_supernode);
+            logger.debug("Examining supernode {}", curr_supernode);
             StringTokenizer host_port = new StringTokenizer(curr_supernode,
                     "[]");
             String host;
             String port;
             Integer port_num = gossipRouterPortDefault;
             if (host_port.countTokens() > 2) {
-                logger.error("Error parsing supernode " + curr_supernode
-                        + " proceed to the next one");
+                logger.error("Error parsing supernode {} proceed to the next one",
+                        curr_supernode);
                 continue;
             }
             host = host_port.nextToken();
@@ -184,13 +184,13 @@ public class ClusterManager implements IClusterServices {
                     for (InetAddress myAddr : myAddresses) {
                         if (myAddr.isLoopbackAddress()
                                 || myAddr.isLinkLocalAddress()) {
-                            logger.debug("Skipping local address "
-                                    + myAddr.getHostAddress());
+                            logger.debug("Skipping local address {}",
+                                         myAddr.getHostAddress());
                             continue;
                         } else {
                             // First non-local address
                             myBind = myAddr.getHostAddress();
-                            logger.debug("First non-local address " + myBind);
+                            logger.debug("First non-local address {}", myBind);
                             break;
                         }
                     }
@@ -199,7 +199,7 @@ public class ClusterManager implements IClusterServices {
                         .getProperty("jgroups.tcp.address");
                 if (jgroupAddress == null) {
                     if (myBind != null) {
-                        logger.debug("Set bind address to be " + myBind);
+                        logger.debug("Set bind address to be {}", myBind);
                         System.setProperty("jgroups.tcp.address", myBind);
                     } else {
                         logger
@@ -207,8 +207,8 @@ public class ClusterManager implements IClusterServices {
                         System.setProperty("jgroups.tcp.address", "127.0.0.1");
                     }
                 } else {
-                    logger.debug("jgroup.tcp.address already set to be "
-                            jgroupAddress);
+                    logger.debug("jgroup.tcp.address already set to be {}",
+                            jgroupAddress);
                 }
             } catch (UnknownHostException uhe) {
                 logger
@@ -220,14 +220,14 @@ public class ClusterManager implements IClusterServices {
         // host list
         System.setProperty("jgroups.tcpgossip.initial_hosts",
                 sanitized_supernodes_list.toString());
-        logger.debug("jgroups.tcp.address set to "
-                System.getProperty("jgroups.tcp.address"));
-        logger.debug("jgroups.tcpgossip.initial_hosts set to "
-                System.getProperty("jgroups.tcpgossip.initial_hosts"));
+        logger.debug("jgroups.tcp.address set to {}",
+                System.getProperty("jgroups.tcp.address"));
+        logger.debug("jgroups.tcpgossip.initial_hosts set to {}",
+                System.getProperty("jgroups.tcpgossip.initial_hosts"));
         GossipRouter res = null;
         if (amIGossipRouter) {
-            logger.info("I'm a GossipRouter will listen on port "
-                    gossipRouterPort);
+            logger.info("I'm a GossipRouter will listen on port {}",
+                    gossipRouterPort);
             res = new GossipRouter(gossipRouterPort);
         }
         return res;
@@ -241,10 +241,8 @@ public class ClusterManager implements IClusterServices {
                 this.gossiper.start();
                 logger.info("Started GossipRouter");
             } catch (Exception e) {
-                logger.error("GossipRouter didn't start exception " + e
-                        + " met");
-                logger.error("Stack Trace that raised the exception");
-                logger.error("",e);
+                logger.error("GossipRouter didn't start. Exception Stack Trace",
+                             e);
             }
         }
         logger.info("Starting the ClusterManager");
@@ -264,7 +262,7 @@ public class ClusterManager implements IClusterServices {
             this.cm = null;
             this.stop();
         }
-        logger.debug("Cache Manager has value " + this.cm);
+        logger.debug("Cache Manager has value {}", this.cm);
     }
 
     public void stop() {
index 2afbabe..7bf4954 100644 (file)
@@ -116,7 +116,7 @@ abstract public class ClusterManagerCommon implements IClusterServicesCommon {
         Dictionary props = c.getServiceProperties();
         if (props != null) {
             this.containerName = (String) props.get("containerName");
-            logger.debug("Running containerName:" + this.containerName);
+            logger.debug("Running containerName: {}", this.containerName);
         } else {
             // In the Global instance case the containerName is empty
             this.containerName = "";
index 6fa0d6e..035b0d3 100644 (file)
@@ -65,7 +65,7 @@ abstract public class ClusterManagerCommon implements IClusterServicesCommon {
         Dictionary props = c.getServiceProperties();
         if (props != null) {
             this.containerName = (String) props.get("containerName");
-            logger.debug("Running containerName:" + this.containerName);
+            logger.debug("Running containerName: {}", this.containerName);
         } else {
             // In the Global instance case the containerName is empty
             this.containerName = "";
index efe966b..3d0c565 100644 (file)
@@ -83,14 +83,14 @@ public class ConfigurationContainerImpl implements
     public Status saveConfiguration() {
         boolean success = true;
         for (IConfigurationContainerAware configurationAware : configurationAwareList) {
-            logger.info("Save Config triggered for "
-                    + configurationAware.getClass().getSimpleName());
+            logger.info("Save Config triggered for {}",
+                      configurationAware.getClass().getSimpleName());
 
             Status status = configurationAware.saveConfiguration();
             if (!status.isSuccess()) {
                success = false;
-               logger.info("Failed to save config for "
-                               configurationAware.getClass().getSimpleName());
+               logger.info("Failed to save config for {}",
+                               configurationAware.getClass().getSimpleName());
             }
         }
         if (success) {
index a8f7da6..ee15b4a 100644 (file)
@@ -84,8 +84,8 @@ public class ConfigurationImpl implements IConfigurationService {
                Status status = configurationAware.saveConfiguration();
             if (!status.isSuccess()) {
                success = false;
-               logger.info("Failed to save config for "
-                               configurationAware.getClass().getName());
+               logger.info("Failed to save config for {}",
+                               configurationAware.getClass().getName());
             }
         }
         if (success) {
index 4c2ea73..ad6ea6b 100644 (file)
@@ -451,8 +451,8 @@ public class StaticRoutingImplementation implements IfNewHostNotify,
         staticRoutesFileName = ROOT + "staticRouting_" + containerName
                 + ".conf";
 
-        log.debug("forwarding.staticrouting starting on container "
-                + containerName);
+        log.debug("forwarding.staticrouting starting on container {}",
+                  containerName);
         //staticRoutes = new ConcurrentHashMap<String, StaticRoute>();
         allocateCaches();
         retrieveCaches();
index 42802d3..45f3ced 100644 (file)
@@ -639,7 +639,6 @@ public class HostTracker implements IfIptoHost, IfHostListener,
             if (switchNeedsTieringUpdate(dstNode, currentTier + 1)) {
                 Tier t = new Tier(currentTier + 1);
                 switchManager.setNodeProp(dstNode, t);
-                //logger.info("Updating Switch Tier "+ (currentTier+1) +" for "+String.format("%x", dstSw.getId()));
                 needsVisiting.add(dstNode);
             }
         }
@@ -684,7 +683,6 @@ public class HostTracker implements IfIptoHost, IfHostListener,
             return true;
         else if (t.getValue() > tier)
             return true;
-        //logger.info(getContainerName()+" -> "+ "Switch "+String.format("%x", sw.getId())+ " is in better Tier "+sw.getTier()+" ... skipping "+tier);
         return false;
     }
 
@@ -993,8 +991,6 @@ public class HostTracker implements IfIptoHost, IfHostListener,
                     notifyHostLearnedOrRemoved(host, false);
                 } else if (arp_cntdown <= switchManager.getHostRetryCount()) {
                     /* Use the services of arphandler to check if host is still there */
-                    // logger.info("Probe for Host:{}", host);
-                    //logger.info("ARP Probing ("+arp_cntdown+") for "+host.toString());
                     logger.trace("ARP Probing ({}) for {}({})", new Object[] {
                             arp_cntdown,
                             host.getNetworkAddress().getHostAddress(),
index 75c5ca9..d455a0a 100644 (file)
@@ -44,7 +44,7 @@ public class Activator implements BundleActivator {
                         .getService(service);
                 if (reader == null) {
                     this.log.error("Cannot register the LogListener because "
-                            + "cannot retrive LogReaderService");
+                            + "cannot retrieve LogReaderService");
                 }
                 reader.addLogListener(this.listener);
                 // Now lets walk all the exiting messages
@@ -66,7 +66,7 @@ public class Activator implements BundleActivator {
                         controller.logging.bridge.internal.UncaughtExceptionHandler());
             } else {
                 this.log.error("Cannot register the LogListener because "
-                        + "cannot retrive LogReaderService");
+                        + "cannot retrieve LogReaderService");
             }
         } else {
             System.err
index 0555860..ef9f2f4 100644 (file)
@@ -82,7 +82,8 @@ public class ServiceHelper {
             }
             return true;
         } catch (Exception e) {
-            logger.error("Exception "+e.getMessage() +" while registering the service "+instance.toString());
+            logger.error("Exception {} while registering the service {}",
+                    e.getMessage(), instance.toString());
         }
         return false;
     }
index 1b9c749..0397cd4 100644 (file)
@@ -275,14 +275,14 @@ public class UserManagerImpl implements IUserManager, IObjectReader,
                     break;
                 } else if (rcResponse.getStatus() == AuthResultEnum.AUTH_REJECT) {
                     logger.info(
-                            "Remote Authentication Rejected User: \"{}\", from Server: {}, Reason: "
-                                    + rcResponse.getStatus().toString(),
-                            userName, aaaServer.getAddress());
+                            "Remote Authentication Rejected User: \"{}\", from Server: {}, Reason:{}",
+                            new Object[] {userName, aaaServer.getAddress(),
+                            rcResponse.getStatus().toString()});
                 } else {
                     logger.info(
-                            "Remote Authentication Failed for User: \"{}\", from Server: {}, Reason: "
-                                    + rcResponse.getStatus().toString(),
-                            userName, aaaServer.getAddress());
+                            "Remote Authentication Failed for User: \"{}\", from Server: {}, Reason:{}",
+                            new Object[] {userName, aaaServer.getAddress(),
+                            rcResponse.getStatus().toString()});
                 }
             }
         }
@@ -367,8 +367,8 @@ public class UserManagerImpl implements IUserManager, IObjectReader,
          */
         putUserInActiveList(userName, result);
         if (authorized) {
-            logger.info("User \"{}\" authorized for the following role(s): "
-                    + result.getUserRoles(), userName);
+            logger.info("User \"{}\" authorized for the following role(s): {}",
+                        userName, result.getUserRoles());
         } else {
             logger.info("User \"{}\" Not Authorized for any role ", userName);
         }
index 7706fe2..21d0137 100644 (file)
@@ -38,8 +38,9 @@ public class SessionManager implements ISessionManager {
         ServletContext ctx = se.getSession().getServletContext();
         String path = ctx.getContextPath();
 
-        logger.debug("Servlet Context Path created " + path);
-        logger.debug("Session Id created for ctxt path " + se.getSession().getId());
+        logger.debug("Servlet Context Path created {}", path);
+        logger.debug("Session Id created for ctxt path {}",
+                se.getSession().getId());
 
         synchronized (sessionMap) {
             Set<HttpSession> set = sessionMap.get(ctx);
@@ -55,8 +56,8 @@ public class SessionManager implements ISessionManager {
     public void sessionDestroyed(HttpSessionEvent se) {
         ServletContext ctx = se.getSession().getServletContext();
         String path = ctx.getContextPath();
-        logger.debug("Servlet Context Path of destroyed session - " + path);
-        logger.debug("Session Id destroyed " + se.getSession().getId());
+        logger.debug("Servlet Context Path of destroyed session - {}", path);
+        logger.debug("Session Id destroyed {}", se.getSession().getId());
 
         synchronized (sessionMap) {
             Set<HttpSession> set = sessionMap.get(ctx);