cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [23/48] All Checkstyle problems corrected
Date Thu, 12 Dec 2013 21:01:23 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/orchestration/src/com/cloud/vm/VmWorkJobDispatcher.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VmWorkJobDispatcher.java b/engine/orchestration/src/com/cloud/vm/VmWorkJobDispatcher.java
index 7c36d8c..7534363 100644
--- a/engine/orchestration/src/com/cloud/vm/VmWorkJobDispatcher.java
+++ b/engine/orchestration/src/com/cloud/vm/VmWorkJobDispatcher.java
@@ -35,118 +35,121 @@ public class VmWorkJobDispatcher extends AdapterBase implements AsyncJobDispatch
     public static final String VM_WORK_QUEUE = "VmWorkJobQueue";
     public static final String VM_WORK_JOB_DISPATCHER = "VmWorkJobDispatcher";
     public static final String VM_WORK_JOB_WAKEUP_DISPATCHER = "VmWorkJobWakeupDispatcher";
-    
-    @Inject private VirtualMachineManagerImpl _vmMgr;
-	@Inject private AsyncJobManager _asyncJobMgr;
-    @Inject private VMInstanceDao _instanceDao;
-    
-	@Override
+
+    @Inject
+    private VirtualMachineManagerImpl _vmMgr;
+    @Inject
+    private AsyncJobManager _asyncJobMgr;
+    @Inject
+    private VMInstanceDao _instanceDao;
+
+    @Override
     public void runJob(AsyncJob job) {
         VmWork work = null;
         try {
-        	String cmd = job.getCmd();
-        	assert(cmd != null);
-        	
-        	if(s_logger.isDebugEnabled())
-        		s_logger.debug("Run VM work job: " + cmd);
-        	
-        	Class<?> workClz = null;
-        	try {
-        		workClz = Class.forName(job.getCmd());
-        	} catch(ClassNotFoundException e) {
-        		s_logger.error("VM work class " + cmd + " is not found", e);
+            String cmd = job.getCmd();
+            assert (cmd != null);
+
+            if (s_logger.isDebugEnabled())
+                s_logger.debug("Run VM work job: " + cmd);
+
+            Class<?> workClz = null;
+            try {
+                workClz = Class.forName(job.getCmd());
+            } catch (ClassNotFoundException e) {
+                s_logger.error("VM work class " + cmd + " is not found", e);
                 _asyncJobMgr.completeAsyncJob(job.getId(), JobInfo.Status.FAILED, 0, e.getMessage());
-        		return;
-        	}
-        	
-        	work = VmWorkSerializer.deserialize(workClz, job.getCmdInfo());
-            assert(work != null);
-            if(work == null) {
-            	s_logger.error("Unable to deserialize VM work " + job.getCmd() + ", job info: " + job.getCmdInfo());
+                return;
+            }
+
+            work = VmWorkSerializer.deserialize(workClz, job.getCmdInfo());
+            assert (work != null);
+            if (work == null) {
+                s_logger.error("Unable to deserialize VM work " + job.getCmd() + ", job info: " + job.getCmdInfo());
                 _asyncJobMgr.completeAsyncJob(job.getId(), JobInfo.Status.FAILED, 0, "Unable to deserialize VM work");
-        		return;
+                return;
             }
-            
+
             CallContext.register(work.getUserId(), work.getAccountId(), job.getRelated());
 
             VMInstanceVO vm = _instanceDao.findById(work.getVmId());
             if (vm == null) {
                 s_logger.info("Unable to find vm " + work.getVmId());
             }
-            assert(vm != null);
-            if(work instanceof VmWorkStart) {
-            	VmWorkStart workStart = (VmWorkStart)work;
-            	_vmMgr.orchestrateStart(vm.getUuid(), workStart.getParams(), workStart.getPlan());
+            assert (vm != null);
+            if (work instanceof VmWorkStart) {
+                VmWorkStart workStart = (VmWorkStart)work;
+                _vmMgr.orchestrateStart(vm.getUuid(), workStart.getParams(), workStart.getPlan());
                 _asyncJobMgr.completeAsyncJob(job.getId(), JobInfo.Status.SUCCEEDED, 0, null);
-            } else if(work instanceof VmWorkStop) {
-            	VmWorkStop workStop = (VmWorkStop)work;
-            	_vmMgr.orchestrateStop(vm.getUuid(), workStop.isCleanup());
+            } else if (work instanceof VmWorkStop) {
+                VmWorkStop workStop = (VmWorkStop)work;
+                _vmMgr.orchestrateStop(vm.getUuid(), workStop.isCleanup());
                 _asyncJobMgr.completeAsyncJob(job.getId(), JobInfo.Status.SUCCEEDED, 0, null);
-            } else if(work instanceof VmWorkMigrate) {
-            	VmWorkMigrate workMigrate = (VmWorkMigrate)work;
-            	_vmMgr.orchestrateMigrate(vm.getUuid(), workMigrate.getSrcHostId(), workMigrate.getDeployDestination());
+            } else if (work instanceof VmWorkMigrate) {
+                VmWorkMigrate workMigrate = (VmWorkMigrate)work;
+                _vmMgr.orchestrateMigrate(vm.getUuid(), workMigrate.getSrcHostId(), workMigrate.getDeployDestination());
                 _asyncJobMgr.completeAsyncJob(job.getId(), JobInfo.Status.SUCCEEDED, 0, null);
-            } else if(work instanceof VmWorkMigrateWithStorage) {
-            	VmWorkMigrateWithStorage workMigrateWithStorage = (VmWorkMigrateWithStorage)work;
-            	_vmMgr.orchestrateMigrateWithStorage(vm.getUuid(), 
-            		workMigrateWithStorage.getSrcHostId(), 
-            		workMigrateWithStorage.getDestHostId(), 
-            		workMigrateWithStorage.getVolumeToPool());
+            } else if (work instanceof VmWorkMigrateWithStorage) {
+                VmWorkMigrateWithStorage workMigrateWithStorage = (VmWorkMigrateWithStorage)work;
+                _vmMgr.orchestrateMigrateWithStorage(vm.getUuid(),
+                    workMigrateWithStorage.getSrcHostId(),
+                    workMigrateWithStorage.getDestHostId(),
+                    workMigrateWithStorage.getVolumeToPool());
                 _asyncJobMgr.completeAsyncJob(job.getId(), JobInfo.Status.SUCCEEDED, 0, null);
-            } else if(work instanceof VmWorkMigrateForScale) { 
-            	VmWorkMigrateForScale workMigrateForScale = (VmWorkMigrateForScale)work;
-            	_vmMgr.orchestrateMigrateForScale(vm.getUuid(), 
-            		workMigrateForScale.getSrcHostId(), 
-            		workMigrateForScale.getDeployDestination(), 
-            		workMigrateForScale.getNewServiceOfferringId());
+            } else if (work instanceof VmWorkMigrateForScale) {
+                VmWorkMigrateForScale workMigrateForScale = (VmWorkMigrateForScale)work;
+                _vmMgr.orchestrateMigrateForScale(vm.getUuid(),
+                    workMigrateForScale.getSrcHostId(),
+                    workMigrateForScale.getDeployDestination(),
+                    workMigrateForScale.getNewServiceOfferringId());
                 _asyncJobMgr.completeAsyncJob(job.getId(), JobInfo.Status.SUCCEEDED, 0, null);
-            } else if(work instanceof VmWorkReboot) { 
+            } else if (work instanceof VmWorkReboot) {
                 VmWorkReboot workReboot = (VmWorkReboot)work;
                 _vmMgr.orchestrateReboot(vm.getUuid(), workReboot.getParams());
                 _asyncJobMgr.completeAsyncJob(job.getId(), JobInfo.Status.SUCCEEDED, 0, null);
-            } else if(work instanceof VmWorkAddVmToNetwork) { 
+            } else if (work instanceof VmWorkAddVmToNetwork) {
                 VmWorkAddVmToNetwork workAddVmToNetwork = (VmWorkAddVmToNetwork)work;
-                NicProfile nic = _vmMgr.orchestrateAddVmToNetwork(vm, workAddVmToNetwork.getNetwork(), 
-                	workAddVmToNetwork.getRequestedNicProfile());
-                _asyncJobMgr.completeAsyncJob(job.getId(), JobInfo.Status.SUCCEEDED, 0, 
+                NicProfile nic = _vmMgr.orchestrateAddVmToNetwork(vm, workAddVmToNetwork.getNetwork(),
+                    workAddVmToNetwork.getRequestedNicProfile());
+                _asyncJobMgr.completeAsyncJob(job.getId(), JobInfo.Status.SUCCEEDED, 0,
                     JobSerializerHelper.toObjectSerializedString(nic));
-            } else if(work instanceof VmWorkRemoveNicFromVm) { 
+            } else if (work instanceof VmWorkRemoveNicFromVm) {
                 VmWorkRemoveNicFromVm workRemoveNicFromVm = (VmWorkRemoveNicFromVm)work;
                 boolean result = _vmMgr.orchestrateRemoveNicFromVm(vm, workRemoveNicFromVm.getNic());
-                _asyncJobMgr.completeAsyncJob(job.getId(), JobInfo.Status.SUCCEEDED, 0, 
-                	JobSerializerHelper.toObjectSerializedString(new Boolean(result)));
-            } else if(work instanceof VmWorkRemoveVmFromNetwork) { 
+                _asyncJobMgr.completeAsyncJob(job.getId(), JobInfo.Status.SUCCEEDED, 0,
+                    JobSerializerHelper.toObjectSerializedString(new Boolean(result)));
+            } else if (work instanceof VmWorkRemoveVmFromNetwork) {
                 VmWorkRemoveVmFromNetwork workRemoveVmFromNetwork = (VmWorkRemoveVmFromNetwork)work;
-                boolean result = _vmMgr.orchestrateRemoveVmFromNetwork(vm, 
-                	workRemoveVmFromNetwork.getNetwork(), workRemoveVmFromNetwork.getBroadcastUri());
-                _asyncJobMgr.completeAsyncJob(job.getId(), JobInfo.Status.SUCCEEDED, 0, 
-                    	JobSerializerHelper.toObjectSerializedString(new Boolean(result)));
-            } else if(work instanceof VmWorkReconfigure) { 
+                boolean result = _vmMgr.orchestrateRemoveVmFromNetwork(vm,
+                    workRemoveVmFromNetwork.getNetwork(), workRemoveVmFromNetwork.getBroadcastUri());
+                _asyncJobMgr.completeAsyncJob(job.getId(), JobInfo.Status.SUCCEEDED, 0,
+                    JobSerializerHelper.toObjectSerializedString(new Boolean(result)));
+            } else if (work instanceof VmWorkReconfigure) {
                 VmWorkReconfigure workReconfigure = (VmWorkReconfigure)work;
-                _vmMgr.reConfigureVm(vm.getUuid(), workReconfigure.getNewServiceOffering(), 
-                	workReconfigure.isSameHost());
+                _vmMgr.reConfigureVm(vm.getUuid(), workReconfigure.getNewServiceOffering(),
+                    workReconfigure.isSameHost());
                 _asyncJobMgr.completeAsyncJob(job.getId(), JobInfo.Status.SUCCEEDED, 0, null);
-            } else if(work instanceof VmWorkStorageMigration) { 
+            } else if (work instanceof VmWorkStorageMigration) {
                 VmWorkStorageMigration workStorageMigration = (VmWorkStorageMigration)work;
                 _vmMgr.orchestrateStorageMigration(vm.getUuid(), workStorageMigration.getDestStoragePool());
                 _asyncJobMgr.completeAsyncJob(job.getId(), JobInfo.Status.SUCCEEDED, 0, null);
             } else {
-            	assert(false);
+                assert (false);
                 s_logger.error("Unhandled VM work command: " + job.getCmd());
-            	
-            	RuntimeException e = new RuntimeException("Unsupported VM work command: " + job.getCmd());
+
+                RuntimeException e = new RuntimeException("Unsupported VM work command: " + job.getCmd());
                 String exceptionJson = JobSerializerHelper.toSerializedString(e);
                 s_logger.error("Serialize exception object into json: " + exceptionJson);
                 _asyncJobMgr.completeAsyncJob(job.getId(), JobInfo.Status.FAILED, 0, exceptionJson);
             }
-        } catch(Throwable e) {
+        } catch (Throwable e) {
             s_logger.error("Unable to complete " + job, e);
-            
+
             String exceptionJson = JobSerializerHelper.toSerializedString(e);
             s_logger.info("Serialize exception object into json: " + exceptionJson);
             _asyncJobMgr.completeAsyncJob(job.getId(), JobInfo.Status.FAILED, 0, exceptionJson);
         } finally {
             CallContext.unregister();
         }
-	}
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/orchestration/src/com/cloud/vm/VmWorkMigrate.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VmWorkMigrate.java b/engine/orchestration/src/com/cloud/vm/VmWorkMigrate.java
index c313876..107f5fe 100644
--- a/engine/orchestration/src/com/cloud/vm/VmWorkMigrate.java
+++ b/engine/orchestration/src/com/cloud/vm/VmWorkMigrate.java
@@ -29,9 +29,9 @@ import com.cloud.storage.Volume;
 import com.cloud.utils.db.EntityManager;
 
 public class VmWorkMigrate extends VmWork {
-	private static final long serialVersionUID = 1689203333114836522L;
+    private static final long serialVersionUID = 1689203333114836522L;
 
-	Long zoneId;
+    Long zoneId;
     Long podId;
     Long clusterId;
     Long hostId;
@@ -60,7 +60,7 @@ public class VmWorkMigrate extends VmWork {
         Pod pod = podId != null ? s_entityMgr.findById(Pod.class, podId) : null;
         Cluster cluster = clusterId != null ? s_entityMgr.findById(Cluster.class, clusterId) : null;
         Host host = hostId != null ? s_entityMgr.findById(Host.class, hostId) : null;
-        
+
         Map<Volume, StoragePool> vols = null;
 
         if (storage != null) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/orchestration/src/com/cloud/vm/VmWorkMigrateForScale.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VmWorkMigrateForScale.java b/engine/orchestration/src/com/cloud/vm/VmWorkMigrateForScale.java
index 8e71aa8..399ea91 100644
--- a/engine/orchestration/src/com/cloud/vm/VmWorkMigrateForScale.java
+++ b/engine/orchestration/src/com/cloud/vm/VmWorkMigrateForScale.java
@@ -19,30 +19,30 @@ package com.cloud.vm;
 import com.cloud.deploy.DeployDestination;
 
 public class VmWorkMigrateForScale extends VmWork {
-	private static final long serialVersionUID = 6854870395568389613L;
-
-	long srcHostId;
-	DeployDestination deployDestination;
-	Long newSvcOfferingId;
-	
-    public VmWorkMigrateForScale(long userId, long accountId, long vmId, long srcHostId, 
-    	DeployDestination dest, Long newSvcOfferingId) {
-    	
-    	super(userId, accountId, vmId);
-    	this.srcHostId = srcHostId;
-    	this.deployDestination = dest;
-    	this.newSvcOfferingId = newSvcOfferingId;
+    private static final long serialVersionUID = 6854870395568389613L;
+
+    long srcHostId;
+    DeployDestination deployDestination;
+    Long newSvcOfferingId;
+
+    public VmWorkMigrateForScale(long userId, long accountId, long vmId, long srcHostId,
+            DeployDestination dest, Long newSvcOfferingId) {
+
+        super(userId, accountId, vmId);
+        this.srcHostId = srcHostId;
+        this.deployDestination = dest;
+        this.newSvcOfferingId = newSvcOfferingId;
     }
-	
+
     public long getSrcHostId() {
-    	return srcHostId;
+        return srcHostId;
     }
-    
+
     public DeployDestination getDeployDestination() {
-    	return this.deployDestination;
+        return this.deployDestination;
     }
-    
+
     public Long getNewServiceOfferringId() {
-    	return this.newSvcOfferingId;
+        return this.newSvcOfferingId;
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/orchestration/src/com/cloud/vm/VmWorkMigrateWithStorage.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VmWorkMigrateWithStorage.java b/engine/orchestration/src/com/cloud/vm/VmWorkMigrateWithStorage.java
index ae91231..75024db 100644
--- a/engine/orchestration/src/com/cloud/vm/VmWorkMigrateWithStorage.java
+++ b/engine/orchestration/src/com/cloud/vm/VmWorkMigrateWithStorage.java
@@ -22,31 +22,31 @@ import com.cloud.storage.StoragePool;
 import com.cloud.storage.Volume;
 
 public class VmWorkMigrateWithStorage extends VmWork {
-	private static final long serialVersionUID = -5626053872453569165L;
-
-	long srcHostId;
-	long destHostId;
-	Map<Volume, StoragePool> volumeToPool;
-	
-    public VmWorkMigrateWithStorage(long userId, long accountId, long vmId, long srcHostId, 
-    	long destHostId, Map<Volume, StoragePool> volumeToPool) {
-    	
-    	super(userId, accountId, vmId);
-    
-    	this.srcHostId = srcHostId;
-    	this.destHostId = destHostId;
-    	this.volumeToPool = volumeToPool;
+    private static final long serialVersionUID = -5626053872453569165L;
+
+    long srcHostId;
+    long destHostId;
+    Map<Volume, StoragePool> volumeToPool;
+
+    public VmWorkMigrateWithStorage(long userId, long accountId, long vmId, long srcHostId,
+            long destHostId, Map<Volume, StoragePool> volumeToPool) {
+
+        super(userId, accountId, vmId);
+
+        this.srcHostId = srcHostId;
+        this.destHostId = destHostId;
+        this.volumeToPool = volumeToPool;
     }
-    
+
     public long getSrcHostId() {
-    	return this.srcHostId;
+        return this.srcHostId;
     }
-    
+
     public long getDestHostId() {
-    	return this.destHostId;
+        return this.destHostId;
     }
-    
+
     public Map<Volume, StoragePool> getVolumeToPool() {
-    	return this.volumeToPool;
+        return this.volumeToPool;
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/orchestration/src/com/cloud/vm/VmWorkReboot.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VmWorkReboot.java b/engine/orchestration/src/com/cloud/vm/VmWorkReboot.java
index 8f50702..fecaaef 100644
--- a/engine/orchestration/src/com/cloud/vm/VmWorkReboot.java
+++ b/engine/orchestration/src/com/cloud/vm/VmWorkReboot.java
@@ -23,46 +23,46 @@ import java.util.Map;
 import org.apache.cloudstack.framework.jobs.impl.JobSerializerHelper;
 
 public class VmWorkReboot extends VmWork {
-	private static final long serialVersionUID = 195907627459759933L;
+    private static final long serialVersionUID = 195907627459759933L;
+
+    // use serialization friendly map
+    private Map<String, String> rawParams;
 
-	// use serialization friendly map
-	private Map<String, String> rawParams;
-	
     public VmWorkReboot(long userId, long accountId, long vmId, Map<VirtualMachineProfile.Param, Object> params) {
-    	super(userId, accountId, vmId);
-    	
-    	setParams(params);
+        super(userId, accountId, vmId);
+
+        setParams(params);
+    }
+
+    public Map<String, String> getRawParams() {
+        return rawParams;
+    }
+
+    public void setRawParams(Map<String, String> params) {
+        rawParams = params;
     }
-    
-	public Map<String, String> getRawParams() {
-		return rawParams;
-	}
 
-	public void setRawParams(Map<String, String> params) {
-		rawParams = params;
-	}
-	
-	public Map<VirtualMachineProfile.Param, Object> getParams() {
-		Map<VirtualMachineProfile.Param, Object> map = new HashMap<VirtualMachineProfile.Param, Object>();
-		
-		if(rawParams != null) {
-			for(Map.Entry<String, String> entry : rawParams.entrySet()) {
-				VirtualMachineProfile.Param key = new VirtualMachineProfile.Param(entry.getKey());
-				Object val = JobSerializerHelper.fromObjectSerializedString(entry.getValue());
-				map.put(key, val);
-			}
-		}
-		
-		return map;
-	}
-	
-	public void setParams(Map<VirtualMachineProfile.Param, Object> params) {
-		if(params != null) {
-			rawParams = new HashMap<String, String>();
-			for(Map.Entry<VirtualMachineProfile.Param, Object> entry : params.entrySet()) {
-				rawParams.put(entry.getKey().getName(), JobSerializerHelper.toObjectSerializedString(
-					entry.getValue() instanceof Serializable ? (Serializable)entry.getValue() : entry.getValue().toString()));
-			}
-		}
-	}
+    public Map<VirtualMachineProfile.Param, Object> getParams() {
+        Map<VirtualMachineProfile.Param, Object> map = new HashMap<VirtualMachineProfile.Param, Object>();
+
+        if (rawParams != null) {
+            for (Map.Entry<String, String> entry : rawParams.entrySet()) {
+                VirtualMachineProfile.Param key = new VirtualMachineProfile.Param(entry.getKey());
+                Object val = JobSerializerHelper.fromObjectSerializedString(entry.getValue());
+                map.put(key, val);
+            }
+        }
+
+        return map;
+    }
+
+    public void setParams(Map<VirtualMachineProfile.Param, Object> params) {
+        if (params != null) {
+            rawParams = new HashMap<String, String>();
+            for (Map.Entry<VirtualMachineProfile.Param, Object> entry : params.entrySet()) {
+                rawParams.put(entry.getKey().getName(), JobSerializerHelper.toObjectSerializedString(
+                    entry.getValue() instanceof Serializable ? (Serializable)entry.getValue() : entry.getValue().toString()));
+            }
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/orchestration/src/com/cloud/vm/VmWorkReconfigure.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VmWorkReconfigure.java b/engine/orchestration/src/com/cloud/vm/VmWorkReconfigure.java
index 48a9df3..6e2b6d8 100644
--- a/engine/orchestration/src/com/cloud/vm/VmWorkReconfigure.java
+++ b/engine/orchestration/src/com/cloud/vm/VmWorkReconfigure.java
@@ -19,25 +19,25 @@ package com.cloud.vm;
 import com.cloud.offering.ServiceOffering;
 
 public class VmWorkReconfigure extends VmWork {
-	private static final long serialVersionUID = -4517030323758086615L;
-	
-	ServiceOffering newServiceOffering;
-	boolean sameHost;
-	
-    public VmWorkReconfigure(long userId, long accountId, long vmId, 
-    	ServiceOffering newServiceOffering, boolean sameHost) {
-    	
-    	super(userId, accountId, vmId);
-    	
-    	this.newServiceOffering = newServiceOffering;
-    	this.sameHost = sameHost;
+    private static final long serialVersionUID = -4517030323758086615L;
+
+    ServiceOffering newServiceOffering;
+    boolean sameHost;
+
+    public VmWorkReconfigure(long userId, long accountId, long vmId,
+            ServiceOffering newServiceOffering, boolean sameHost) {
+
+        super(userId, accountId, vmId);
+
+        this.newServiceOffering = newServiceOffering;
+        this.sameHost = sameHost;
     }
-    
+
     public ServiceOffering getNewServiceOffering() {
-    	return this.newServiceOffering;
+        return this.newServiceOffering;
     }
-    
+
     public boolean isSameHost() {
-    	return this.sameHost;
+        return this.sameHost;
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/orchestration/src/com/cloud/vm/VmWorkRemoveNicFromVm.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VmWorkRemoveNicFromVm.java b/engine/orchestration/src/com/cloud/vm/VmWorkRemoveNicFromVm.java
index b756ac3..8efe77b 100644
--- a/engine/orchestration/src/com/cloud/vm/VmWorkRemoveNicFromVm.java
+++ b/engine/orchestration/src/com/cloud/vm/VmWorkRemoveNicFromVm.java
@@ -17,17 +17,17 @@
 package com.cloud.vm;
 
 public class VmWorkRemoveNicFromVm extends VmWork {
-	private static final long serialVersionUID = -4265657031064437923L;
+    private static final long serialVersionUID = -4265657031064437923L;
 
-	Nic nic;
-    
-	public VmWorkRemoveNicFromVm(long userId, long accountId, long vmId, Nic nic) {
-    	super(userId, accountId, vmId);
-    	
-    	this.nic = nic;
+    Nic nic;
+
+    public VmWorkRemoveNicFromVm(long userId, long accountId, long vmId, Nic nic) {
+        super(userId, accountId, vmId);
+
+        this.nic = nic;
     }
-    
+
     public Nic getNic() {
-    	return this.nic;
+        return this.nic;
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/orchestration/src/com/cloud/vm/VmWorkRemoveVmFromNetwork.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VmWorkRemoveVmFromNetwork.java b/engine/orchestration/src/com/cloud/vm/VmWorkRemoveVmFromNetwork.java
index d4e0ae4..0e94c2f 100644
--- a/engine/orchestration/src/com/cloud/vm/VmWorkRemoveVmFromNetwork.java
+++ b/engine/orchestration/src/com/cloud/vm/VmWorkRemoveVmFromNetwork.java
@@ -21,23 +21,23 @@ import java.net.URI;
 import com.cloud.network.Network;
 
 public class VmWorkRemoveVmFromNetwork extends VmWork {
-	private static final long serialVersionUID = -5070392905642149925L;
-
-	Network network;
-	URI broadcastUri;
-	
-	public VmWorkRemoveVmFromNetwork(long userId, long accountId, long vmId, Network network, URI broadcastUri) {
-    	super(userId, accountId, vmId);
-    	
-    	this.network = network;
-    	this.broadcastUri = broadcastUri;
-	}
-	
-	public Network getNetwork() {
-		return this.network;
-	}
-	
-	public URI getBroadcastUri() {
-		return this.broadcastUri;
-	}
+    private static final long serialVersionUID = -5070392905642149925L;
+
+    Network network;
+    URI broadcastUri;
+
+    public VmWorkRemoveVmFromNetwork(long userId, long accountId, long vmId, Network network, URI broadcastUri) {
+        super(userId, accountId, vmId);
+
+        this.network = network;
+        this.broadcastUri = broadcastUri;
+    }
+
+    public Network getNetwork() {
+        return this.network;
+    }
+
+    public URI getBroadcastUri() {
+        return this.broadcastUri;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/orchestration/src/com/cloud/vm/VmWorkSerializer.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VmWorkSerializer.java b/engine/orchestration/src/com/cloud/vm/VmWorkSerializer.java
index 9a1aaac..bd6b52d 100644
--- a/engine/orchestration/src/com/cloud/vm/VmWorkSerializer.java
+++ b/engine/orchestration/src/com/cloud/vm/VmWorkSerializer.java
@@ -21,8 +21,6 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
 
-import org.apache.cloudstack.framework.jobs.impl.JobSerializerHelper;
-
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
 import com.google.gson.JsonDeserializationContext;
@@ -31,9 +29,11 @@ import com.google.gson.JsonElement;
 import com.google.gson.JsonObject;
 import com.google.gson.JsonParseException;
 
+import org.apache.cloudstack.framework.jobs.impl.JobSerializerHelper;
+
 public class VmWorkSerializer {
     static class StringMapTypeAdapter implements JsonDeserializer<Map> {
-    	
+
         @Override
         public Map deserialize(JsonElement src, Type srcType, JsonDeserializationContext context) throws JsonParseException {
 
@@ -47,7 +47,7 @@ public class VmWorkSerializer {
             return obj;
         }
     }
- 
+
     protected static Gson s_gson;
     static {
         GsonBuilder gBuilder = new GsonBuilder();
@@ -55,21 +55,20 @@ public class VmWorkSerializer {
         gBuilder.registerTypeAdapter(Map.class, new StringMapTypeAdapter());
         s_gson = gBuilder.create();
     }
-   
+
     public static String serialize(VmWork work) {
-    	// TODO: there are way many generics, too tedious to get serialization work under GSON
-    	// use java binary serialization instead
-    	// 
-    	return JobSerializerHelper.toObjectSerializedString(work);
+        // TODO: there are way many generics, too tedious to get serialization work under GSON
+        // use java binary serialization instead
+        //
+        return JobSerializerHelper.toObjectSerializedString(work);
         // return s_gson.toJson(work);
     }
 
     public static <T extends VmWork> T deserialize(Class<?> clazz, String workInJsonText) {
-    	// TODO: there are way many generics, too tedious to get serialization work under GSON
-    	// use java binary serialization instead
-    	// 
+        // TODO: there are way many generics, too tedious to get serialization work under GSON
+        // use java binary serialization instead
+        //
         return (T)JobSerializerHelper.fromObjectSerializedString(workInJsonText);
-    	// return (T)s_gson.fromJson(workInJsonText, clazz);
+        // return (T)s_gson.fromJson(workInJsonText, clazz);
     }
 }
-

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/orchestration/src/com/cloud/vm/VmWorkStart.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VmWorkStart.java b/engine/orchestration/src/com/cloud/vm/VmWorkStart.java
index 7a7447f..e023801 100644
--- a/engine/orchestration/src/com/cloud/vm/VmWorkStart.java
+++ b/engine/orchestration/src/com/cloud/vm/VmWorkStart.java
@@ -32,94 +32,94 @@ import com.cloud.deploy.DeploymentPlanner.ExcludeList;
 import com.cloud.utils.Journal;
 
 public class VmWorkStart extends VmWork {
-	private static final long serialVersionUID = 9038937399817468894L;
-
-	private static final Logger s_logger = Logger.getLogger(VmWorkStart.class);
-
-	long dcId;
-	Long podId;
-	Long clusterId;
-	Long hostId;
-	Long poolId;
-	ExcludeList avoids;
-	Long physicalNetworkId;
-	
-	String reservationId;
-	String journalName;
-	
-	// use serialization friendly map
-	private Map<String, String> rawParams;
+    private static final long serialVersionUID = 9038937399817468894L;
+
+    private static final Logger s_logger = Logger.getLogger(VmWorkStart.class);
+
+    long dcId;
+    Long podId;
+    Long clusterId;
+    Long hostId;
+    Long poolId;
+    ExcludeList avoids;
+    Long physicalNetworkId;
+
+    String reservationId;
+    String journalName;
+
+    // use serialization friendly map
+    private Map<String, String> rawParams;
 
     public VmWorkStart(long userId, long accountId, long vmId) {
         super(userId, accountId, vmId);
-	}
-
-	public DeploymentPlan getPlan() {
-		
-		if(podId != null || clusterId != null || hostId != null || poolId != null || physicalNetworkId != null) {
-			// this is ugly, to work with legacy code, we need to re-construct the DeploymentPlan hard-codely
-			// this has to be refactored together with migrating legacy code into the new way
-			ReservationContext context = null;
-			if(reservationId != null) {
-		        Journal journal = new Journal.LogJournal("VmWorkStart", s_logger);
-				context = new ReservationContextImpl(reservationId, journal, 
-						CallContext.current().getCallingUser(), 
-						CallContext.current().getCallingAccount());
-			}
-			
-			DeploymentPlan plan = new DataCenterDeployment(
-					dcId, podId, clusterId, hostId, poolId, physicalNetworkId,
-					context);
-			return plan;
-		}
-		
-		return null;
-	}
-
-	public void setPlan(DeploymentPlan plan) {
-		if(plan != null) {
-			dcId = plan.getDataCenterId();
-			podId = plan.getPodId();
-			clusterId = plan.getClusterId();
-			hostId = plan.getHostId();
-			poolId = plan.getPoolId();
-			physicalNetworkId = plan.getPhysicalNetworkId();
-			avoids = plan.getAvoids();
-			
-			if(plan.getReservationContext() != null)
-				reservationId = plan.getReservationContext().getReservationId();
-		}
-	}
-
-	public Map<String, String> getRawParams() {
-		return rawParams;
-	}
-
-	public void setRawParams(Map<String, String> params) {
-		rawParams = params;
-	}
-	
-	public Map<VirtualMachineProfile.Param, Object> getParams() {
-		Map<VirtualMachineProfile.Param, Object> map = new HashMap<VirtualMachineProfile.Param, Object>();
-		
-		if(rawParams != null) {
-			for(Map.Entry<String, String> entry : rawParams.entrySet()) {
-				VirtualMachineProfile.Param key = new VirtualMachineProfile.Param(entry.getKey());
-				Object val = JobSerializerHelper.fromObjectSerializedString(entry.getValue());
-				map.put(key, val);
-			}
-		}
-		
-		return map;
-	}
-	
-	public void setParams(Map<VirtualMachineProfile.Param, Object> params) {
-		if(params != null) {
-			rawParams = new HashMap<String, String>();
-			for(Map.Entry<VirtualMachineProfile.Param, Object> entry : params.entrySet()) {
-				rawParams.put(entry.getKey().getName(), JobSerializerHelper.toObjectSerializedString(
-					entry.getValue() instanceof Serializable ? (Serializable)entry.getValue() : entry.getValue().toString()));
-			}
-		}
-	}
+    }
+
+    public DeploymentPlan getPlan() {
+
+        if (podId != null || clusterId != null || hostId != null || poolId != null || physicalNetworkId != null) {
+            // this is ugly, to work with legacy code, we need to re-construct the DeploymentPlan hard-codely
+            // this has to be refactored together with migrating legacy code into the new way
+            ReservationContext context = null;
+            if (reservationId != null) {
+                Journal journal = new Journal.LogJournal("VmWorkStart", s_logger);
+                context = new ReservationContextImpl(reservationId, journal,
+                    CallContext.current().getCallingUser(),
+                    CallContext.current().getCallingAccount());
+            }
+
+            DeploymentPlan plan = new DataCenterDeployment(
+                dcId, podId, clusterId, hostId, poolId, physicalNetworkId,
+                context);
+            return plan;
+        }
+
+        return null;
+    }
+
+    public void setPlan(DeploymentPlan plan) {
+        if (plan != null) {
+            dcId = plan.getDataCenterId();
+            podId = plan.getPodId();
+            clusterId = plan.getClusterId();
+            hostId = plan.getHostId();
+            poolId = plan.getPoolId();
+            physicalNetworkId = plan.getPhysicalNetworkId();
+            avoids = plan.getAvoids();
+
+            if (plan.getReservationContext() != null)
+                reservationId = plan.getReservationContext().getReservationId();
+        }
+    }
+
+    public Map<String, String> getRawParams() {
+        return rawParams;
+    }
+
+    public void setRawParams(Map<String, String> params) {
+        rawParams = params;
+    }
+
+    public Map<VirtualMachineProfile.Param, Object> getParams() {
+        Map<VirtualMachineProfile.Param, Object> map = new HashMap<VirtualMachineProfile.Param, Object>();
+
+        if (rawParams != null) {
+            for (Map.Entry<String, String> entry : rawParams.entrySet()) {
+                VirtualMachineProfile.Param key = new VirtualMachineProfile.Param(entry.getKey());
+                Object val = JobSerializerHelper.fromObjectSerializedString(entry.getValue());
+                map.put(key, val);
+            }
+        }
+
+        return map;
+    }
+
+    public void setParams(Map<VirtualMachineProfile.Param, Object> params) {
+        if (params != null) {
+            rawParams = new HashMap<String, String>();
+            for (Map.Entry<VirtualMachineProfile.Param, Object> entry : params.entrySet()) {
+                rawParams.put(entry.getKey().getName(), JobSerializerHelper.toObjectSerializedString(
+                    entry.getValue() instanceof Serializable ? (Serializable)entry.getValue() : entry.getValue().toString()));
+            }
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/orchestration/src/com/cloud/vm/VmWorkStop.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VmWorkStop.java b/engine/orchestration/src/com/cloud/vm/VmWorkStop.java
index 0a27057..f0bc885 100644
--- a/engine/orchestration/src/com/cloud/vm/VmWorkStop.java
+++ b/engine/orchestration/src/com/cloud/vm/VmWorkStop.java
@@ -17,16 +17,16 @@
 package com.cloud.vm;
 
 public class VmWorkStop extends VmWork {
-	private static final long serialVersionUID = 202908740486785251L;
-	
-	private final boolean cleanup;
-	
+    private static final long serialVersionUID = 202908740486785251L;
+
+    private final boolean cleanup;
+
     public VmWorkStop(long userId, long accountId, long vmId, boolean cleanup) {
         super(userId, accountId, vmId);
         this.cleanup = cleanup;
-	}
-	
-	public boolean isCleanup() {
-		return cleanup;
-	}
+    }
+
+    public boolean isCleanup() {
+        return cleanup;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/orchestration/src/com/cloud/vm/VmWorkStorageMigration.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VmWorkStorageMigration.java b/engine/orchestration/src/com/cloud/vm/VmWorkStorageMigration.java
index ba8330c..76a35b2 100644
--- a/engine/orchestration/src/com/cloud/vm/VmWorkStorageMigration.java
+++ b/engine/orchestration/src/com/cloud/vm/VmWorkStorageMigration.java
@@ -19,17 +19,17 @@ package com.cloud.vm;
 import com.cloud.storage.StoragePool;
 
 public class VmWorkStorageMigration extends VmWork {
-	private static final long serialVersionUID = -8677979691741157474L;
+    private static final long serialVersionUID = -8677979691741157474L;
+
+    StoragePool destPool;
 
-	StoragePool destPool;
-	
     public VmWorkStorageMigration(long userId, long accountId, long vmId, StoragePool destPool) {
-    	super(userId, accountId, vmId);
-    	
-    	this.destPool = destPool;
+        super(userId, accountId, vmId);
+
+        this.destPool = destPool;
     }
-    
+
     public StoragePool getDestStoragePool() {
-    	return this.destPool;
+        return this.destPool;
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostDaoImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostDaoImpl.java
index 97ac589..35d7bbc 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostDaoImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineHostDaoImpl.java
@@ -776,7 +776,7 @@ public class EngineHostDaoImpl extends GenericDaoBase<EngineHostVO, Long> implem
 
     @Override
     public List<org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO> search(
-        SearchCriteria<org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO> sc, Filter filter, boolean enable_query_cache) {
+        SearchCriteria<org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO> sc, Filter filter, boolean enableQueryCache) {
         // TODO Auto-generated method stub
         return null;
     }
@@ -789,7 +789,7 @@ public class EngineHostDaoImpl extends GenericDaoBase<EngineHostVO, Long> implem
     }
 
     @Override
-    public List<EngineHostVO> searchIncludingRemoved(SearchCriteria<EngineHostVO> sc, Filter filter, Boolean lock, boolean cache, boolean enable_query_cache) {
+    public List<EngineHostVO> searchIncludingRemoved(SearchCriteria<EngineHostVO> sc, Filter filter, Boolean lock, boolean cache, boolean enableQueryCache) {
         // TODO Auto-generated method stub
         return null;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
index 4ad0cd7..cbe02ff 100755
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
@@ -47,7 +47,6 @@ import org.apache.cloudstack.framework.config.Configurable;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.managed.context.ManagedContextRunnable;
 import org.apache.cloudstack.region.PortableIpDao;
-import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.Listener;
@@ -256,37 +255,37 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
     @Inject
     protected IpAddressManager _ipAddrMgr;
 
-    List<NetworkGuru> _networkGurus;
+    List<NetworkGuru> networkGurus;
 
     public List<NetworkGuru> getNetworkGurus() {
-        return _networkGurus;
+        return networkGurus;
     }
 
-    public void setNetworkGurus(List<NetworkGuru> _networkGurus) {
-        this._networkGurus = _networkGurus;
+    public void setNetworkGurus(List<NetworkGuru> networkGurus) {
+        this.networkGurus = networkGurus;
     }
 
-    List<NetworkElement> _networkElements;
+    List<NetworkElement> networkElements;
 
     public List<NetworkElement> getNetworkElements() {
-        return _networkElements;
+        return networkElements;
     }
 
-    public void setNetworkElements(List<NetworkElement> _networkElements) {
-        this._networkElements = _networkElements;
+    public void setNetworkElements(List<NetworkElement> networkElements) {
+        this.networkElements = networkElements;
     }
 
     @Inject
     NetworkDomainDao _networkDomainDao;
 
-    List<IpDeployer> _ipDeployers;
+    List<IpDeployer> ipDeployers;
 
     public List<IpDeployer> getIpDeployers() {
-        return _ipDeployers;
+        return ipDeployers;
     }
 
-    public void setIpDeployers(List<IpDeployer> _ipDeployers) {
-        this._ipDeployers = _ipDeployers;
+    public void setIpDeployers(List<IpDeployer> ipDeployers) {
+        this.ipDeployers = ipDeployers;
     }
 
     List<DhcpServiceProvider> _dhcpProviders;
@@ -295,8 +294,8 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
         return _dhcpProviders;
     }
 
-    public void setDhcpProviders(List<DhcpServiceProvider> _dhcpProviders) {
-        this._dhcpProviders = _dhcpProviders;
+    public void setDhcpProviders(List<DhcpServiceProvider> dhcpProviders) {
+        _dhcpProviders = dhcpProviders;
     }
 
     @Inject
@@ -644,7 +643,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
 
             long related = -1;
 
-            for (final NetworkGuru guru : _networkGurus) {
+            for (final NetworkGuru guru : networkGurus) {
                 final Network network = guru.design(offering, plan, predefined, owner);
                 if (network == null) {
                     continue;
@@ -776,7 +775,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
 
         NetworkVO ntwkVO = _networksDao.findById(network.getId());
         s_logger.debug("Allocating nic for vm " + vm.getVirtualMachine() + " in network " + network + " with requested profile " + requested);
-        NetworkGuru guru = AdapterBase.getAdapterByName(_networkGurus, ntwkVO.getGuruName());
+        NetworkGuru guru = AdapterBase.getAdapterByName(networkGurus, ntwkVO.getGuruName());
 
         if (requested != null && requested.getMode() == null) {
             requested.setMode(network.getMode());
@@ -923,7 +922,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
         Pair<NetworkGuru, NetworkVO> implemented = new Pair<NetworkGuru, NetworkVO>(null, null);
 
         NetworkVO network = _networksDao.findById(networkId);
-        NetworkGuru guru = AdapterBase.getAdapterByName(_networkGurus, network.getGuruName());
+        NetworkGuru guru = AdapterBase.getAdapterByName(networkGurus, network.getGuruName());
         if (isNetworkImplemented(network)) {
             s_logger.debug("Network id=" + networkId + " is already implemented");
             implemented.set(guru, network);
@@ -1051,7 +1050,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
         }
         // get providers to implement
         List<Provider> providersToImplement = getNetworkProviders(network.getId());
-        for (NetworkElement element : _networkElements) {
+        for (NetworkElement element : networkElements) {
             if (providersToImplement.contains(element.getProvider())) {
                 if (!_networkModel.isProviderEnabledInPhysicalNetwork(_networkModel.getPhysicalNetworkId(network), element.getProvider().getName())) {
                     // The physicalNetworkId will not get translated into a uuid by the reponse serializer,
@@ -1114,9 +1113,9 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
         NetworkOfferingVO offering = _networkOfferingDao.findById(network.getNetworkOfferingId());
         //there are no egress rules then apply the default egress rule
         DataCenter zone = _dcDao.findById(network.getDataCenterId());
-        if ( _networkModel.areServicesSupportedInNetwork(network.getId(), Service.Firewall) &&
-                _networkModel.areServicesSupportedInNetwork(network.getId(), Service.Firewall) &&
-                (network.getGuestType() == Network.GuestType.Isolated || (network.getGuestType() == Network.GuestType.Shared && zone.getNetworkType() == NetworkType.Advanced))) {
+        if (_networkModel.areServicesSupportedInNetwork(network.getId(), Service.Firewall) &&
+            _networkModel.areServicesSupportedInNetwork(network.getId(), Service.Firewall) &&
+            (network.getGuestType() == Network.GuestType.Isolated || (network.getGuestType() == Network.GuestType.Shared && zone.getNetworkType() == NetworkType.Advanced))) {
             // add default egress rule to accept the traffic
             _firewallMgr.applyDefaultEgressFirewallRule(network.getId(), offering.getEgressDefaultPolicy(), true);
         }
@@ -1125,7 +1124,6 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
             success = false;
         }
 
-
         // apply port forwarding rules
         if (!_rulesMgr.applyPortForwardingRulesForNetwork(networkId, false, caller)) {
             s_logger.warn("Failed to reapply port forwarding rule(s) as a part of network id=" + networkId + " restart");
@@ -1254,7 +1252,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
         ResourceUnavailableException {
 
         Integer networkRate = _networkModel.getNetworkRate(network.getId(), vmProfile.getId());
-        NetworkGuru guru = AdapterBase.getAdapterByName(_networkGurus, network.getGuruName());
+        NetworkGuru guru = AdapterBase.getAdapterByName(networkGurus, network.getGuruName());
         NicVO nic = _nicDao.findById(nicId);
 
         NicProfile profile = null;
@@ -1271,7 +1269,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
 
             profile = new NicProfile(nic, network, broadcastUri, isolationUri,
 
-            networkRate, _networkModel.isSecurityGroupSupportedInNetwork(network), _networkModel.getNetworkTag(vmProfile.getHypervisorType(), network));
+                networkRate, _networkModel.isSecurityGroupSupportedInNetwork(network), _networkModel.getNetworkTag(vmProfile.getHypervisorType(), network));
             guru.reserve(profile, network, vmProfile, dest, context);
             nic.setIp4Address(profile.getIp4Address());
             nic.setAddressFormat(profile.getFormat());
@@ -1299,7 +1297,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
         }
 
         List<Provider> providersToImplement = getNetworkProviders(network.getId());
-        for (NetworkElement element : _networkElements) {
+        for (NetworkElement element : networkElements) {
             if (providersToImplement.contains(element.getProvider())) {
                 if (!_networkModel.isProviderEnabledInPhysicalNetwork(_networkModel.getPhysicalNetworkId(network), element.getProvider().getName())) {
                     throw new CloudRuntimeException("Service provider " + element.getProvider().getName() +
@@ -1328,7 +1326,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
             NetworkVO network = _networksDao.findById(nic.getNetworkId());
             Integer networkRate = _networkModel.getNetworkRate(network.getId(), vm.getId());
 
-            NetworkGuru guru = AdapterBase.getAdapterByName(_networkGurus, network.getGuruName());
+            NetworkGuru guru = AdapterBase.getAdapterByName(networkGurus, network.getGuruName());
             NicProfile profile =
                 new NicProfile(nic, network, nic.getBroadcastUri(), nic.getIsolationUri(), networkRate, _networkModel.isSecurityGroupSupportedInNetwork(network),
                     _networkModel.getNetworkTag(vm.getHypervisorType(), network));
@@ -1338,7 +1336,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
                 }
             }
             List<Provider> providersToImplement = getNetworkProviders(network.getId());
-            for (NetworkElement element : _networkElements) {
+            for (NetworkElement element : networkElements) {
                 if (providersToImplement.contains(element.getProvider())) {
                     if (!_networkModel.isProviderEnabledInPhysicalNetwork(_networkModel.getPhysicalNetworkId(network), element.getProvider().getName())) {
                         throw new CloudRuntimeException("Service provider " + element.getProvider().getName() +
@@ -1369,7 +1367,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
     public void commitNicForMigration(VirtualMachineProfile src, VirtualMachineProfile dst) {
         for (NicProfile nicSrc : src.getNics()) {
             NetworkVO network = _networksDao.findById(nicSrc.getNetworkId());
-            NetworkGuru guru = AdapterBase.getAdapterByName(_networkGurus, network.getGuruName());
+            NetworkGuru guru = AdapterBase.getAdapterByName(networkGurus, network.getGuruName());
             NicProfile nicDst = findNicProfileById(dst, nicSrc.getId());
             ReservationContext src_context = new ReservationContextImpl(nicSrc.getReservationId(), null, null);
             ReservationContext dst_context = new ReservationContextImpl(nicDst.getReservationId(), null, null);
@@ -1378,7 +1376,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
                 ((NetworkMigrationResponder)guru).commitMigration(nicSrc, network, src, src_context, dst_context);
             }
             List<Provider> providersToImplement = getNetworkProviders(network.getId());
-            for (NetworkElement element : _networkElements) {
+            for (NetworkElement element : networkElements) {
                 if (providersToImplement.contains(element.getProvider())) {
                     if (!_networkModel.isProviderEnabledInPhysicalNetwork(_networkModel.getPhysicalNetworkId(network), element.getProvider().getName())) {
                         throw new CloudRuntimeException("Service provider " + element.getProvider().getName() +
@@ -1400,7 +1398,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
     public void rollbackNicForMigration(VirtualMachineProfile src, VirtualMachineProfile dst) {
         for (NicProfile nicDst : dst.getNics()) {
             NetworkVO network = _networksDao.findById(nicDst.getNetworkId());
-            NetworkGuru guru = AdapterBase.getAdapterByName(_networkGurus, network.getGuruName());
+            NetworkGuru guru = AdapterBase.getAdapterByName(networkGurus, network.getGuruName());
             NicProfile nicSrc = findNicProfileById(src, nicDst.getId());
             ReservationContext src_context = new ReservationContextImpl(nicSrc.getReservationId(), null, null);
             ReservationContext dst_context = new ReservationContextImpl(nicDst.getReservationId(), null, null);
@@ -1409,7 +1407,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
                 ((NetworkMigrationResponder)guru).rollbackMigration(nicDst, network, dst, src_context, dst_context);
             }
             List<Provider> providersToImplement = getNetworkProviders(network.getId());
-            for (NetworkElement element : _networkElements) {
+            for (NetworkElement element : networkElements) {
                 if (providersToImplement.contains(element.getProvider())) {
                     if (!_networkModel.isProviderEnabledInPhysicalNetwork(_networkModel.getPhysicalNetworkId(network), element.getProvider().getName())) {
                         throw new CloudRuntimeException("Service provider " + element.getProvider().getName() +
@@ -1453,7 +1451,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
 
                 if (originalState == Nic.State.Reserved || originalState == Nic.State.Reserving) {
                     if (nic.getReservationStrategy() == Nic.ReservationStrategy.Start) {
-                        NetworkGuru guru = AdapterBase.getAdapterByName(_networkGurus, network.getGuruName());
+                        NetworkGuru guru = AdapterBase.getAdapterByName(networkGurus, network.getGuruName());
                         nic.setState(Nic.State.Releasing);
                         _nicDao.update(nic.getId(), nic);
                         NicProfile profile =
@@ -1484,7 +1482,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
             Network network = networkToRelease.first();
             NicProfile profile = networkToRelease.second();
             List<Provider> providersToImplement = getNetworkProviders(network.getId());
-            for (NetworkElement element : _networkElements) {
+            for (NetworkElement element : networkElements) {
                 if (providersToImplement.contains(element.getProvider())) {
                     if (!_networkModel.isProviderEnabledInPhysicalNetwork(_networkModel.getPhysicalNetworkId(network), element.getProvider().getName())) {
                         throw new CloudRuntimeException("Service provider " + element.getProvider().getName() +
@@ -1532,7 +1530,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
          */
         if (nic.getReservationStrategy() == Nic.ReservationStrategy.Create) {
             List<Provider> providersToImplement = getNetworkProviders(network.getId());
-            for (NetworkElement element : _networkElements) {
+            for (NetworkElement element : networkElements) {
                 if (providersToImplement.contains(element.getProvider())) {
                     if (!_networkModel.isProviderEnabledInPhysicalNetwork(_networkModel.getPhysicalNetworkId(network), element.getProvider().getName())) {
                         throw new CloudRuntimeException("Service provider " + element.getProvider().getName() +
@@ -1557,7 +1555,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
             network.getGuestType() == GuestType.Shared) {
             removeDhcpServiceInSubnet(nic);
         }
-        NetworkGuru guru = AdapterBase.getAdapterByName(_networkGurus, network.getGuruName());
+        NetworkGuru guru = AdapterBase.getAdapterByName(networkGurus, network.getGuruName());
         guru.deallocate(network, profile, vm);
         _nicDao.remove(nic.getId());
         s_logger.debug("Removed nic id=" + nic.getId());
@@ -1989,7 +1987,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
                         if (s_logger.isDebugEnabled()) {
                             s_logger.debug("Network id=" + networkId + " is shutdown successfully, cleaning up corresponding resources now.");
                         }
-                        NetworkGuru guru = AdapterBase.getAdapterByName(_networkGurus, networkFinal.getGuruName());
+                        NetworkGuru guru = AdapterBase.getAdapterByName(networkGurus, networkFinal.getGuruName());
                         NetworkProfile profile = convertNetworkToNetworkProfile(networkFinal.getId());
                         guru.shutdown(profile, _networkOfferingDao.findById(networkFinal.getNetworkOfferingId()));
 
@@ -2053,7 +2051,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
         // get providers to shutdown
         List<Provider> providersToShutdown = getNetworkProviders(network.getId());
         boolean success = true;
-        for (NetworkElement element : _networkElements) {
+        for (NetworkElement element : networkElements) {
             if (providersToShutdown.contains(element.getProvider())) {
                 try {
                     if (!_networkModel.isProviderEnabledInPhysicalNetwork(_networkModel.getPhysicalNetworkId(network), element.getProvider().getName())) {
@@ -2141,7 +2139,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
 
         // get providers to destroy
         List<Provider> providersToDestroy = getNetworkProviders(network.getId());
-        for (NetworkElement element : _networkElements) {
+        for (NetworkElement element : networkElements) {
             if (providersToDestroy.contains(element.getProvider())) {
                 try {
                     if (!_networkModel.isProviderEnabledInPhysicalNetwork(_networkModel.getPhysicalNetworkId(network), element.getProvider().getName())) {
@@ -2181,7 +2179,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
                 Transaction.execute(new TransactionCallbackNoReturn() {
                     @Override
                     public void doInTransactionWithoutResult(TransactionStatus status) {
-                        NetworkGuru guru = AdapterBase.getAdapterByName(_networkGurus, networkFinal.getGuruName());
+                        NetworkGuru guru = AdapterBase.getAdapterByName(networkGurus, networkFinal.getGuruName());
 
                         guru.trash(networkFinal, _networkOfferingDao.findById(networkFinal.getNetworkOfferingId()));
 
@@ -2405,7 +2403,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
     @Override
     public NetworkProfile convertNetworkToNetworkProfile(long networkId) {
         NetworkVO network = _networksDao.findById(networkId);
-        NetworkGuru guru = AdapterBase.getAdapterByName(_networkGurus, network.getGuruName());
+        NetworkGuru guru = AdapterBase.getAdapterByName(networkGurus, network.getGuruName());
         NetworkProfile profile = new NetworkProfile(network);
         guru.updateNetworkProfile(profile);
 
@@ -2696,8 +2694,8 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
         try {
             // delete default egress rule
             DataCenter zone = _dcDao.findById(network.getDataCenterId());
-            if ( _networkModel.areServicesSupportedInNetwork(network.getId(), Service.Firewall) &&
-                    (network.getGuestType() == Network.GuestType.Isolated || (network.getGuestType() == Network.GuestType.Shared && zone.getNetworkType() == NetworkType.Advanced))) {
+            if (_networkModel.areServicesSupportedInNetwork(network.getId(), Service.Firewall) &&
+                (network.getGuestType() == Network.GuestType.Isolated || (network.getGuestType() == Network.GuestType.Shared && zone.getNetworkType() == NetworkType.Advanced))) {
                 // add default egress rule to accept the traffic
                 _firewallMgr.applyDefaultEgressFirewallRule(network.getId(), _networkModel.getNetworkEgressDefaultPolicy(networkId), false);
             }
@@ -2707,7 +2705,6 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
             success = false;
         }
 
-
         for (FirewallRuleVO firewallRule : firewallEgressRules) {
             s_logger.trace("Marking firewall egress rule " + firewallRule + " with Revoke state");
             firewallRule.setState(FirewallRule.State.Revoke);
@@ -3012,7 +3009,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
                 NetworkVO network = _networksDao.findById(nic.getNetworkId());
                 Integer networkRate = _networkModel.getNetworkRate(network.getId(), vm.getId());
 
-                NetworkGuru guru = AdapterBase.getAdapterByName(_networkGurus, network.getGuruName());
+                NetworkGuru guru = AdapterBase.getAdapterByName(networkGurus, network.getGuruName());
                 NicProfile profile =
                     new NicProfile(nic, network, nic.getBroadcastUri(), nic.getIsolationUri(), networkRate, _networkModel.isSecurityGroupSupportedInNetwork(network),
                         _networkModel.getNetworkTag(vm.getHypervisorType(), network));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
index 7b0d968..efaa288 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
@@ -149,8 +149,8 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         return _storagePoolAllocators;
     }
 
-    public void setStoragePoolAllocators(List<StoragePoolAllocator> _storagePoolAllocators) {
-        this._storagePoolAllocators = _storagePoolAllocators;
+    public void setStoragePoolAllocators(List<StoragePoolAllocator> storagePoolAllocators) {
+        this._storagePoolAllocators = storagePoolAllocators;
     }
 
     protected List<PodAllocator> _podAllocators;
@@ -159,8 +159,8 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         return _podAllocators;
     }
 
-    public void setPodAllocators(List<PodAllocator> _podAllocators) {
-        this._podAllocators = _podAllocators;
+    public void setPodAllocators(List<PodAllocator> podAllocators) {
+        this._podAllocators = podAllocators;
     }
 
     protected VolumeOrchestrator() {
@@ -254,7 +254,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
     @DB
     @Override
     public VolumeInfo createVolumeFromSnapshot(Volume volume, Snapshot snapshot, UserVm vm)
-            throws StorageUnavailableException {
+        throws StorageUnavailableException {
         Account account = _entityMgr.findById(Account.class, volume.getAccountId());
 
         final HashSet<StoragePool> poolsToAvoid = new HashSet<StoragePool>();
@@ -269,27 +269,28 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
 
         String msg = "There are no available storage pools to store the volume in";
 
-        if(vm != null){
+        if (vm != null) {
             Pod podofVM = _entityMgr.findById(Pod.class, vm.getPodIdToDeployIn());
-            if(podofVM != null){
+            if (podofVM != null) {
                 pod = new Pair<Pod, Long>(podofVM, podofVM.getId());
             }
         }
 
-        if(vm != null && pod != null){
+        if (vm != null && pod != null) {
             //if VM is running use the hostId to find the clusterID. If it is stopped, refer the cluster where the ROOT volume of the VM exists.
             Long hostId = null;
             Long clusterId = null;
-            if(vm.getState() == State.Running){
+            if (vm.getState() == State.Running) {
                 hostId = vm.getHostId();
-                if(hostId != null){
+                if (hostId != null) {
                     Host vmHost = _entityMgr.findById(Host.class, hostId);
                     clusterId = vmHost.getClusterId();
                 }
-            }else{
+            } else {
                 List<VolumeVO> rootVolumesOfVm = _volsDao.findByInstanceAndType(vm.getId(), Volume.Type.ROOT);
                 if (rootVolumesOfVm.size() != 1) {
-                    throw new CloudRuntimeException("The VM " + vm.getHostName() + " has more than one ROOT volume and is in an invalid state. Please contact Cloud Support.");
+                    throw new CloudRuntimeException("The VM " + vm.getHostName() +
+                        " has more than one ROOT volume and is in an invalid state. Please contact Cloud Support.");
                 } else {
                     VolumeVO rootVolumeOfVm = rootVolumesOfVm.get(0);
                     StoragePoolVO rootDiskPool = _storagePoolDao.findById(rootVolumeOfVm.getPoolId());
@@ -303,15 +304,15 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
 
             if (pool == null) {
                 //pool could not be found in the VM's pod/cluster.
-                if(s_logger.isDebugEnabled()){
-                    s_logger.debug("Could not find any storage pool to create Volume in the pod/cluster of the provided VM "+vm.getUuid());
+                if (s_logger.isDebugEnabled()) {
+                    s_logger.debug("Could not find any storage pool to create Volume in the pod/cluster of the provided VM " + vm.getUuid());
                 }
                 StringBuilder addDetails = new StringBuilder(msg);
                 addDetails.append(", Could not find any storage pool to create Volume in the pod/cluster of the VM ");
                 addDetails.append(vm.getUuid());
                 msg = addDetails.toString();
             }
-        }else{
+        } else {
             // Determine what pod to store the volume in
             while ((pod = findPod(null, null, dc, account.getId(), podsToAvoid)) != null) {
                 podsToAvoid.add(pod.first().getId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/orchestration/test/com/cloud/vm/VirtualMachineManagerImplTest.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/test/com/cloud/vm/VirtualMachineManagerImplTest.java b/engine/orchestration/test/com/cloud/vm/VirtualMachineManagerImplTest.java
index 2c308f0..997855d 100644
--- a/engine/orchestration/test/com/cloud/vm/VirtualMachineManagerImplTest.java
+++ b/engine/orchestration/test/com/cloud/vm/VirtualMachineManagerImplTest.java
@@ -34,7 +34,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Matchers;
 import org.mockito.Mock;
-import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
 import org.mockito.Spy;
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/schema/src/com/cloud/alert/AlertVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/alert/AlertVO.java b/engine/schema/src/com/cloud/alert/AlertVO.java
index ade505d..70ef469 100755
--- a/engine/schema/src/com/cloud/alert/AlertVO.java
+++ b/engine/schema/src/com/cloud/alert/AlertVO.java
@@ -72,8 +72,8 @@ public class AlertVO implements Alert {
 
     @Column(name = "archived")
     private boolean archived;
-    
-    @Column(name="name")
+
+    @Column(name = "name")
     private String name;
 
     public AlertVO() {
@@ -188,7 +188,6 @@ public class AlertVO implements Alert {
         return name;
     }
 
-
     public void setName(String name) {
         this.name = name;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/schema/src/com/cloud/alert/dao/AlertDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/alert/dao/AlertDao.java b/engine/schema/src/com/cloud/alert/dao/AlertDao.java
index 89128b4..e61092e 100755
--- a/engine/schema/src/com/cloud/alert/dao/AlertDao.java
+++ b/engine/schema/src/com/cloud/alert/dao/AlertDao.java
@@ -28,9 +28,9 @@ public interface AlertDao extends GenericDao<AlertVO, Long> {
     // This is for backward compatibility
     AlertVO getLastAlert(short type, long dataCenterId, Long podId);
 
-    public boolean deleteAlert(List<Long> Ids, String type, Date startDate, Date endDate, Long zoneId);
+    public boolean deleteAlert(List<Long> ids, String type, Date startDate, Date endDate, Long zoneId);
 
-    public boolean archiveAlert(List<Long> Ids, String type, Date startDate, Date endDate, Long zoneId);
+    public boolean archiveAlert(List<Long> ids, String type, Date startDate, Date endDate, Long zoneId);
 
     public List<AlertVO> listOlderAlerts(Date oldTime);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/schema/src/com/cloud/alert/dao/AlertDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/alert/dao/AlertDaoImpl.java b/engine/schema/src/com/cloud/alert/dao/AlertDaoImpl.java
index f830403..865b8d1 100755
--- a/engine/schema/src/com/cloud/alert/dao/AlertDaoImpl.java
+++ b/engine/schema/src/com/cloud/alert/dao/AlertDaoImpl.java
@@ -90,11 +90,11 @@ public class AlertDaoImpl extends GenericDaoBase<AlertVO, Long> implements Alert
     }
 
     @Override
-    public boolean archiveAlert(List<Long> Ids, String type, Date startDate, Date endDate, Long zoneId) {
+    public boolean archiveAlert(List<Long> ids, String type, Date startDate, Date endDate, Long zoneId) {
         SearchCriteria<AlertVO> sc = AlertSearchByIdsAndType.create();
 
-        if (Ids != null) {
-            sc.setParameters("id", Ids.toArray(new Object[Ids.size()]));
+        if (ids != null) {
+            sc.setParameters("id", ids.toArray(new Object[ids.size()]));
         }
         if (type != null) {
             sc.setParameters("type", type);
@@ -112,7 +112,7 @@ public class AlertDaoImpl extends GenericDaoBase<AlertVO, Long> implements Alert
         boolean result = true;
         ;
         List<AlertVO> alerts = listBy(sc);
-        if (Ids != null && alerts.size() < Ids.size()) {
+        if (ids != null && alerts.size() < ids.size()) {
             result = false;
             return result;
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/schema/src/com/cloud/capacity/dao/CapacityDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/capacity/dao/CapacityDao.java b/engine/schema/src/com/cloud/capacity/dao/CapacityDao.java
index 079d9a8..a900e64 100755
--- a/engine/schema/src/com/cloud/capacity/dao/CapacityDao.java
+++ b/engine/schema/src/com/cloud/capacity/dao/CapacityDao.java
@@ -46,11 +46,14 @@ public interface CapacityDao extends GenericDao<CapacityVO, Long> {
     Pair<List<Long>, Map<Long, Double>> orderPodsByAggregateCapacity(long zoneId, short capacityType);
 
     List<SummedCapacity> findCapacityBy(Integer capacityType, Long zoneId,
-            Long podId, Long clusterId, String resourceState);
-    List<SummedCapacity> listCapacitiesGroupedByLevelAndType(Integer capacityType, Long zoneId, Long podId, Long clusterId, int level, Long limit);  
+        Long podId, Long clusterId, String resourceState);
+
+    List<SummedCapacity> listCapacitiesGroupedByLevelAndType(Integer capacityType, Long zoneId, Long podId, Long clusterId, int level, Long limit);
+
     void updateCapacityState(Long dcId, Long podId, Long clusterId,
-            Long hostId, String capacityState);
-	List<Long> listClustersCrossingThreshold(short capacityType, Long zoneId, String ConfigName, long computeRequested);
+        Long hostId, String capacityState);
+
+    List<Long> listClustersCrossingThreshold(short capacityType, Long zoneId, String configName, long computeRequested);
 
     float findClusterConsumption(Long clusterId, short capacityType, long computeRequested);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java b/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
index 7919ed5..b7784f2 100755
--- a/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
+++ b/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
@@ -27,9 +27,6 @@ import java.util.Map;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import com.cloud.dc.ClusterDetailsDao;
-import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
-import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
@@ -165,23 +162,29 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
     *
     *     */
 
-    private static final String LIST_CLUSTERS_CROSSING_THRESHOLD = "SELECT clusterList.cluster_id " +
-                       "FROM (	SELECT cluster.cluster_id cluster_id, ( (sum(cluster.used) + sum(cluster.reserved) + ?)/sum(cluster.total) ) ratio, cluster.configValue value " +
-                                "FROM (	SELECT capacity.cluster_id cluster_id, capacity.used_capacity used, capacity.reserved_capacity reserved, capacity.total_capacity * overcommit.value total, " +
-                                            "CASE (SELECT count(*) FROM `cloud`.`cluster_details` details WHERE details.cluster_id = capacity.cluster_id AND details.name = ? ) " +
-                                                "WHEN 1 THEN (	CASE WHEN (SELECT details.value FROM `cloud`.`cluster_details` details WHERE details.cluster_id = capacity.cluster_id AND details.name = ?) is NULL " +
-                                                                    "THEN (SELECT config.value FROM `cloud`.`configuration` config WHERE config.name = ?)" +
-                                                                    "ELSE (SELECT details.value FROM `cloud`.`cluster_details` details WHERE details.cluster_id = capacity.cluster_id AND details.name = ? ) END )"  +
-                                                "ELSE (	SELECT config.value FROM `cloud`.`configuration` config WHERE config.name = ?) " +
-                                            "END configValue " +
-                                        "FROM `cloud`.`op_host_capacity` capacity INNER JOIN `cloud`.`cluster_details` overcommit ON overcommit.cluster_id = capacity.cluster_id " +
-                                        "WHERE capacity.data_center_id = ? AND capacity.capacity_type = ? AND capacity.total_capacity > 0 AND overcommit.name = ?) cluster " +
-
-                                "GROUP BY cluster.cluster_id)  clusterList " +
-                        "WHERE clusterList.ratio > clusterList.value; ";
-
-    private static final String  FIND_CLUSTER_CONSUMPTION_RATIO = "select ( (sum(capacity.used_capacity) + sum(capacity.reserved_capacity) + ?)/sum(capacity.total_capacity) ) " +
-            "from op_host_capacity capacity where cluster_id = ? and capacity_type = ?;";
+    private static final String LIST_CLUSTERS_CROSSING_THRESHOLD = "SELECT clusterList.cluster_id "
+        +
+        "FROM (SELECT cluster.cluster_id cluster_id, ( (sum(cluster.used) + sum(cluster.reserved) + ?)/sum(cluster.total) ) ratio, cluster.configValue value "
+        +
+        "FROM (SELECT capacity.cluster_id cluster_id, capacity.used_capacity used, capacity.reserved_capacity reserved, capacity.total_capacity * overcommit.value total, "
+        +
+        "CASE (SELECT count(*) FROM `cloud`.`cluster_details` details WHERE details.cluster_id = capacity.cluster_id AND details.name = ? ) "
+        +
+        "WHEN 1 THEN (CASE WHEN (SELECT details.value FROM `cloud`.`cluster_details` details WHERE details.cluster_id = capacity.cluster_id AND details.name = ?) is NULL "
+        +
+        "THEN (SELECT config.value FROM `cloud`.`configuration` config WHERE config.name = ?)" +
+        "ELSE (SELECT details.value FROM `cloud`.`cluster_details` details WHERE details.cluster_id = capacity.cluster_id AND details.name = ? ) END )" +
+        "ELSE (SELECT config.value FROM `cloud`.`configuration` config WHERE config.name = ?) " +
+        "END configValue " +
+        "FROM `cloud`.`op_host_capacity` capacity INNER JOIN `cloud`.`cluster_details` overcommit ON overcommit.cluster_id = capacity.cluster_id " +
+        "WHERE capacity.data_center_id = ? AND capacity.capacity_type = ? AND capacity.total_capacity > 0 AND overcommit.name = ?) cluster " +
+
+        "GROUP BY cluster.cluster_id)  clusterList " +
+        "WHERE clusterList.ratio > clusterList.value; ";
+
+    private static final String FIND_CLUSTER_CONSUMPTION_RATIO = "select ( (sum(capacity.used_capacity) + sum(capacity.reserved_capacity) + ?)/sum(capacity.total_capacity) ) "
+        +
+        "from op_host_capacity capacity where cluster_id = ? and capacity_type = ?;";
 
     public CapacityDaoImpl() {
         _hostIdTypeSearch = createSearchBuilder();
@@ -206,7 +209,7 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
     }
 
     @Override
-    public List<Long> listClustersCrossingThreshold(short capacityType, Long zoneId, String configName, long compute_requested) {
+    public List<Long> listClustersCrossingThreshold(short capacityType, Long zoneId, String configName, long computeRequested) {
 
         TransactionLegacy txn = TransactionLegacy.currentTxn();
         PreparedStatement pstmt = null;
@@ -216,7 +219,7 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
         // we need to check with disabled thresholds of each cluster if not defined at cluster consider the global value
         try {
             pstmt = txn.prepareAutoCloseStatement(sql.toString());
-            pstmt.setLong(1, compute_requested);
+            pstmt.setLong(1, computeRequested);
             pstmt.setString(2, configName);
             pstmt.setString(3, configName);
             pstmt.setString(4, configName);
@@ -260,7 +263,7 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
     }*/
 
     @Override
-    public List<SummedCapacity> findCapacityBy(Integer capacityType, Long zoneId, Long podId, Long clusterId, String resource_state) {
+    public List<SummedCapacity> findCapacityBy(Integer capacityType, Long zoneId, Long podId, Long clusterId, String resourceState) {
 
         TransactionLegacy txn = TransactionLegacy.currentTxn();
         PreparedStatement pstmt = null;
@@ -288,10 +291,10 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
 
         try {
             pstmt = txn.prepareAutoCloseStatement(sql.toString());
-            pstmt.setString(1, resource_state);
-            pstmt.setString(2, resource_state);
-            pstmt.setString(3, resource_state);
-            pstmt.setString(4, resource_state);
+            pstmt.setString(1, resourceState);
+            pstmt.setString(2, resourceState);
+            pstmt.setString(3, resourceState);
+            pstmt.setString(4, resourceState);
             for (int i = 0; i < resourceIdList.size(); i++) {
                 pstmt.setLong(5 + i, resourceIdList.get(i));
             }
@@ -893,7 +896,7 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
     }
 
     @Override
-    public float findClusterConsumption(Long clusterId, short capacityType, long computeRequested){
+    public float findClusterConsumption(Long clusterId, short capacityType, long computeRequested) {
         TransactionLegacy txn = TransactionLegacy.currentTxn();
         StringBuilder sql = new StringBuilder(FIND_CLUSTER_CONSUMPTION_RATIO);
         PreparedStatement pstmt = null;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java b/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java
index 9c6b553..a355a9c 100755
--- a/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java
+++ b/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java
@@ -70,7 +70,7 @@ public class DataCenterDaoImpl extends GenericDaoBase<DataCenterVO, Long> implem
     @Inject
     protected DataCenterIpAddressDao _ipAllocDao = null;
     @Inject
-    protected DataCenterLinkLocalIpAddressDao _LinkLocalIpAllocDao = null;
+    protected DataCenterLinkLocalIpAddressDao _linkLocalIpAllocDao = null;
     @Inject
     protected DataCenterVnetDao _vnetAllocDao = null;
     @Inject
@@ -179,12 +179,12 @@ public class DataCenterDaoImpl extends GenericDaoBase<DataCenterVO, Long> implem
 
     @Override
     public void releaseLinkLocalIpAddress(long nicId, String reservationId) {
-        _LinkLocalIpAllocDao.releaseIpAddress(nicId, reservationId);
+        _linkLocalIpAllocDao.releaseIpAddress(nicId, reservationId);
     }
 
     @Override
     public void releaseLinkLocalIpAddress(String ipAddress, long dcId, Long instanceId) {
-        _LinkLocalIpAllocDao.releaseIpAddress(ipAddress, dcId, instanceId);
+        _linkLocalIpAllocDao.releaseIpAddress(ipAddress, dcId, instanceId);
     }
 
     @Override
@@ -194,7 +194,7 @@ public class DataCenterDaoImpl extends GenericDaoBase<DataCenterVO, Long> implem
 
     @Override
     public boolean deleteLinkLocalIpAddressByPod(long podId) {
-        return _LinkLocalIpAllocDao.deleteIpAddressByPod(podId);
+        return _linkLocalIpAllocDao.deleteIpAddressByPod(podId);
     }
 
     @Override
@@ -265,7 +265,7 @@ public class DataCenterDaoImpl extends GenericDaoBase<DataCenterVO, Long> implem
 
     @Override
     public String allocateLinkLocalIpAddress(long dcId, long podId, long instanceId, String reservationId) {
-        DataCenterLinkLocalIpAddressVO vo = _LinkLocalIpAllocDao.takeIpAddress(dcId, podId, instanceId, reservationId);
+        DataCenterLinkLocalIpAddressVO vo = _linkLocalIpAllocDao.takeIpAddress(dcId, podId, instanceId, reservationId);
         if (vo == null) {
             return null;
         }
@@ -294,7 +294,7 @@ public class DataCenterDaoImpl extends GenericDaoBase<DataCenterVO, Long> implem
 
     @Override
     public void addLinkLocalIpAddress(long dcId, long podId, String start, String end) {
-        _LinkLocalIpAllocDao.addIpRange(dcId, podId, start, end);
+        _linkLocalIpAllocDao.addIpRange(dcId, podId, start, end);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/schema/src/com/cloud/event/dao/UsageEventDetailsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/event/dao/UsageEventDetailsDaoImpl.java b/engine/schema/src/com/cloud/event/dao/UsageEventDetailsDaoImpl.java
index 2126fff..e959d08 100644
--- a/engine/schema/src/com/cloud/event/dao/UsageEventDetailsDaoImpl.java
+++ b/engine/schema/src/com/cloud/event/dao/UsageEventDetailsDaoImpl.java
@@ -98,7 +98,7 @@ public class UsageEventDetailsDaoImpl extends GenericDaoBase<UsageEventDetailsVO
 
         } catch (SQLException e) {
             throw new CloudRuntimeException("Error while executing SQL prepared statement", e);
-        }  catch (Throwable e) {
+        } catch (Throwable e) {
             throw new CloudRuntimeException("Caught: " + e);
         } finally {
             if (pstmt != null) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/schema/src/com/cloud/network/as/AutoScalePolicyVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/as/AutoScalePolicyVO.java b/engine/schema/src/com/cloud/network/as/AutoScalePolicyVO.java
index 6a104c2..b69907c 100644
--- a/engine/schema/src/com/cloud/network/as/AutoScalePolicyVO.java
+++ b/engine/schema/src/com/cloud/network/as/AutoScalePolicyVO.java
@@ -59,9 +59,9 @@ public class AutoScalePolicyVO implements AutoScalePolicy, InternalIdentity {
     @Column(name = "quiet_time", updatable = true, nullable = false)
     private int quietTime;
 
-	@Column(name = "last_quiet_time", updatable = true)
-	@Temporal(value = TemporalType.TIMESTAMP)
-	private Date lastQuiteTime;
+    @Column(name = "last_quiet_time", updatable = true)
+    @Temporal(value = TemporalType.TIMESTAMP)
+    private Date lastQuiteTime;
 
     @Column(name = "action", updatable = false, nullable = false)
     private String action;
@@ -75,14 +75,14 @@ public class AutoScalePolicyVO implements AutoScalePolicy, InternalIdentity {
     public AutoScalePolicyVO() {
     }
 
-	public AutoScalePolicyVO(long domainId, long accountId, int duration,
-			int quietTime, Date lastQuiteTime, String action) {
+    public AutoScalePolicyVO(long domainId, long accountId, int duration,
+            int quietTime, Date lastQuiteTime, String action) {
         this.uuid = UUID.randomUUID().toString();
         this.domainId = domainId;
         this.accountId = accountId;
         this.duration = duration;
         this.quietTime = quietTime;
-		this.lastQuiteTime = lastQuiteTime;
+        this.lastQuiteTime = lastQuiteTime;
         this.action = action;
     }
 
@@ -121,10 +121,10 @@ public class AutoScalePolicyVO implements AutoScalePolicy, InternalIdentity {
         return quietTime;
     }
 
-	@Override
-	public Date getLastQuiteTime() {
-		return lastQuiteTime;
-	}
+    @Override
+    public Date getLastQuiteTime() {
+        return lastQuiteTime;
+    }
 
     @Override
     public String getAction() {
@@ -147,7 +147,7 @@ public class AutoScalePolicyVO implements AutoScalePolicy, InternalIdentity {
         this.quietTime = quietTime;
     }
 
-	public void setLastQuiteTime(Date lastQuiteTime) {
-		this.lastQuiteTime = lastQuiteTime;
-	}
+    public void setLastQuiteTime(Date lastQuiteTime) {
+        this.lastQuiteTime = lastQuiteTime;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/engine/schema/src/com/cloud/network/as/AutoScaleVmGroupVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/as/AutoScaleVmGroupVO.java b/engine/schema/src/com/cloud/network/as/AutoScaleVmGroupVO.java
index 4d41583..d8612b0 100644
--- a/engine/schema/src/com/cloud/network/as/AutoScaleVmGroupVO.java
+++ b/engine/schema/src/com/cloud/network/as/AutoScaleVmGroupVO.java
@@ -71,9 +71,9 @@ public class AutoScaleVmGroupVO implements AutoScaleVmGroup, InternalIdentity {
     @Column(name = "interval")
     private int interval;
 
-	@Column(name = "last_interval", updatable = true)
-	@Temporal(value = TemporalType.TIMESTAMP)
-	private Date lastInterval;
+    @Column(name = "last_interval", updatable = true)
+    @Temporal(value = TemporalType.TIMESTAMP)
+    private Date lastInterval;
 
     @Column(name = "profile_id")
     private long profileId;
@@ -90,9 +90,9 @@ public class AutoScaleVmGroupVO implements AutoScaleVmGroup, InternalIdentity {
     public AutoScaleVmGroupVO() {
     }
 
-	public AutoScaleVmGroupVO(long lbRuleId, long zoneId, long domainId,
-			long accountId, int minMembers, int maxMembers, int memberPort,
-			int interval, Date lastInterval, long profileId, String state) {
+    public AutoScaleVmGroupVO(long lbRuleId, long zoneId, long domainId,
+            long accountId, int minMembers, int maxMembers, int memberPort,
+            int interval, Date lastInterval, long profileId, String state) {
 
         this.uuid = UUID.randomUUID().toString();
         this.loadBalancerId = lbRuleId;
@@ -105,7 +105,7 @@ public class AutoScaleVmGroupVO implements AutoScaleVmGroup, InternalIdentity {
         this.zoneId = zoneId;
         this.state = state;
         this.interval = interval;
-		this.lastInterval = lastInterval;
+        this.lastInterval = lastInterval;
     }
 
     @Override
@@ -157,10 +157,10 @@ public class AutoScaleVmGroupVO implements AutoScaleVmGroup, InternalIdentity {
         return interval;
     }
 
-	@Override
-	public Date getLastInterval() {
-		return lastInterval;
-	}
+    @Override
+    public Date getLastInterval() {
+        return lastInterval;
+    }
 
     @Override
     public long getProfileId() {
@@ -196,9 +196,9 @@ public class AutoScaleVmGroupVO implements AutoScaleVmGroup, InternalIdentity {
         this.interval = interval;
     }
 
-	public void setLastInterval(Date lastInterval) {
-		this.lastInterval = lastInterval;
-	}
+    public void setLastInterval(Date lastInterval) {
+        this.lastInterval = lastInterval;
+    }
 
     public void setLoadBalancerId(Long loadBalancerId) {
         this.loadBalancerId = loadBalancerId;


Mime
View raw message