cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [16/48] All Checkstyle problems corrected
Date Thu, 12 Dec 2013 21:01:16 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index 67b119b..f38bb3c 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -156,21 +156,20 @@ import com.cloud.agent.api.ModifyStoragePoolAnswer;
 import com.cloud.agent.api.ModifyStoragePoolCommand;
 import com.cloud.agent.api.NetworkRulesSystemVmCommand;
 import com.cloud.agent.api.NetworkRulesVmSecondaryIpCommand;
-import com.cloud.agent.api.OvsCreateGreTunnelCommand;
 import com.cloud.agent.api.OvsCreateGreTunnelAnswer;
-import com.cloud.agent.api.OvsCreateTunnelCommand;
-import com.cloud.agent.api.OvsDestroyTunnelCommand;
-import com.cloud.agent.api.OvsSetupBridgeCommand;
-import com.cloud.agent.api.OvsDestroyBridgeCommand;
+import com.cloud.agent.api.OvsCreateGreTunnelCommand;
 import com.cloud.agent.api.OvsCreateTunnelAnswer;
+import com.cloud.agent.api.OvsCreateTunnelCommand;
 import com.cloud.agent.api.OvsDeleteFlowCommand;
-import com.cloud.agent.api.OvsSetTagAndFlowAnswer;
+import com.cloud.agent.api.OvsDestroyBridgeCommand;
+import com.cloud.agent.api.OvsDestroyTunnelCommand;
 import com.cloud.agent.api.OvsFetchInterfaceAnswer;
-import com.cloud.agent.api.OvsSetTagAndFlowCommand;
 import com.cloud.agent.api.OvsFetchInterfaceCommand;
+import com.cloud.agent.api.OvsSetTagAndFlowAnswer;
+import com.cloud.agent.api.OvsSetTagAndFlowCommand;
+import com.cloud.agent.api.OvsSetupBridgeCommand;
 import com.cloud.agent.api.PerformanceMonitorAnswer;
 import com.cloud.agent.api.PerformanceMonitorCommand;
-
 import com.cloud.agent.api.PingCommand;
 import com.cloud.agent.api.PingRoutingCommand;
 import com.cloud.agent.api.PingRoutingWithNwGroupsCommand;
@@ -298,15 +297,13 @@ import com.cloud.utils.StringUtils;
 import com.cloud.utils.Ternary;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.net.NetUtils;
-import com.cloud.utils.StringUtils;
+import com.cloud.utils.ssh.SSHCmdHelper;
 import com.cloud.vm.DiskProfile;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.VirtualMachine.PowerState;
 import com.cloud.vm.VirtualMachine.State;
 import com.cloud.vm.snapshot.VMSnapshot;
 
-import com.cloud.utils.ssh.SSHCmdHelper;
-
 /**
  * CitrixResourceBase encapsulates the calls to the XenServer Xapi process
  * to perform the required functionalities for CloudStack.
@@ -322,7 +319,7 @@ import com.cloud.utils.ssh.SSHCmdHelper;
 @Local(value = ServerResource.class)
 public abstract class CitrixResourceBase implements ServerResource, HypervisorResource {
     private static final Logger s_logger = Logger.getLogger(CitrixResourceBase.class);
-    protected static final XenServerConnectionPool _connPool = XenServerConnectionPool.getInstance();
+    protected static final XenServerConnectionPool ConnPool = XenServerConnectionPool.getInstance();
     protected String _name;
     protected String _username;
     protected Queue<String> _password = new LinkedList<String>();
@@ -341,7 +338,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
     protected int _wait;
     protected int _migratewait;
     protected String _instance; //instance name (default is usually "VM")
-    static final Random _rand = new Random(System.currentTimeMillis());
+    static final Random Rand = new Random(System.currentTimeMillis());
     protected boolean _securityGroupEnabled;
 
     protected IAgentControl _agentControl;
@@ -355,8 +352,8 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
     protected int _pollingIntervalInSeconds = 60;
 
     //Hypervisor specific params with generic value, may need to be overridden for specific versions
-    long _xs_memory_used = 128 * 1024 * 1024L; // xen hypervisor used 128 M
-    double _xs_virtualization_factor = 63.0 / 64.0;  // 1 - virtualization overhead
+    long _xsMemoryUsed = 128 * 1024 * 1024L; // xen hypervisor used 128 M
+    double _xsVirtualizationFactor = 63.0 / 64.0;  // 1 - virtualization overhead
 
     //static min values for guests on xen
     private static final long mem_128m = 134217728L;
@@ -461,9 +458,9 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
         Connection slaveConn = null;
         try {
             URL slaveUrl = null;
-            slaveUrl = _connPool.getURL(_host.ip);
+            slaveUrl = ConnPool.getURL(_host.ip);
             slaveConn = new Connection(slaveUrl, 10);
-            slaveSession = _connPool.slaveLocalLoginWithPassword(slaveConn, _username, _password);
+            slaveSession = ConnPool.slaveLocalLoginWithPassword(slaveConn, _username, _password);
             return true;
         } catch (Exception e) {
         } finally {
@@ -659,87 +656,87 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
             return execute((PvlanSetupCommand)cmd);
         } else if (clazz == SetMonitorServiceCommand.class) {
             return execute((SetMonitorServiceCommand)cmd);
-		} else if (clazz == PerformanceMonitorCommand.class) {
-			return execute((PerformanceMonitorCommand) cmd);
+        } else if (clazz == PerformanceMonitorCommand.class) {
+            return execute((PerformanceMonitorCommand)cmd);
         } else {
             return Answer.createUnsupportedCommandAnswer(cmd);
         }
     }
 
-	private Answer execute(PerformanceMonitorCommand cmd) {
-		Connection conn = getConnection();
-		String perfMon = getPerfMon(conn, cmd.getParams(), cmd.getWait());
-		if (perfMon == null) {
-			return new PerformanceMonitorAnswer(cmd, false, perfMon);
-		} else
-			return new PerformanceMonitorAnswer(cmd, true, perfMon);
-	}
-
-	private String getPerfMon(Connection conn, Map<String, String> params,
-			int wait) {
-		String result = null;
-		try {
-			result = callHostPluginAsync(conn, "vmopspremium", "asmonitor", 60,
-					params);
-			if (result != null)
-				return result;
-		} catch (Exception e) {
-			s_logger.error("Can not get performance monitor for AS due to ", e);
-		}
-		return null;
-	}
-
-	protected String callHostPluginAsync(Connection conn, String plugin,
-			String cmd, int wait, Map<String, String> params) {
-		int timeout = wait * 1000;
-		Map<String, String> args = new HashMap<String, String>();
-		Task task = null;
-		try {
-			for (String key : params.keySet()) {
-				args.put(key, params.get(key));
-			}
-			if (s_logger.isTraceEnabled()) {
-				s_logger.trace("callHostPlugin executing for command " + cmd
-						+ " with " + getArgsString(args));
-			}
-			Host host = Host.getByUuid(conn, _host.uuid);
-			task = host.callPluginAsync(conn, plugin, cmd, args);
-			// poll every 1 seconds
-			waitForTask(conn, task, 1000, timeout);
-			checkForSuccess(conn, task);
-			String result = task.getResult(conn);
-			if (s_logger.isTraceEnabled()) {
-				s_logger.trace("callHostPlugin Result: " + result);
-			}
-			return result.replace("<value>", "").replace("</value>", "")
-					.replace("\n", "");
-		} catch (Types.HandleInvalid e) {
-			s_logger.warn("callHostPlugin failed for cmd: " + cmd
-					+ " with args " + getArgsString(args)
-					+ " due to HandleInvalid clazz:" + e.clazz + ", handle:"
-					+ e.handle);
-		} catch (XenAPIException e) {
-			s_logger.warn(
-					"callHostPlugin failed for cmd: " + cmd + " with args "
-							+ getArgsString(args) + " due to " + e.toString(),
-					e);
-		} catch (XmlRpcException e) {
-			s_logger.warn(
-					"callHostPlugin failed for cmd: " + cmd + " with args "
-							+ getArgsString(args) + " due to " + e.getMessage(),
-					e);
-		} finally {
-			if (task != null) {
-				try {
-					task.destroy(conn);
-				} catch (Exception e1) {
-					s_logger.warn("unable to destroy task(" + task.toString()
-							+ ") on host(" + _host.uuid + ") due to ", e1);
-				}
-			}
-		}
-		return null;
-	}
+    private Answer execute(PerformanceMonitorCommand cmd) {
+        Connection conn = getConnection();
+        String perfMon = getPerfMon(conn, cmd.getParams(), cmd.getWait());
+        if (perfMon == null) {
+            return new PerformanceMonitorAnswer(cmd, false, perfMon);
+        } else
+            return new PerformanceMonitorAnswer(cmd, true, perfMon);
+    }
+
+    private String getPerfMon(Connection conn, Map<String, String> params,
+        int wait) {
+        String result = null;
+        try {
+            result = callHostPluginAsync(conn, "vmopspremium", "asmonitor", 60,
+                params);
+            if (result != null)
+                return result;
+        } catch (Exception e) {
+            s_logger.error("Can not get performance monitor for AS due to ", e);
+        }
+        return null;
+    }
+
+    protected String callHostPluginAsync(Connection conn, String plugin,
+        String cmd, int wait, Map<String, String> params) {
+        int timeout = wait * 1000;
+        Map<String, String> args = new HashMap<String, String>();
+        Task task = null;
+        try {
+            for (String key : params.keySet()) {
+                args.put(key, params.get(key));
+            }
+            if (s_logger.isTraceEnabled()) {
+                s_logger.trace("callHostPlugin executing for command " + cmd
+                    + " with " + getArgsString(args));
+            }
+            Host host = Host.getByUuid(conn, _host.uuid);
+            task = host.callPluginAsync(conn, plugin, cmd, args);
+            // poll every 1 seconds
+            waitForTask(conn, task, 1000, timeout);
+            checkForSuccess(conn, task);
+            String result = task.getResult(conn);
+            if (s_logger.isTraceEnabled()) {
+                s_logger.trace("callHostPlugin Result: " + result);
+            }
+            return result.replace("<value>", "").replace("</value>", "")
+                .replace("\n", "");
+        } catch (Types.HandleInvalid e) {
+            s_logger.warn("callHostPlugin failed for cmd: " + cmd
+                + " with args " + getArgsString(args)
+                + " due to HandleInvalid clazz:" + e.clazz + ", handle:"
+                + e.handle);
+        } catch (XenAPIException e) {
+            s_logger.warn(
+                "callHostPlugin failed for cmd: " + cmd + " with args "
+                    + getArgsString(args) + " due to " + e.toString(),
+                e);
+        } catch (XmlRpcException e) {
+            s_logger.warn(
+                "callHostPlugin failed for cmd: " + cmd + " with args "
+                    + getArgsString(args) + " due to " + e.getMessage(),
+                e);
+        } finally {
+            if (task != null) {
+                try {
+                    task.destroy(conn);
+                } catch (Exception e1) {
+                    s_logger.warn("unable to destroy task(" + task.toString()
+                        + ") on host(" + _host.uuid + ") due to ", e1);
+                }
+            }
+        }
+        return null;
+    }
 
     protected void scaleVM(Connection conn, VM vm, VirtualMachineTO vmSpec, Host host) throws XenAPIException, XmlRpcException {
 
@@ -769,7 +766,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
 
             if (vmSpec.getLimitCpuUse()) {
                 long utilization = 0; // max CPU cap, default is unlimited
-                utilization = (int) ((vmSpec.getMaxSpeed() * 0.99 * vmSpec.getCpus()) / _host.speed * 100);
+                utilization = (int)((vmSpec.getMaxSpeed() * 0.99 * vmSpec.getCpus()) / _host.speed * 100);
                 //vm.addToVCPUsParamsLive(conn, "cap", Long.toString(utilization)); currently xenserver doesnot support Xapi to add VCPUs params live.
                 callHostPlugin(conn, "vmops", "add_to_VCPUs_params_live", "key", "cap", "value", Long.toString(utilization), "vmname", vmSpec.getName());
             }
@@ -1016,7 +1013,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
                     vswitchNw = networks.iterator().next();
                 }
                 if (!is_xcp())
-                	enableXenServerNetwork(conn, vswitchNw, "vswitch", "vswitch network");
+                    enableXenServerNetwork(conn, vswitchNw, "vswitch", "vswitch network");
                 _host.vswitchNetwork = vswitchNw;
             }
             return _host.vswitchNetwork;
@@ -1051,7 +1048,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
                 nw = Network.create(conn, rec);
                 // Plug dom0 vif only when creating network
                 if (!is_xcp())
-                	enableXenServerNetwork(conn, nw, nwName, "tunnel network for account " + key);
+                    enableXenServerNetwork(conn, nw, nwName, "tunnel network for account " + key);
                 s_logger.debug("### Xen Server network for tunnels created:" + nwName);
             } else {
                 nw = networks.iterator().next();
@@ -1087,12 +1084,12 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
             }
             if (!configured) {
                 // Plug dom0 vif only if not done before for network and host
-            	if (!is_xcp())
-            		enableXenServerNetwork(conn, nw, nwName, "tunnel network for account " + key);
+                if (!is_xcp())
+                    enableXenServerNetwork(conn, nw, nwName, "tunnel network for account " + key);
                 String result = callHostPlugin(conn, "ovstunnel", "setup_ovs_bridge", "bridge", bridge,
-                        "key", String.valueOf(key),
-                        "xs_nw_uuid", nw.getUuid(conn),
-                        "cs_host_id", ((Long)hostId).toString());
+                    "key", String.valueOf(key),
+                    "xs_nw_uuid", nw.getUuid(conn),
+                    "cs_host_id", ((Long)hostId).toString());
                 //Note down the fact that the ovs bridge has been setup
                 String[] res = result.split(":");
                 if (res.length != 2 || !res[0].equalsIgnoreCase("SUCCESS")) {
@@ -1427,7 +1424,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
 
             if (vmSpec.getLimitCpuUse()) {
                 // CPU cap is per VM, so need to assign cap based on the number of vcpus
-                utilization = (int) ((vmSpec.getMaxSpeed() * 0.99 * vmSpec.getCpus()) / _host.speed * 100);
+                utilization = (int)((vmSpec.getMaxSpeed() * 0.99 * vmSpec.getCpus()) / _host.speed * 100);
             }
 
             vcpuParams.put("weight", Integer.toString(cpuWeight));
@@ -1488,9 +1485,9 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
     protected void finalizeVmMetaData(VM vm, Connection conn, VirtualMachineTO vmSpec) throws Exception {
 
         Map<String, String> details = vmSpec.getDetails();
-        if ( details != null ) {
+        if (details != null) {
             String platformstring = details.get("platform");
-            if (platformstring != null && !platformstring.isEmpty() ) {
+            if (platformstring != null && !platformstring.isEmpty()) {
                 Map<String, String> platform = StringUtils.stringToMap(platformstring);
                 vm.setPlatform(conn, platform);
             } else {
@@ -1508,11 +1505,11 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
                 }
 
                 String xentoolsversion = details.get("hypervisortoolsversion");
-                if ( xentoolsversion == null || !xentoolsversion.equalsIgnoreCase("xenserver61") ) {
-                     Map<String, String> platform = vm.getPlatform(conn);
-                     platform.remove("device_id");
-                     vm.setPlatform(conn, platform);
-                 }
+                if (xentoolsversion == null || !xentoolsversion.equalsIgnoreCase("xenserver61")) {
+                    Map<String, String> platform = vm.getPlatform(conn);
+                    platform.remove("device_id");
+                    vm.setPlatform(conn, platform);
+                }
 
             }
         }
@@ -4263,7 +4260,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
                                     // network might be destroyed by other host
                                 }
                             }
-                            return new StopAnswer(cmd, "Stop VM " + vmName + " Succeed", platformstring ,true);
+                            return new StopAnswer(cmd, "Stop VM " + vmName + " Succeed", platformstring, true);
                         }
                     } catch (Exception e) {
                         String msg = "VM destroy failed in Stop " + vmName + " Command due to " + e.getMessage();
@@ -4640,7 +4637,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
     }
 
     protected String generateTimeStamp() {
-        return new StringBuilder("CsCreateTime-").append(System.currentTimeMillis()).append("-").append(_rand.nextInt()).toString();
+        return new StringBuilder("CsCreateTime-").append(System.currentTimeMillis()).append("-").append(Rand.nextInt()).toString();
     }
 
     protected Pair<Long, Integer> parseTimestamp(String timeStampStr) {
@@ -4957,11 +4954,11 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
                 break;
             }
             Host.Record hr = myself.getRecord(conn);
-            _host.product_version = hr.softwareVersion.get("product_version");
-            if (_host.product_version == null) {
-                _host.product_version = hr.softwareVersion.get("platform_version");
+            _host.productVersion = hr.softwareVersion.get("product_version");
+            if (_host.productVersion == null) {
+                _host.productVersion = hr.softwareVersion.get("platform_version");
             } else {
-                _host.product_version = _host.product_version.trim();
+                _host.productVersion = _host.productVersion.trim();
             }
 
             XsLocalNetwork privateNic = getManagementNetwork(conn);
@@ -5154,7 +5151,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
         cmd.setHypervisorType(HypervisorType.XenServer);
         cmd.setCluster(_cluster);
         cmd.setPoolSync(false);
-        cmd.setHostVmStateReport(this.getHostVmStateReport(conn));
+        cmd.setHostVmStateReport(getHostVmStateReport(conn));
 
         Pool pool;
         try {
@@ -5948,7 +5945,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
         String label = cmd.getLabel();
         //FIXME: this is a tricky to pass the network checking in XCP. I temporary get default label from Host.
         if (is_xcp()) {
-        	label = getLabel();
+            label = getLabel();
         }
         s_logger.debug("Will look for network with name-label:" + label + " on host " + _host.ip);
         Connection conn = getConnection();
@@ -6044,7 +6041,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
     }
 
     public Connection getConnection() {
-        return _connPool.connect(_host.uuid, _host.pool, _host.ip, _username, _password, _wait);
+        return ConnPool.connect(_host.uuid, _host.pool, _host.ip, _username, _password, _wait);
     }
 
     protected void fillHostInfo(Connection conn, StartupRoutingCommand cmd) {
@@ -6064,13 +6061,13 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
                 productBrand = hr.softwareVersion.get("platform_name");
             }
             details.put("product_brand", productBrand);
-            details.put("product_version", _host.product_version);
+            details.put("product_version", _host.productVersion);
 
             if (hr.softwareVersion.get("product_version_text_short") != null) {
                 details.put("product_version_text_short", hr.softwareVersion.get("product_version_text_short"));
                 cmd.setHypervisorVersion(hr.softwareVersion.get("product_version_text_short"));
 
-                cmd.setHypervisorVersion(_host.product_version);
+                cmd.setHypervisorVersion(_host.productVersion);
             }
             if (_privateNetworkName != null) {
                 details.put("private.network.device", _privateNetworkName);
@@ -6108,7 +6105,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
                 }
             }
 
-            ram = (long)((ram - dom0Ram - _xs_memory_used) * _xs_virtualization_factor);
+            ram = (long)((ram - dom0Ram - _xsMemoryUsed) * _xsVirtualizationFactor);
             cmd.setMemory(ram);
             cmd.setDom0MinMemory(dom0Ram);
 
@@ -6248,7 +6245,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
     }
 
     private void CheckXenHostInfo() throws ConfigurationException {
-        Connection conn = _connPool.slaveConnect(_host.ip, _username, _password);
+        Connection conn = ConnPool.slaveConnect(_host.ip, _username, _password);
         if (conn == null) {
             throw new ConfigurationException("Can not create slave connection to " + _host.ip);
         }
@@ -8020,7 +8017,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
                         newMasterRecord = entry.getValue();
                         s_logger.debug("New master for the XenPool is " + newMasterRecord.uuid + " : " + newMasterRecord.address);
                         try {
-                            _connPool.switchMaster(_host.ip, _host.pool, conn, newMaster, _username, _password, _wait);
+                            ConnPool.switchMaster(_host.ip, _host.pool, conn, newMaster, _username, _password, _wait);
                             mastermigrated = true;
                             break;
                         } catch (Exception e) {
@@ -8160,7 +8157,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
         public int speed;
         public Integer cpuSockets;
         public int cpus;
-        public String product_version;
+        public String productVersion;
         public String localSRuuid;
 
         @Override
@@ -8342,10 +8339,10 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
                 State newState = entry.getValue().second();
                 String host_uuid = entry.getValue().first();
                 final Ternary<String, State, String> oldState = oldStates.remove(vm);
-                
+
                 // check if platform changed
-                if (platform != null && oldState != null){
-                    if (!platform.equals(oldState.third()) && newState != State.Stopped && newState != State.Stopping){
+                if (platform != null && oldState != null) {
+                    if (!platform.equals(oldState.third()) && newState != State.Stopped && newState != State.Stopping) {
                         s_logger.warn("Detecting a change in platform for " + vm);
                         changes.put(vm, new Ternary<String, State, String>(host_uuid, newState, platform));
 
@@ -8821,17 +8818,17 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
     public void setRunLevel(int level) {
     }
 
-	private boolean is_xcp() {
-		Connection conn = getConnection();
-		String result = callHostPlugin(conn, "ovstunnel", "is_xcp");
-		if (result.equals("XCP"))
-			return true;
-		return false;
-	}
+    private boolean is_xcp() {
+        Connection conn = getConnection();
+        String result = callHostPlugin(conn, "ovstunnel", "is_xcp");
+        if (result.equals("XCP"))
+            return true;
+        return false;
+    }
 
-	private String getLabel() {
-		Connection conn = getConnection();
-		String result = callHostPlugin(conn, "ovstunnel", "getLabel");
-		return result;
-	}
+    private String getLabel() {
+        Connection conn = getConnection();
+        String result = callHostPlugin(conn, "ovstunnel", "getLabel");
+        return result;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java
index 89adf55..9e7d5dd 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java
@@ -34,8 +34,8 @@ public class XenServer56SP2Resource extends XenServer56FP1Resource {
 
     public XenServer56SP2Resource() {
         super();
-        _xs_memory_used = 128 * 1024 * 1024L;
-        _xs_virtualization_factor = 62.0 / 64.0;
+        _xsMemoryUsed = 128 * 1024 * 1024L;
+        _xsVirtualizationFactor = 62.0 / 64.0;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java
index 90c6003..e797449 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java
@@ -840,16 +840,16 @@ public class XenServerConnectionPool {
         }
 
         @Override
-        protected Map dispatch(String method_call, Object[] method_params) throws XmlRpcException, XenAPIException {
-            if (method_call.equals("session.local_logout") || method_call.equals("session.slave_local_login_with_password") || method_call.equals("session.logout")) {
-                return super.dispatch(method_call, method_params);
+        protected Map dispatch(String methodCall, Object[] methodParams) throws XmlRpcException, XenAPIException {
+            if (methodCall.equals("session.local_logout") || methodCall.equals("session.slave_local_login_with_password") || methodCall.equals("session.logout")) {
+                return super.dispatch(methodCall, methodParams);
             }
 
-            if (method_call.equals("session.login_with_password")) {
+            if (methodCall.equals("session.login_with_password")) {
                 int retries = 0;
                 while (retries++ < _retries) {
                     try {
-                        return super.dispatch(method_call, method_params);
+                        return super.dispatch(methodCall, methodParams);
                     } catch (XmlRpcException e) {
                         Throwable cause = e.getCause();
                         if (cause == null || !(cause instanceof SocketException)) {
@@ -870,21 +870,21 @@ public class XenServerConnectionPool {
                 int retries = 0;
                 while (retries++ < _retries) {
                     try {
-                        return super.dispatch(method_call, method_params);
+                        return super.dispatch(methodCall, methodParams);
                     } catch (Types.SessionInvalid e) {
-                        s_logger.debug("Session is invalid for method: " + method_call + " due to " + e.getMessage() + ".  Reconnecting...retry=" + retries);
+                        s_logger.debug("Session is invalid for method: " + methodCall + " due to " + e.getMessage() + ".  Reconnecting...retry=" + retries);
                         if (retries >= _retries) {
                             removeConnect(_poolUuid);
                             throw e;
                         }
                         loginWithPassword(this, _username, _password, APIVersion.latest().toString());
-                        method_params[0] = getSessionReference();
+                        methodParams[0] = getSessionReference();
                     } catch (XmlRpcClientException e) {
-                        s_logger.debug("XmlRpcClientException for method: " + method_call + " due to " + e.getMessage());
+                        s_logger.debug("XmlRpcClientException for method: " + methodCall + " due to " + e.getMessage());
                         removeConnect(_poolUuid);
                         throw e;
                     } catch (XmlRpcException e) {
-                        s_logger.debug("XmlRpcException for method: " + method_call + " due to " + e.getMessage() + ".  Reconnecting...retry=" + retries);
+                        s_logger.debug("XmlRpcException for method: " + methodCall + " due to " + e.getMessage() + ".  Reconnecting...retry=" + retries);
                         if (retries >= _retries) {
                             removeConnect(_poolUuid);
                             throw e;
@@ -895,7 +895,7 @@ public class XenServerConnectionPool {
                             throw e;
                         }
                     } catch (Types.HostIsSlave e) {
-                        s_logger.debug("HostIsSlave Exception for method: " + method_call + " due to " + e.getMessage() + ".  Reconnecting...retry=" + retries);
+                        s_logger.debug("HostIsSlave Exception for method: " + methodCall + " due to " + e.getMessage() + ".  Reconnecting...retry=" + retries);
                         removeConnect(_poolUuid);
                         throw e;
                     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java
index 71c0e39..d685c3f 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java
@@ -27,14 +27,14 @@ import com.cloud.vm.VirtualMachine.State;
 
 public class XenServerPoolVms {
     private static final Logger s_logger = Logger.getLogger(XenServerPoolVms.class);
-    private final Map<String/* clusterId */, HashMap<String/* vm name */, Ternary<String/* host uuid */, State/* vm state */, String/* PV driver version*/>>> _cluster_vms =
+    private final Map<String/* clusterId */, HashMap<String/* vm name */, Ternary<String/* host uuid */, State/* vm state */, String/* PV driver version*/>>> _clusterVms =
         new ConcurrentHashMap<String, HashMap<String, Ternary<String, State, String>>>();
 
     public HashMap<String, Ternary<String, State, String>> getClusterVmState(String clusterId) {
-        HashMap<String, Ternary<String, State, String>> _vms = _cluster_vms.get(clusterId);
+        HashMap<String, Ternary<String, State, String>> _vms = _clusterVms.get(clusterId);
         if (_vms == null) {
             HashMap<String, Ternary<String, State, String>> vmStates = new HashMap<String, Ternary<String, State, String>>();
-            _cluster_vms.put(clusterId, vmStates);
+            _clusterVms.put(clusterId, vmStates);
             return vmStates;
         } else
             return _vms;
@@ -51,8 +51,8 @@ public class XenServerPoolVms {
         return pv == null ? State.Stopped : pv.second(); // if a VM is absent on the cluster, it is effectively in stopped state.
     }
 
-    public void put(String clusterId, String hostUuid, String name, State state, String platform){
-        HashMap<String, Ternary<String, State, String>> vms= getClusterVmState(clusterId);
+    public void put(String clusterId, String hostUuid, String name, State state, String platform) {
+        HashMap<String, Ternary<String, State, String>> vms = getClusterVmState(clusterId);
         vms.put(name, new Ternary<String, State, String>(hostUuid, state, platform));
     }
 
@@ -66,9 +66,9 @@ public class XenServerPoolVms {
         vms.remove(name);
     }
 
-    public void putAll(String clusterId, HashMap<String, Ternary<String, State, String>> new_vms) {
+    public void putAll(String clusterId, HashMap<String, Ternary<String, State, String>> newVms) {
         HashMap<String, Ternary<String, State, String>> vms = getClusterVmState(clusterId);
-        vms.putAll(new_vms);
+        vms.putAll(newVms);
     }
 
     public int size(String clusterId) {
@@ -79,7 +79,7 @@ public class XenServerPoolVms {
     @Override
     public String toString() {
         StringBuilder sbuf = new StringBuilder("PoolVms=");
-        for (HashMap<String/* vm name */, Ternary<String/* host uuid */, State/* vm state */, String>> clusterVM : _cluster_vms.values()) {
+        for (HashMap<String/* vm name */, Ternary<String/* host uuid */, State/* vm state */, String>> clusterVM : _clusterVms.values()) {
             for (String vmname : clusterVM.keySet()) {
                 sbuf.append(vmname).append("-").append(clusterVM.get(vmname).second()).append(",");
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/bigswitch-vns/src/com/cloud/network/bigswitch/BigSwitchVnsApi.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/bigswitch-vns/src/com/cloud/network/bigswitch/BigSwitchVnsApi.java b/plugins/network-elements/bigswitch-vns/src/com/cloud/network/bigswitch/BigSwitchVnsApi.java
index a2e1b96..4444599 100644
--- a/plugins/network-elements/bigswitch-vns/src/com/cloud/network/bigswitch/BigSwitchVnsApi.java
+++ b/plugins/network-elements/bigswitch-vns/src/com/cloud/network/bigswitch/BigSwitchVnsApi.java
@@ -47,8 +47,8 @@ import com.google.gson.reflect.TypeToken;
 
 public class BigSwitchVnsApi {
     private static final Logger s_logger = Logger.getLogger(BigSwitchVnsApi.class);
-    private final static String _protocol = "http";
-    private final static String _nsBaseUri = "/networkService/v1.1";
+    private final static String s_protocol = "http";
+    private final static String s_nsBaseUri = "/networkService/v1.1";
     private final static String CONTENT_TYPE = "Content-Type";
     private final static String ACCEPT = "Accept";
     private final static String CONTENT_JSON = "application/json";
@@ -70,7 +70,7 @@ public class BigSwitchVnsApi {
     protected HttpMethod createMethod(String type, String uri, int port) throws BigSwitchVnsApiException {
         String url;
         try {
-            url = new URL(_protocol, _host, port, uri).toString();
+            url = new URL(s_protocol, _host, port, uri).toString();
         } catch (MalformedURLException e) {
             s_logger.error("Unable to build BigSwitch API URL", e);
             throw new BigSwitchVnsApiException("Unable to build v API URL", e);
@@ -109,44 +109,44 @@ public class BigSwitchVnsApi {
     }
 
     public void createNetwork(NetworkData network) throws BigSwitchVnsApiException {
-        String uri = _nsBaseUri + "/tenants/" + network.getNetwork().getTenant_id() + "/networks";
+        String uri = s_nsBaseUri + "/tenants/" + network.getNetwork().getTenantId() + "/networks";
         executeCreateObject(network, new TypeToken<NetworkData>() {
         }.getType(), uri, Collections.<String, String> emptyMap());
     }
 
     public void deleteNetwork(String tenantId, String networkId) throws BigSwitchVnsApiException {
-        String uri = _nsBaseUri + "/tenants/" + tenantId + "/networks/" + networkId;
+        String uri = s_nsBaseUri + "/tenants/" + tenantId + "/networks/" + networkId;
         executeDeleteObject(uri);
     }
 
     public void createPort(String networkUuid, PortData port) throws BigSwitchVnsApiException {
-        String uri = _nsBaseUri + "/tenants/" + port.getPort().getTenant_id() + "/networks/" + networkUuid + "/ports";
+        String uri = s_nsBaseUri + "/tenants/" + port.getPort().getTenantId() + "/networks/" + networkUuid + "/ports";
         executeCreateObject(port, new TypeToken<PortData>() {
         }.getType(), uri, Collections.<String, String> emptyMap());
     }
 
     public void modifyPort(String networkId, PortData port) throws BigSwitchVnsApiException {
-        String uri = _nsBaseUri + "/tenants/" + port.getPort().getTenant_id() + "/networks/" + networkId + "/ports";
+        String uri = s_nsBaseUri + "/tenants/" + port.getPort().getTenantId() + "/networks/" + networkId + "/ports";
         executeUpdateObject(port, uri, Collections.<String, String> emptyMap());
     }
 
     public void deletePort(String tenantId, String networkId, String portId) throws BigSwitchVnsApiException {
-        String uri = _nsBaseUri + "/tenants/" + tenantId + "/networks/" + networkId + "/ports/" + portId;
+        String uri = s_nsBaseUri + "/tenants/" + tenantId + "/networks/" + networkId + "/ports/" + portId;
         executeDeleteObject(uri);
     }
 
     public void modifyPortAttachment(String tenantId, String networkId, String portId, AttachmentData attachment) throws BigSwitchVnsApiException {
-        String uri = _nsBaseUri + "/tenants/" + tenantId + "/networks/" + networkId + "/ports/" + portId + "/attachment";
+        String uri = s_nsBaseUri + "/tenants/" + tenantId + "/networks/" + networkId + "/ports/" + portId + "/attachment";
         executeUpdateObject(attachment, uri, Collections.<String, String> emptyMap());
     }
 
     public void deletePortAttachment(String tenantId, String networkId, String portId) throws BigSwitchVnsApiException {
-        String uri = _nsBaseUri + "/tenants/" + tenantId + "/networks/" + networkId + "/ports/" + portId + "/attachment";
+        String uri = s_nsBaseUri + "/tenants/" + tenantId + "/networks/" + networkId + "/ports/" + portId + "/attachment";
         executeDeleteObject(uri);
     }
 
     public ControlClusterStatus getControlClusterStatus() throws BigSwitchVnsApiException {
-        String uri = _nsBaseUri + "/health";
+        String uri = s_nsBaseUri + "/health";
         ControlClusterStatus ccs = executeRetrieveObject(new TypeToken<ControlClusterStatus>() {
         }.getType(), uri, 80, null);
         ccs.setStatus(true);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/bigswitch-vns/src/com/cloud/network/bigswitch/NetworkData.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/bigswitch-vns/src/com/cloud/network/bigswitch/NetworkData.java b/plugins/network-elements/bigswitch-vns/src/com/cloud/network/bigswitch/NetworkData.java
index d4e97ac..e44c0f4 100644
--- a/plugins/network-elements/bigswitch-vns/src/com/cloud/network/bigswitch/NetworkData.java
+++ b/plugins/network-elements/bigswitch-vns/src/com/cloud/network/bigswitch/NetworkData.java
@@ -17,20 +17,20 @@
 package com.cloud.network.bigswitch;
 
 public class NetworkData {
-    private Network network;
+    private final Network network;
 
     public Network getNetwork() {
-        return this.network;
+        return network;
     }
 
     public NetworkData() {
-        this.network = new Network();
+        network = new Network();
     }
 
     public class Network {
         private String id;
         private String name;
-        private String tenant_id;
+        private String tenantId;
         private int vlan;
         private String gateway;
         private String state;
@@ -43,20 +43,20 @@ public class NetworkData {
             this.id = id;
         }
 
-        public String getDisplay_name() {
+        public String getDisplayName() {
             return name;
         }
 
-        public void setDisplay_name(String display_name) {
-            this.name = display_name;
+        public void setDisplay_name(String displayName) {
+            name = displayName;
         }
 
-        public String getTenant_id() {
-            return tenant_id;
+        public String getTenantId() {
+            return tenantId;
         }
 
-        public void setTenant_id(String tenant_id) {
-            this.tenant_id = tenant_id;
+        public void setTenantId(String tenantId) {
+            this.tenantId = tenantId;
         }
 
         public int getVlan() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/bigswitch-vns/src/com/cloud/network/bigswitch/PortData.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/bigswitch-vns/src/com/cloud/network/bigswitch/PortData.java b/plugins/network-elements/bigswitch-vns/src/com/cloud/network/bigswitch/PortData.java
index 3c746c5..d228d37 100644
--- a/plugins/network-elements/bigswitch-vns/src/com/cloud/network/bigswitch/PortData.java
+++ b/plugins/network-elements/bigswitch-vns/src/com/cloud/network/bigswitch/PortData.java
@@ -30,7 +30,7 @@ public class PortData {
     public class Port {
         private String id;
         private String name;
-        private String tenant_id;
+        private String tenantId;
         private String state;
 
         public String getId() {
@@ -49,12 +49,12 @@ public class PortData {
             this.name = name;
         }
 
-        public String getTenant_id() {
-            return tenant_id;
+        public String getTenantId() {
+            return tenantId;
         }
 
-        public void setTenant_id(String tenant_id) {
-            this.tenant_id = tenant_id;
+        public void setTenantId(String tenantId) {
+            this.tenantId = tenantId;
         }
 
         public String getState() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/bigswitch-vns/src/com/cloud/network/resource/BigSwitchVnsResource.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/bigswitch-vns/src/com/cloud/network/resource/BigSwitchVnsResource.java b/plugins/network-elements/bigswitch-vns/src/com/cloud/network/resource/BigSwitchVnsResource.java
index bee3f00..223972e 100644
--- a/plugins/network-elements/bigswitch-vns/src/com/cloud/network/resource/BigSwitchVnsResource.java
+++ b/plugins/network-elements/bigswitch-vns/src/com/cloud/network/resource/BigSwitchVnsResource.java
@@ -187,7 +187,7 @@ public class BigSwitchVnsResource extends ManagerBase implements ServerResource
 
     private Answer executeRequest(CreateVnsNetworkCommand cmd, int numRetries) {
         NetworkData network = new NetworkData();
-        network.getNetwork().setTenant_id(cmd.getTenantUuid());
+        network.getNetwork().setTenantId(cmd.getTenantUuid());
         network.getNetwork().setUuid(cmd.getNetworkUuid());
         network.getNetwork().setDisplay_name(truncate("vns-cloudstack-" + cmd.getName(), 64));
         network.getNetwork().setVlan(cmd.getVlan());
@@ -222,7 +222,7 @@ public class BigSwitchVnsResource extends ManagerBase implements ServerResource
         PortData port = new PortData();
         port.getPort().setId(cmd.getPortUuid());
         port.getPort().setName(cmd.getPortName());
-        port.getPort().setTenant_id(cmd.getTenantUuid());
+        port.getPort().setTenantId(cmd.getTenantUuid());
 
         try {
             _bigswitchVnsApi.createPort(cmd.getNetworkUuid(), port);
@@ -270,7 +270,7 @@ public class BigSwitchVnsResource extends ManagerBase implements ServerResource
         PortData port = new PortData();
         port.getPort().setId(cmd.getPortUuid());
         port.getPort().setName(cmd.getPortName());
-        port.getPort().setTenant_id(cmd.getTenantUuid());
+        port.getPort().setTenantId(cmd.getTenantUuid());
 
         try {
             _bigswitchVnsApi.modifyPort(cmd.getNetworkUuid(), port);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/ConfigureNexusVsmForAsaCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/ConfigureNexusVsmForAsaCommand.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/ConfigureNexusVsmForAsaCommand.java
index 2994982..fba9942 100755
--- a/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/ConfigureNexusVsmForAsaCommand.java
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/ConfigureNexusVsmForAsaCommand.java
@@ -51,47 +51,47 @@ public class ConfigureNexusVsmForAsaCommand extends Command {
         return _vlanId;
     }
 
-    public void setVlanId(long _vlanId) {
-        this._vlanId = _vlanId;
+    public void setVlanId(long vlanId) {
+        this._vlanId = vlanId;
     }
 
     public String getIpAddress() {
         return _ipAddress;
     }
 
-    public void setIpAddress(String _ipAddress) {
-        this._ipAddress = _ipAddress;
+    public void setIpAddress(String ipAddress) {
+        this._ipAddress = ipAddress;
     }
 
     public String getVsmUsername() {
         return _vsmUsername;
     }
 
-    public void setVsmUsername(String _vsmUsername) {
-        this._vsmUsername = _vsmUsername;
+    public void setVsmUsername(String vsmUsername) {
+        this._vsmUsername = vsmUsername;
     }
 
     public String getVsmPassword() {
         return _vsmPassword;
     }
 
-    public void setVsmPassword(String _vsmPassword) {
-        this._vsmPassword = _vsmPassword;
+    public void setVsmPassword(String vsmPassword) {
+        this._vsmPassword = vsmPassword;
     }
 
     public String getVsmIp() {
         return _vsmIp;
     }
 
-    public void setVsmIp(String _vsmIp) {
-        this._vsmIp = _vsmIp;
+    public void setVsmIp(String vsmIp) {
+        this._vsmIp = vsmIp;
     }
 
     public String getAsaInPortProfile() {
         return _asaInPortProfile;
     }
 
-    public void setAsaInPortProfile(String _asaInPortProfile) {
-        this._asaInPortProfile = _asaInPortProfile;
+    public void setAsaInPortProfile(String asaInPortProfile) {
+        this._asaInPortProfile = asaInPortProfile;
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/CreateLogicalEdgeFirewallCommand.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/CreateLogicalEdgeFirewallCommand.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/CreateLogicalEdgeFirewallCommand.java
index 166323d..89e411b 100755
--- a/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/CreateLogicalEdgeFirewallCommand.java
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/agent/api/CreateLogicalEdgeFirewallCommand.java
@@ -27,7 +27,7 @@ public class CreateLogicalEdgeFirewallCommand extends Command {
     private String _publicIp;
     private String _internalIp;
     private String _publicSubnet;
-    private String _internalSubnet;
+    private String internalSubnet;
     private List<String> _publicGateways;
 
     public CreateLogicalEdgeFirewallCommand(long vlanId, String publicIp, String internalIp, String publicSubnet, String internalSubnet) {
@@ -78,11 +78,11 @@ public class CreateLogicalEdgeFirewallCommand extends Command {
     }
 
     public String getInternalSubnet() {
-        return _internalSubnet;
+        return internalSubnet;
     }
 
-    public void setInternalSubnet(String _internalSubnet) {
-        this._internalSubnet = _internalSubnet;
+    public void setInternalSubnet(String internalSubnet) {
+        this.internalSubnet = internalSubnet;
     }
 
     public List<String> getPublicGateways() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcConnectionImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcConnectionImpl.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcConnectionImpl.java
index abdf00e..cb34b72 100644
--- a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcConnectionImpl.java
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/cisco/CiscoVnmcConnectionImpl.java
@@ -41,12 +41,12 @@ import com.cloud.utils.script.Script;
 
 public class CiscoVnmcConnectionImpl implements CiscoVnmcConnection {
 
-    private String _ip;
-    private String _username;
-    private String _password;
+    private final String _ip;
+    private final String _username;
+    private final String _password;
     private String _cookie;
 
-    private final Logger s_logger = Logger.getLogger(CiscoVnmcConnectionImpl.class);
+    private static final Logger s_logger = Logger.getLogger(CiscoVnmcConnectionImpl.class);
 
     private enum VnmcXml {
         LOGIN("login.xml", "mgmt-controller"),
@@ -108,13 +108,12 @@ public class CiscoVnmcConnectionImpl implements CiscoVnmcConnection {
         ASSIGN_ASA1000V("assoc-asa1000v.xml", "resource-mgr"),
         UNASSIGN_ASA1000V("disassoc-asa1000v.xml", "resource-mgr");
 
-        private String scriptsDir = "scripts/network/cisco";
+        private final String scriptsDir = "scripts/network/cisco";
         private String xml;
         private String service;
-        private final Logger s_logger = Logger.getLogger(CiscoVnmcConnectionImpl.class);
 
         private VnmcXml(String filename, String service) {
-            this.xml = getXml(filename);
+            xml = getXml(filename);
             this.service = service;
         }
 
@@ -153,9 +152,9 @@ public class CiscoVnmcConnectionImpl implements CiscoVnmcConnection {
     }
 
     public CiscoVnmcConnectionImpl(String hostIp, String userName, String password) {
-        this._ip = hostIp;
-        this._username = userName;
-        this._password = password;
+        _ip = hostIp;
+        _username = userName;
+        _password = password;
 
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElementService.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElementService.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElementService.java
index 12f3ea5..8388bb8 100644
--- a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElementService.java
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/element/CiscoVnmcElementService.java
@@ -32,7 +32,7 @@ public interface CiscoVnmcElementService extends PluggableService {
 
     public CiscoVnmcController addCiscoVnmcResource(AddCiscoVnmcResourceCmd cmd);
 
-    public CiscoVnmcResourceResponse createCiscoVnmcResourceResponse(CiscoVnmcController CiscoVnmcResourceVO);
+    public CiscoVnmcResourceResponse createCiscoVnmcResourceResponse(CiscoVnmcController ciscoVnmcResourceVO);
 
     boolean deleteCiscoVnmcResource(DeleteCiscoVnmcResourceCmd cmd);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/cisco-vnmc/src/com/cloud/network/resource/CiscoVnmcResource.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/resource/CiscoVnmcResource.java b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/resource/CiscoVnmcResource.java
index aad9c90..ed75871 100644
--- a/plugins/network-elements/cisco-vnmc/src/com/cloud/network/resource/CiscoVnmcResource.java
+++ b/plugins/network-elements/cisco-vnmc/src/com/cloud/network/resource/CiscoVnmcResource.java
@@ -78,10 +78,10 @@ public class CiscoVnmcResource implements ServerResource {
     private CiscoVnmcConnectionImpl _connection;
 
     public void setConnection(CiscoVnmcConnectionImpl connection) {
-        this._connection = connection;
+        _connection = connection;
     }
 
-    private final Logger s_logger = Logger.getLogger(CiscoVnmcResource.class);
+    private static final Logger s_logger = Logger.getLogger(CiscoVnmcResource.class);
 
     @Override
     public Answer executeRequest(Command cmd) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
index 1533330..56900fe 100644
--- a/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
+++ b/plugins/network-elements/elastic-loadbalancer/src/com/cloud/network/lb/ElasticLoadBalancerManagerImpl.java
@@ -205,8 +205,8 @@ public class ElasticLoadBalancerManagerImpl extends ManagerBase implements Elast
     NicDao _nicDao;
 
     String _instance;
-    static final private String _elbVmNamePrefix = "l";
-    static final private String _systemVmType = "elbvm";
+    static final private String ElbVmNamePrefix = "l";
+    static final private String SystemVmType = "elbvm";
 
     boolean _enabled;
     TrafficType _frontendTrafficType = TrafficType.Guest;
@@ -496,7 +496,7 @@ public class ElasticLoadBalancerManagerImpl extends ManagerBase implements Elast
                 }
 
                 elbVm =
-                    new DomainRouterVO(id, _elasticLbVmOffering.getId(), vrProvider.getId(), VirtualMachineName.getSystemVmName(id, _instance, _elbVmNamePrefix),
+                    new DomainRouterVO(id, _elasticLbVmOffering.getId(), vrProvider.getId(), VirtualMachineName.getSystemVmName(id, _instance, ElbVmNamePrefix),
                         template.getId(), template.getHypervisorType(), template.getGuestOSId(), owner.getDomainId(), owner.getId(), false, 0, false,
                         RedundantState.UNKNOWN, _elasticLbVmOffering.getOfferHA(), false, VirtualMachine.Type.ElasticLoadBalancerVm, null);
                 elbVm.setRole(Role.LB);
@@ -779,7 +779,7 @@ public class ElasticLoadBalancerManagerImpl extends ManagerBase implements Elast
         DataCenter dc = dest.getDataCenter();
 
         StringBuilder buf = profile.getBootArgsBuilder();
-        buf.append(" template=domP type=" + _systemVmType);
+        buf.append(" template=domP type=" + SystemVmType);
         buf.append(" name=").append(profile.getHostName());
         NicProfile controlNic = null;
         String defaultDns1 = null;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java b/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java
index 1a591e1..1cd6851 100644
--- a/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java
+++ b/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java
@@ -322,7 +322,7 @@ public class F5ExternalLoadBalancerElement extends ExternalLoadBalancerDeviceMan
 
         String deviceType = NetworkDevice.F5BigIpLoadBalancer.getName();
         lbDeviceVO = addExternalLoadBalancer(pNetwork.getId(), cmd.getUrl(), cmd.getUsername(), cmd.getPassword(),
-                deviceType, new F5BigIpResource(), false, false, null, null);
+            deviceType, new F5BigIpResource(), false, false, null, null);
 
         if (lbDeviceVO != null) {
             lbHost = _hostDao.findById(lbDeviceVO.getHostId());
@@ -376,7 +376,7 @@ public class F5ExternalLoadBalancerElement extends ExternalLoadBalancerDeviceMan
         }
 
         return addExternalLoadBalancer(cmd.getPhysicalNetworkId(), cmd.getUrl(), cmd.getUsername(), cmd.getPassword(),
-                deviceName, new F5BigIpResource(), false, false, null,
+            deviceName, new F5BigIpResource(), false, false, null,
             null);
 
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
index 4ceb810..b2030a9 100644
--- a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
+++ b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java
@@ -118,7 +118,7 @@ import com.cloud.vm.dao.NicDao;
 @Local(value = {InternalLoadBalancerVMManager.class, InternalLoadBalancerVMService.class})
 public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements InternalLoadBalancerVMManager, InternalLoadBalancerVMService, VirtualMachineGuru {
     private static final Logger s_logger = Logger.getLogger(InternalLoadBalancerVMManagerImpl.class);
-    static final private String _internalLbVmNamePrefix = "b";
+    static final private String InternalLbVmNamePrefix = "b";
 
     private String _instance;
     private String _mgmtHost;
@@ -759,7 +759,7 @@ public class InternalLoadBalancerVMManagerImpl extends ManagerBase implements In
                 }
 
                 internalLbVm =
-                    new DomainRouterVO(id, routerOffering.getId(), internalLbProviderId, VirtualMachineName.getSystemVmName(id, _instance, _internalLbVmNamePrefix),
+                    new DomainRouterVO(id, routerOffering.getId(), internalLbProviderId, VirtualMachineName.getSystemVmName(id, _instance, InternalLbVmNamePrefix),
                         template.getId(), template.getHypervisorType(), template.getGuestOSId(), owner.getDomainId(), owner.getId(), false, 0, false,
                         RedundantState.UNKNOWN, false, false, VirtualMachine.Type.InternalLoadBalancerVm, vpcId);
                 internalLbVm.setRole(Role.INTERNAL_LB_VM);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailElementImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailElementImpl.java b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailElementImpl.java
index e6a0696..5adbacd 100644
--- a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailElementImpl.java
+++ b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailElementImpl.java
@@ -65,7 +65,7 @@ import com.cloud.vm.dao.NicDao;
 @Local(value = {ContrailElement.class, StaticNatServiceProvider.class})
 public class ContrailElementImpl extends AdapterBase implements ContrailElement, IpDeployer, StaticNatServiceProvider {
 
-    private static final Map<Service, Map<Capability, String>> _capabilities = InitCapabilities();
+    private final Map<Service, Map<Capability, String>> _capabilities = InitCapabilities();
 
     @Inject
     ContrailManager _manager;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailGuru.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailGuru.java b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailGuru.java
index ea52be9..079035b 100644
--- a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailGuru.java
+++ b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailGuru.java
@@ -70,7 +70,7 @@ public class ContrailGuru extends AdapterBase implements NetworkGuru {
     NicDao _nicDao;
 
     private static final Logger s_logger = Logger.getLogger(ContrailGuru.class);
-    private static final TrafficType[] _trafficTypes = {TrafficType.Guest};
+    private static final TrafficType[] TrafficTypes = {TrafficType.Guest};
 
     private boolean canHandle(NetworkOffering offering) {
         return (offering.getName().equals(ContrailManager.offeringName));
@@ -303,12 +303,12 @@ public class ContrailGuru extends AdapterBase implements NetworkGuru {
 
     @Override
     public TrafficType[] getSupportedTrafficType() {
-        return _trafficTypes;
+        return TrafficTypes;
     }
 
     @Override
     public boolean isMyTrafficType(TrafficType type) {
-        for (TrafficType t : _trafficTypes) {
+        for (TrafficType t : TrafficTypes) {
             if (t == type) {
                 return true;
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailManager.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailManager.java b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailManager.java
index 98b02b8..335299e 100644
--- a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailManager.java
+++ b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailManager.java
@@ -61,7 +61,7 @@ public interface ContrailManager {
 
     public void findInfrastructureNetworks(PhysicalNetworkVO phys, List<NetworkVO> dbList);
 
-    public String getPhysicalNetworkName(PhysicalNetworkVO phys_net);
+    public String getPhysicalNetworkName(PhysicalNetworkVO physNet);
 
     public String getCanonicalName(Network net);
 
@@ -93,9 +93,9 @@ public interface ContrailManager {
 
     public boolean isSystemDefaultNetwork(NetworkVO dbNet);
 
-    public String getVifNameByVmName(String vm_name, Integer device_id);
+    public String getVifNameByVmName(String vmName, Integer deviceId);
 
-    public String getVifNameByVmUuid(String vm_uuid, Integer device_id);
+    public String getVifNameByVmUuid(String vmUuid, Integer deviceId);
 
     public ApiConnector getApiConnector();
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailManagerImpl.java b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailManagerImpl.java
index abf2dd0..ed58594 100644
--- a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailManagerImpl.java
+++ b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ContrailManagerImpl.java
@@ -248,8 +248,8 @@ public class ContrailManagerImpl extends ManagerBase implements ContrailManager
     }
 
     @Override
-    public String getPhysicalNetworkName(PhysicalNetworkVO phys_net) {
-        String physname = phys_net.getName();
+    public String getPhysicalNetworkName(PhysicalNetworkVO physNet) {
+        String physname = physNet.getName();
         physname = physname.replaceAll("\\s", "").replace("_", "");
         return physname;
     }
@@ -358,7 +358,7 @@ public class ContrailManagerImpl extends ManagerBase implements ContrailManager
         final TrafficType[] ttypes = {TrafficType.Control,    // maps to __link_local__
             TrafficType.Management, // maps to ip-fabric
             TrafficType.Public, TrafficType.Storage        // maps to ip-fabric
-            };
+        };
 
         for (int i = 0; i < ttypes.length; i++) {
             List<NetworkVO> phys_nets;
@@ -619,16 +619,16 @@ public class ContrailManagerImpl extends ManagerBase implements ContrailManager
     }
 
     @Override
-    public String getVifNameByVmName(String vm_name, Integer device_id) {
-        String vif_name = vm_name + "-" + device_id.toString();
+    public String getVifNameByVmName(String vmName, Integer deviceId) {
+        String vif_name = vmName + "-" + deviceId.toString();
         return vif_name;
     }
 
     @Override
-    public String getVifNameByVmUuid(String vm_uuid, Integer device_id) {
-        VMInstanceVO vm = _vmInstanceDao.findByUuid(vm_uuid);
+    public String getVifNameByVmUuid(String vmUuid, Integer deviceId) {
+        VMInstanceVO vm = _vmInstanceDao.findByUuid(vmUuid);
         if (vm != null) {
-            return vm.getInstanceName() + "-" + device_id.toString();
+            return vm.getInstanceName() + "-" + deviceId.toString();
         }
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/EventUtils.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/EventUtils.java b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/EventUtils.java
index a06b0b3..29b58fb 100644
--- a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/EventUtils.java
+++ b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/EventUtils.java
@@ -33,7 +33,6 @@ import com.cloud.event.ActionEvent;
 import com.cloud.event.Event;
 import com.cloud.event.EventCategory;
 import com.cloud.event.EventTypes;
-import com.cloud.server.ManagementServer;
 import com.cloud.server.ManagementService;
 import com.cloud.utils.component.ComponentContext;
 import com.cloud.utils.component.ComponentMethodInterceptor;
@@ -42,7 +41,7 @@ import com.cloud.utils.component.ComponentMethodInterceptor;
 public class EventUtils {
     private static final Logger s_logger = Logger.getLogger(EventUtils.class);
 
-    protected static MessageBus _messageBus = null;
+    protected static MessageBus s_messageBus = null;
 
     public EventUtils() {
     }
@@ -54,7 +53,7 @@ public class EventUtils {
         }
 
         try {
-            _messageBus = ComponentContext.getComponent(MessageBusBase.class);
+            s_messageBus = ComponentContext.getComponent(MessageBusBase.class);
         } catch (NoSuchBeanDefinitionException nbe) {
             return; // no provider is configured to provide events bus, so just return
         }
@@ -68,7 +67,7 @@ public class EventUtils {
         eventDescription.put("details", details);
         event.setDescription(eventDescription);
         try {
-            _messageBus.publish(EventTypes.getEntityForEvent(eventType), eventType, null, event);
+            s_messageBus.publish(EventTypes.getEntityForEvent(eventType), eventType, null, event);
         } catch (Exception e) {
             s_logger.warn("Failed to publish action event on the the event bus.");
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ManagementNetworkGuru.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ManagementNetworkGuru.java b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ManagementNetworkGuru.java
index d3d9366..cfc6fb6 100644
--- a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ManagementNetworkGuru.java
+++ b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ManagementNetworkGuru.java
@@ -48,11 +48,11 @@ import com.cloud.utils.PropertiesUtil;
 @Component
 public class ManagementNetworkGuru extends ContrailGuru {
     private static final Logger s_logger = Logger.getLogger(ManagementNetworkGuru.class);
-    private static final TrafficType[] _trafficTypes = {TrafficType.Management};
+    private static final TrafficType[] TrafficTypes = {TrafficType.Management};
 
     private final String configuration = "contrail.properties";
-    private String _mgmt_cidr;
-    private String _mgmt_gateway;
+    private String _mgmtCidr;
+    private String _mgmtGateway;
 
     @Override
     public String getName() {
@@ -86,20 +86,20 @@ public class ManagementNetworkGuru extends ContrailGuru {
             } catch (IOException e) {
             }
         }
-        _mgmt_cidr = configProps.getProperty("management.cidr");
-        _mgmt_gateway = configProps.getProperty("management.gateway");
-        s_logger.info("Management network " + _mgmt_cidr + " gateway: " + _mgmt_gateway);
+        _mgmtCidr = configProps.getProperty("management.cidr");
+        _mgmtGateway = configProps.getProperty("management.gateway");
+        s_logger.info("Management network " + _mgmtCidr + " gateway: " + _mgmtGateway);
         return true;
     }
 
     @Override
     public TrafficType[] getSupportedTrafficType() {
-        return _trafficTypes;
+        return TrafficTypes;
     }
 
     @Override
     public boolean isMyTrafficType(TrafficType type) {
-        for (TrafficType t : _trafficTypes) {
+        for (TrafficType t : TrafficTypes) {
             if (t == type) {
                 return true;
             }
@@ -119,11 +119,11 @@ public class ManagementNetworkGuru extends ContrailGuru {
             return null;
         }
         NetworkVO network =
-                new NetworkVO(offering.getTrafficType(), Mode.Dhcp, BroadcastDomainType.Lswitch, offering.getId(), Network.State.Allocated, plan.getDataCenterId(),
-                        plan.getPhysicalNetworkId());
-        if (_mgmt_cidr != null) {
-            network.setCidr(_mgmt_cidr);
-            network.setGateway(_mgmt_gateway);
+            new NetworkVO(offering.getTrafficType(), Mode.Dhcp, BroadcastDomainType.Lswitch, offering.getId(), Network.State.Allocated, plan.getDataCenterId(),
+                plan.getPhysicalNetworkId());
+        if (_mgmtCidr != null) {
+            network.setCidr(_mgmtCidr);
+            network.setGateway(_mgmtGateway);
         }
         s_logger.debug("Allocated network " + userSpecified.getName() + (network.getCidr() == null ? "" : " subnet: " + network.getCidr()));
         return network;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServerDBSyncImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServerDBSyncImpl.java b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServerDBSyncImpl.java
index 22543dd..52fe31e 100644
--- a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServerDBSyncImpl.java
+++ b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServerDBSyncImpl.java
@@ -93,7 +93,7 @@ public class ServerDBSyncImpl implements ServerDBSync {
     DBSyncGeneric _dbSync;
     Class<?>[] _vncClasses;
     // Read-Write (true) or Read-Only mode.
-    boolean _rw_mode;
+    boolean _rwMode;
     private final ReentrantLock _lockSyncMode = new ReentrantLock();
 
     ServerDBSyncImpl() {
@@ -122,7 +122,7 @@ public class ServerDBSyncImpl implements ServerDBSync {
 
                 /* lock the sync mode*/
                 _lockSyncMode.lock();
-                _rw_mode = syncMode == DBSyncGeneric.SYNC_MODE_UPDATE;
+                _rwMode = syncMode == DBSyncGeneric.SYNC_MODE_UPDATE;
                 _dbSync.setSyncMode(syncMode);
 
                 if (_dbSync.getSyncMode() == DBSyncGeneric.SYNC_MODE_CHECK) {
@@ -501,7 +501,7 @@ public class ServerDBSyncImpl implements ServerDBSync {
         VirtualNetworkModel vnModel = new VirtualNetworkModel(dbNet, dbNet.getUuid(), _manager.getCanonicalName(dbNet), dbNet.getTrafficType());
         vnModel.build(_manager.getModelController(), dbNet);
 
-        if (_rw_mode) {
+        if (_rwMode) {
             try {
                 if (!vnModel.verify(_manager.getModelController())) {
                     vnModel.update(_manager.getModelController());
@@ -571,7 +571,7 @@ public class ServerDBSyncImpl implements ServerDBSync {
         VirtualNetworkModel vnModel = new VirtualNetworkModel(dbn, vnet.getUuid(), _manager.getCanonicalName(dbn), dbn.getTrafficType());
         vnModel.build(_manager.getModelController(), dbn);
 
-        if (_rw_mode) {
+        if (_rwMode) {
             if (current != null) {
                 FloatingIpPoolModel fipPoolModel = current.getFipPoolModel();
                 if (fipPoolModel != null) {
@@ -643,7 +643,7 @@ public class ServerDBSyncImpl implements ServerDBSync {
         vmModel.build(_manager.getModelController(), dbVm);
         buildNicResources(vmModel, dbVm, syncLogMesg);
 
-        if (_rw_mode) {
+        if (_rwMode) {
             try {
                 vmModel.update(_manager.getModelController());
             } catch (InternalErrorException ex) {
@@ -695,7 +695,7 @@ public class ServerDBSyncImpl implements ServerDBSync {
     public void deleteVirtualMachine(VirtualMachine vncVm, StringBuffer syncLogMesg) {
         final ApiConnector api = _manager.getApiConnector();
         syncLogMesg.append("VM# DB:none; VNC: " + vncVm.getName() + "/" + vncVm.getUuid() + "; action: delete\n");
-        if (!_rw_mode) {
+        if (!_rwMode) {
             return;
         }
         try {
@@ -758,7 +758,7 @@ public class ServerDBSyncImpl implements ServerDBSync {
         }
 
         VirtualMachineModel current = _manager.getDatabase().lookupVirtualMachine(vncVm.getUuid());
-        if (_rw_mode) {
+        if (_rwMode) {
             if (current != null) {
                 _manager.getDatabase().getVirtualMachines().remove(current);
             }
@@ -903,7 +903,7 @@ public class ServerDBSyncImpl implements ServerDBSync {
     public void deleteServiceInstance(ServiceInstance siObj, StringBuffer logMsg) {
         final ApiConnector api = _manager.getApiConnector();
         s_logger.debug("delete " + siObj.getQualifiedName());
-        if (!_rw_mode) {
+        if (!_rwMode) {
             return;
         }
         try {
@@ -946,7 +946,7 @@ public class ServerDBSyncImpl implements ServerDBSync {
             List<ServiceInstance> siList = (List<ServiceInstance>)api.list(ServiceInstance.class, null);
             java.util.Collections.sort(siList, new ServiceInstanceComparator());
             DBSyncGeneric.SyncStats stats = new DBSyncGeneric.SyncStats();
-            _dbSync.syncCollections(ServiceInstance.class, _manager.getDatabase().getServiceInstances(), siList, _rw_mode, stats);
+            _dbSync.syncCollections(ServiceInstance.class, _manager.getDatabase().getServiceInstances(), siList, _rwMode, stats);
             inSync = stats.create == 0 && stats.delete == 0;
         } catch (Exception ex) {
             s_logger.warn("synchronize service-instances", ex);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServiceManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServiceManagerImpl.java b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServiceManagerImpl.java
index e15e2ce..98be288 100644
--- a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServiceManagerImpl.java
+++ b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServiceManagerImpl.java
@@ -96,7 +96,7 @@ public class ServiceManagerImpl implements ServiceManager {
      */
     @ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "createServiceInstance", create = true)
     private ServiceVirtualMachine createServiceVM(DataCenter zone, Account owner, VirtualMachineTemplate template, ServiceOffering serviceOffering, String name,
-            ServiceInstance siObj, Network left, Network right) {
+        ServiceInstance siObj, Network left, Network right) {
         long id = _vmDao.getNextInSequence(Long.class, "id");
 
         DataCenterDeployment plan = new DataCenterDeployment(zone.getId());
@@ -109,8 +109,8 @@ public class ServiceManagerImpl implements ServiceManager {
 
         String instanceName = VirtualMachineName.getVmName(id, owner.getId(), "SRV");
         ServiceVirtualMachine svm =
-                new ServiceVirtualMachine(id, instanceName, name, template.getId(), serviceOffering.getId(), template.getHypervisorType(), template.getGuestOSId(),
-                        zone.getId(), owner.getDomainId(), owner.getAccountId(), false);
+            new ServiceVirtualMachine(id, instanceName, name, template.getId(), serviceOffering.getId(), template.getHypervisorType(), template.getGuestOSId(),
+                zone.getId(), owner.getDomainId(), owner.getAccountId(), false);
 
         // database synchronization code must be able to distinguish service instance VMs.
         Map<String, String> kvmap = new HashMap<String, String>();
@@ -130,7 +130,7 @@ public class ServiceManagerImpl implements ServiceManager {
 
     @Override
     public ServiceVirtualMachine createServiceInstance(DataCenter zone, Account owner, VirtualMachineTemplate template, ServiceOffering serviceOffering, String name,
-            Network left, Network right) {
+        Network left, Network right) {
         s_logger.debug("createServiceInstance by " + owner.getAccountName());
         // TODO: permission model.
         // service instances need to be able to access the public network.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/ServiceInstanceModel.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/ServiceInstanceModel.java b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/ServiceInstanceModel.java
index d066423..a9bc5c1 100644
--- a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/ServiceInstanceModel.java
+++ b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/ServiceInstanceModel.java
@@ -47,7 +47,7 @@ public class ServiceInstanceModel extends ModelObjectBase {
     private static final Logger s_logger = Logger.getLogger(ServiceInstanceModel.class);
 
     private String _uuid;
-    private String _fq_name;
+    private String _fqName;
     private String _projectId;
     private String _mgmtName;
     private String _leftName;
@@ -79,7 +79,7 @@ public class ServiceInstanceModel extends ModelObjectBase {
         } else {
             parent_name = ContrailManager.VNC_ROOT_DOMAIN + ":" + ContrailManager.VNC_DEFAULT_PROJECT;
         }
-        _fq_name = parent_name + ":" + name;
+        _fqName = parent_name + ":" + name;
 
         _mgmtName = ContrailManager.VNC_ROOT_DOMAIN + ":" + ContrailManager.VNC_DEFAULT_PROJECT + ":" + ContrailManager.managementNetworkName;
         _left = left;
@@ -103,11 +103,11 @@ public class ServiceInstanceModel extends ModelObjectBase {
     }
 
     public String getQualifiedName() {
-        return _fq_name;
+        return _fqName;
     }
 
     public String getName() {
-        return _fq_name.substring(_fq_name.lastIndexOf(':') + 1);
+        return _fqName.substring(_fqName.lastIndexOf(':') + 1);
     }
 
     private void applyNetworkPolicy(ModelController controller, NetworkPolicy policy, VirtualNetwork left, VirtualNetwork right) {
@@ -139,7 +139,7 @@ public class ServiceInstanceModel extends ModelObjectBase {
     public void build(ModelController controller, ServiceInstance siObj) {
         ApiConnector api = controller.getApiAccessor();
         _serviceInstance = siObj;
-        _fq_name = StringUtils.join(siObj.getQualifiedName(), ':');
+        _fqName = StringUtils.join(siObj.getQualifiedName(), ':');
         ServiceInstanceType props = siObj.getProperties();
         // TODO: read management network names and cache network objects.
         ObjectReference ref = siObj.getServiceTemplate().get(0);
@@ -174,7 +174,7 @@ public class ServiceInstanceModel extends ModelObjectBase {
             String clsname = o.getClass().getName();
             return ServiceInstanceModel.class.getName().compareTo(clsname);
         }
-        return _fq_name.compareTo(other._fq_name);
+        return _fqName.compareTo(other._fqName);
     }
 
     private ServiceInstance createServiceInstance(ModelController controller) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/VirtualMachineModel.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/VirtualMachineModel.java b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/VirtualMachineModel.java
index 96cea95..f571f89 100644
--- a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/VirtualMachineModel.java
+++ b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/model/VirtualMachineModel.java
@@ -199,21 +199,21 @@ public class VirtualMachineModel extends ModelObjectBase {
 
     boolean isActiveInstance(VMInstanceVO instance) {
         switch (instance.getState()) {
-        case Migrating:
-        case Starting:
-        case Running:
-        case Shutdowned:
-        case Stopped:
-        case Stopping:
-            return true;
-
-        case Destroyed:
-        case Error:
-        case Expunging:
-            return false;
-
-        default:
-            s_logger.warn("Unknown VMInstance state " + instance.getState().getDescription());
+            case Migrating:
+            case Starting:
+            case Running:
+            case Shutdowned:
+            case Stopped:
+            case Stopping:
+                return true;
+
+            case Destroyed:
+            case Error:
+            case Expunging:
+                return false;
+
+            default:
+                s_logger.warn("Unknown VMInstance state " + instance.getState().getDescription());
         }
         return true;
     }
@@ -257,17 +257,17 @@ public class VirtualMachineModel extends ModelObjectBase {
             String tag;
 
             switch (nic.getDeviceId()) {
-            case 0:
-                tag = "management";
-                break;
-            case 1:
-                tag = "left";
-                break;
-            case 2:
-                tag = "right";
-                break;
-            default:
-                tag = null;
+                case 0:
+                    tag = "management";
+                    break;
+                case 1:
+                    tag = "left";
+                    break;
+                case 2:
+                    tag = "right";
+                    break;
+                default:
+                    tag = null;
             }
 
             VMInterfaceModel vmiModel = getVMInterface(nic.getUuid());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/management/IntegrationTestConfiguration.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/management/IntegrationTestConfiguration.java b/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/management/IntegrationTestConfiguration.java
index 8b14a42..2a2babc 100644
--- a/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/management/IntegrationTestConfiguration.java
+++ b/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/management/IntegrationTestConfiguration.java
@@ -255,11 +255,9 @@ import com.cloud.template.TemplateApiService;
 import com.cloud.template.TemplateManager;
 import com.cloud.user.Account;
 import com.cloud.user.AccountDetailsDaoImpl;
-import com.cloud.user.AccountVO;
 import com.cloud.user.DomainManagerImpl;
 import com.cloud.user.ResourceLimitService;
 import com.cloud.user.User;
-import com.cloud.user.UserVO;
 import com.cloud.user.dao.AccountDao;
 import com.cloud.user.dao.AccountDaoImpl;
 import com.cloud.user.dao.SSHKeyPairDaoImpl;


Mime
View raw message