cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [10/48] All Checkstyle problems corrected
Date Thu, 12 Dec 2013 21:01:10 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java
index cf4a1c5..b7ffe26 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -294,19 +294,19 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
     @Inject
     InternalLoadBalancerElementService _internalLbElementSvc;
     @Inject
-    DataCenterVnetDao _datacneter_vnet;
+    DataCenterVnetDao _datacneterVnet;
     @Inject
     AccountGuestVlanMapDao _accountGuestVlanMapDao;
     @Inject
     VpcDao _vpcDao;
     @Inject
     NetworkACLDao _networkACLDao;
-	@Inject
-	OvsProviderDao _ovsProviderDao;
-	@Inject
-	IpAddressManager _ipAddrMgr;
-	@Inject
-	EntityManager _entityMgr;
+    @Inject
+    OvsProviderDao _ovsProviderDao;
+    @Inject
+    IpAddressManager _ipAddrMgr;
+    @Inject
+    EntityManager _entityMgr;
 
     int _cidrLimit;
     boolean _allowSubdomainNetworkAccess;
@@ -1599,11 +1599,11 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
         //Most likely pageSize will never exceed int value, and we need integer to partition the listToReturn
         boolean notNull = cmd.getStartIndex() != null && cmd.getPageSizeVal() != null;
         if (notNull && cmd.getStartIndex() <= Integer.MAX_VALUE && cmd.getStartIndex() >= Integer.MIN_VALUE &&
-                cmd.getPageSizeVal() <= Integer.MAX_VALUE && cmd.getPageSizeVal() >= Integer.MIN_VALUE) {
+            cmd.getPageSizeVal() <= Integer.MAX_VALUE && cmd.getPageSizeVal() >= Integer.MIN_VALUE) {
             int startIndex = cmd.getStartIndex().intValue() == 0 ? 0 : cmd.getStartIndex().intValue() - 1;
             List<NetworkVO> wPagination = new ArrayList<NetworkVO>();
             List<List<NetworkVO>> partitions = partitionNetworks(networksToReturn, cmd.getPageSizeVal().intValue());
-            if (startIndex< partitions.size()) {
+            if (startIndex < partitions.size()) {
                 wPagination = partitions.get(startIndex);
             }
             return wPagination;
@@ -1613,15 +1613,15 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
     }
 
     private static List<List<NetworkVO>> partitionNetworks(List<NetworkVO> originalList,
-            int chunkSize) {
+        int chunkSize) {
         List<List<NetworkVO>> listOfChunks = new ArrayList<List<NetworkVO>>();
         for (int i = 0; i < originalList.size() / chunkSize; i++) {
             listOfChunks.add(originalList.subList(i * chunkSize, i * chunkSize
-                    + chunkSize));
+                + chunkSize));
         }
         if (originalList.size() % chunkSize != 0) {
             listOfChunks.add(originalList.subList(originalList.size()
-                    - originalList.size() % chunkSize, originalList.size()));
+                - originalList.size() % chunkSize, originalList.size()));
         }
         return listOfChunks;
     }
@@ -2540,7 +2540,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
         }
     }
 
-	@Override
+    @Override
     public Pair<List<? extends PhysicalNetwork>, Integer> searchPhysicalNetworks(Long id, Long zoneId, String keyword, Long startIndex, Long pageSize, String name) {
         Filter searchFilter = new Filter(PhysicalNetworkVO.class, "id", Boolean.TRUE, startIndex, pageSize);
         SearchCriteria<PhysicalNetworkVO> sc = _physicalNetworkDao.createSearchCriteria();
@@ -2639,7 +2639,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
             removeVnets = getVnetsToremove(network, vnetranges);
 
             //computing vnets to add
-            vnetsInDb.addAll(_datacneter_vnet.listVnetsByPhysicalNetworkAndDataCenter(network.getDataCenterId(), network.getId()));
+            vnetsInDb.addAll(_datacneterVnet.listVnetsByPhysicalNetworkAndDataCenter(network.getDataCenterId(), network.getId()));
             tempVnets.addAll(vnetsInDb);
             for (Pair<Integer, Integer> vlan : vnetranges) {
                 for (i = vlan.first(); i <= vlan.second(); i++) {
@@ -2681,7 +2681,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
                         s_logger.debug("removing vnet range " + removeVnetsFinal.toString() + " for the physicalNetwork id= " + network.getId() + " and zone id=" +
                             network.getDataCenterId() + " as a part of updatePhysicalNetwork call");
                         //deleteVnets  takes a list of strings to be removed. each string is a vnet.
-                        _datacneter_vnet.deleteVnets(TransactionLegacy.currentTxn(), network.getDataCenterId(), network.getId(), removeVnetsFinal);
+                        _datacneterVnet.deleteVnets(TransactionLegacy.currentTxn(), network.getDataCenterId(), network.getId(), removeVnetsFinal);
                     }
                     _physicalNetworkDao.update(network.getId(), network);
                 }
@@ -2717,7 +2717,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
                 // since adding a range adds each VNI to the database, need only check min/max
                 for (String vnet : VnetRange) {
                     s_logger.debug("Looking to see if VNI " + vnet + " already exists on another network in zone " + network.getDataCenterId());
-                    List<DataCenterVnetVO> vnis = _datacneter_vnet.findVnet(network.getDataCenterId(), vnet);
+                    List<DataCenterVnetVO> vnis = _datacneterVnet.findVnet(network.getDataCenterId(), vnet);
                     if (vnis != null && !vnis.isEmpty()) {
                         for (DataCenterVnetVO vni : vnis) {
                             if (vni.getPhysicalNetworkId() != network.getId()) {
@@ -2791,13 +2791,13 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
         int i;
         List<String> removeVnets = new ArrayList<String>();
         HashSet<String> vnetsInDb = new HashSet<String>();
-        vnetsInDb.addAll(_datacneter_vnet.listVnetsByPhysicalNetworkAndDataCenter(network.getDataCenterId(), network.getId()));
+        vnetsInDb.addAll(_datacneterVnet.listVnetsByPhysicalNetworkAndDataCenter(network.getDataCenterId(), network.getId()));
         //remove all the vnets from vnets in db to check if there are any vnets that are not there in given list.
         //remove all the vnets not in the list of vnets passed by the user.
         if (vnetRanges.size() == 0) {
             //this implies remove all vlans.
             removeVnets.addAll(vnetsInDb);
-            int allocated_vnets = _datacneter_vnet.countAllocatedVnets(network.getId());
+            int allocated_vnets = _datacneterVnet.countAllocatedVnets(network.getId());
             if (allocated_vnets > 0) {
                 throw new InvalidParameterValueException("physicalnetwork " + network.getId() + " has " + allocated_vnets + " vnets in use");
             }
@@ -2820,8 +2820,8 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
             String[] range = vnet.split("-");
             Integer start = Integer.parseInt(range[0]);
             Integer end = Integer.parseInt(range[1]);
-            _datacneter_vnet.lockRange(network.getDataCenterId(), network.getId(), start, end);
-            List<DataCenterVnetVO> result = _datacneter_vnet.listAllocatedVnetsInRange(network.getDataCenterId(), network.getId(), start, end);
+            _datacneterVnet.lockRange(network.getDataCenterId(), network.getId(), start, end);
+            List<DataCenterVnetVO> result = _datacneterVnet.listAllocatedVnetsInRange(network.getDataCenterId(), network.getId(), start, end);
             if (!result.isEmpty()) {
                 throw new InvalidParameterValueException("physicalnetwork " + network.getId() + " has allocated vnets in the range " + start + "-" + end);
 
@@ -3048,7 +3048,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
         // Verify guest vlans in the range don't belong to a network of a different account
         for (int i = startVlan; i <= endVlan; i++) {
             List<DataCenterVnetVO> allocatedVlans =
-                _datacneter_vnet.listAllocatedVnetsInRange(physicalNetwork.getDataCenterId(), physicalNetwork.getId(), startVlan, endVlan);
+                _datacneterVnet.listAllocatedVnetsInRange(physicalNetwork.getDataCenterId(), physicalNetwork.getId(), startVlan, endVlan);
             if (allocatedVlans != null && !allocatedVlans.isEmpty()) {
                 for (DataCenterVnetVO allocatedVlan : allocatedVlans) {
                     if (allocatedVlan.getAccountId() != vlanOwner.getAccountId()) {
@@ -3098,7 +3098,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
                     List<Integer> vlanTokens2 = getVlanFromRange(guestVlanMaps.get(i + 1).getGuestVlanRange());
                     // Range extends 2 vlan ranges, both to the right and left
                     if (endVlan == (vlanTokens2.get(0).intValue() - 1) & guestVlanMaps.get(i + 1).getAccountId() == vlanOwnerId) {
-                        _datacneter_vnet.releaseDedicatedGuestVlans(guestVlanMaps.get(i + 1).getId());
+                        _datacneterVnet.releaseDedicatedGuestVlans(guestVlanMaps.get(i + 1).getId());
                         _accountGuestVlanMapDao.remove(guestVlanMaps.get(i + 1).getId());
                         updatedVlanRange = vlanTokens1.get(0).intValue() + "-" + vlanTokens2.get(1).intValue();
                         break;
@@ -3122,9 +3122,9 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
         // For every guest vlan set the corresponding account guest vlan map id
         List<Integer> finaVlanTokens = getVlanFromRange(accountGuestVlanMapVO.getGuestVlanRange());
         for (int i = finaVlanTokens.get(0).intValue(); i <= finaVlanTokens.get(1).intValue(); i++) {
-            List<DataCenterVnetVO> dataCenterVnet = _datacneter_vnet.findVnet(physicalNetwork.getDataCenterId(), physicalNetworkId, ((Integer)i).toString());
+            List<DataCenterVnetVO> dataCenterVnet = _datacneterVnet.findVnet(physicalNetwork.getDataCenterId(), physicalNetworkId, ((Integer)i).toString());
             dataCenterVnet.get(0).setAccountGuestVlanMapId(accountGuestVlanMapVO.getId());
-            _datacneter_vnet.update(dataCenterVnet.get(0).getId(), dataCenterVnet.get(0));
+            _datacneterVnet.update(dataCenterVnet.get(0).getId(), dataCenterVnet.get(0));
         }
         return accountGuestVlanMapVO;
     }
@@ -3236,7 +3236,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
         }
 
         // Remove dedication for the guest vlan
-        _datacneter_vnet.releaseDedicatedGuestVlans(dedicatedGuestVlan.getId());
+        _datacneterVnet.releaseDedicatedGuestVlans(dedicatedGuestVlan.getId());
         if (_accountGuestVlanMapDao.remove(dedicatedGuestVlanRangeId)) {
             return true;
         } else {
@@ -3764,22 +3764,22 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
         return nsp;
     }
 
-	private PhysicalNetworkServiceProvider addDefaultOvsToPhysicalNetwork(long physicalNetworkId) {
-		PhysicalNetworkServiceProvider nsp = addProviderToPhysicalNetwork(physicalNetworkId, Network.Provider.Ovs.getName(), null, null);
-		NetworkElement networkElement = _networkModel.getElementImplementingProvider(Network.Provider.Ovs.getName());
-		if (networkElement == null) {
+    private PhysicalNetworkServiceProvider addDefaultOvsToPhysicalNetwork(long physicalNetworkId) {
+        PhysicalNetworkServiceProvider nsp = addProviderToPhysicalNetwork(physicalNetworkId, Network.Provider.Ovs.getName(), null, null);
+        NetworkElement networkElement = _networkModel.getElementImplementingProvider(Network.Provider.Ovs.getName());
+        if (networkElement == null) {
             throw new CloudRuntimeException("Unable to find the Network Element implementing the Ovs Provider");
         }
-		OvsProviderVO element = _ovsProviderDao.findByNspId(nsp.getId());
-		if (element != null) {
-			s_logger.debug("There is already a Ovs element with service provider id "
-					+ nsp.getId());
-			return nsp;
-		}
-		element = new OvsProviderVO(nsp.getId());
-		_ovsProviderDao.persist(element);
-		return nsp;
-	}
+        OvsProviderVO element = _ovsProviderDao.findByNspId(nsp.getId());
+        if (element != null) {
+            s_logger.debug("There is already a Ovs element with service provider id "
+                + nsp.getId());
+            return nsp;
+        }
+        element = new OvsProviderVO(nsp.getId());
+        _ovsProviderDao.persist(element);
+        return nsp;
+    }
 
     protected PhysicalNetworkServiceProvider addDefaultVpcVirtualRouterToPhysicalNetwork(long physicalNetworkId) {
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/server/src/com/cloud/network/NetworkUsageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkUsageManagerImpl.java b/server/src/com/cloud/network/NetworkUsageManagerImpl.java
index 021ae7f..e9b0393 100755
--- a/server/src/com/cloud/network/NetworkUsageManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkUsageManagerImpl.java
@@ -75,7 +75,6 @@ import com.cloud.resource.UnableDeleteHostException;
 import com.cloud.usage.UsageIPAddressVO;
 import com.cloud.user.Account;
 import com.cloud.user.AccountManager;
-import com.cloud.user.AccountVO;
 import com.cloud.user.UserStatisticsVO;
 import com.cloud.user.dao.UserStatisticsDao;
 import com.cloud.utils.NumbersUtil;
@@ -256,7 +255,7 @@ public class NetworkUsageManagerImpl extends ManagerBase implements NetworkUsage
 
         private int _interval;
 
-        private long mgmtSrvrId = MacAddress.getMacAddress().toLong();
+        private final long mgmtSrvrId = MacAddress.getMacAddress().toLong();
 
         protected DirectNetworkStatsListener(int interval) {
             _interval = interval;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/server/src/com/cloud/network/as/AutoScaleManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/as/AutoScaleManager.java b/server/src/com/cloud/network/as/AutoScaleManager.java
index 9c841d4..410fb8f 100644
--- a/server/src/com/cloud/network/as/AutoScaleManager.java
+++ b/server/src/com/cloud/network/as/AutoScaleManager.java
@@ -20,7 +20,7 @@ public interface AutoScaleManager extends AutoScaleService {
 
     void cleanUpAutoScaleResources(Long accountId);
 
-	void doScaleUp(long groupId, Integer numVm);
+    void doScaleUp(long groupId, Integer numVm);
 
-	void doScaleDown(long groupId);
+    void doScaleDown(long groupId);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/server/src/com/cloud/network/as/AutoScaleManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java b/server/src/com/cloud/network/as/AutoScaleManagerImpl.java
index fd415b1..0751b69 100644
--- a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java
+++ b/server/src/com/cloud/network/as/AutoScaleManagerImpl.java
@@ -174,10 +174,10 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
     UserVmService _userVmService;
     @Inject
     UserVmManager _userVmManager;
-    @Inject 
-    LoadBalancerVMMapDao _LbVmMapDao;
-    @Inject 
-	LoadBalancingRulesService _LoadBalancingRulesService;
+    @Inject
+    LoadBalancerVMMapDao _lbVmMapDao;
+    @Inject
+    LoadBalancingRulesService _loadBalancingRulesService;
 
     public List<AutoScaleCounter> getSupportedAutoScaleCounters(long networkid) {
         String capability = _lbRulesMgr.getLBCapability(networkid, Capability.AutoScaleCounters.getName());
@@ -739,7 +739,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
         }
 
         AutoScaleVmGroupVO vmGroupVO = new AutoScaleVmGroupVO(cmd.getLbRuleId(), zoneId, loadBalancer.getDomainId(), loadBalancer.getAccountId(), minMembers, maxMembers,
-                loadBalancer.getDefaultPortStart(), interval, null, cmd.getProfileId(), AutoScaleVmGroup.State_New);
+            loadBalancer.getDefaultPortStart(), interval, null, cmd.getProfileId(), AutoScaleVmGroup.State_New);
 
         vmGroupVO = checkValidityAndPersist(vmGroupVO, cmd.getScaleUpPolicyIds(), cmd.getScaleDownPolicyIds());
         s_logger.info("Successfully created Autoscale Vm Group with Id: " + vmGroupVO.getId());
@@ -1202,36 +1202,36 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
         }
     }
 
-	private boolean checkConditionUp(AutoScaleVmGroupVO asGroup, Integer numVm) {
-    	// check maximum
-		Integer currentVM = _autoScaleVmGroupVmMapDao.countByGroup(asGroup.getId());
-		Integer maxVm = asGroup.getMaxMembers();
-		if (currentVM + numVm > maxVm) {
-			s_logger.warn("number of VM will greater than the maximum in this group if scaling up, so do nothing more");
-			return false;
-		}
-		return true;
+    private boolean checkConditionUp(AutoScaleVmGroupVO asGroup, Integer numVm) {
+        // check maximum
+        Integer currentVM = _autoScaleVmGroupVmMapDao.countByGroup(asGroup.getId());
+        Integer maxVm = asGroup.getMaxMembers();
+        if (currentVM + numVm > maxVm) {
+            s_logger.warn("number of VM will greater than the maximum in this group if scaling up, so do nothing more");
+            return false;
+        }
+        return true;
     }
-	
-	private boolean checkConditionDown(AutoScaleVmGroupVO asGroup) {
-		Integer currentVM = _autoScaleVmGroupVmMapDao.countByGroup(asGroup.getId());
-		Integer minVm = asGroup.getMinMembers();
-		if (currentVM - 1 < minVm) {
-			s_logger.warn("number of VM will less than the minimum in this group if scaling down, so do nothing more");
-			return false;
-		}
-		return true;
-	}
-	
-	private long createNewVM(AutoScaleVmGroupVO asGroup) {
-		AutoScaleVmProfileVO profileVo = _autoScaleVmProfileDao.findById(asGroup.getProfileId());
-		long templateId = profileVo.getTemplateId();
-		long serviceOfferingId = profileVo.getServiceOfferingId();
-		if (templateId == -1) {
-			return -1;
-		}
-		// create new VM into DB
-		try {
+
+    private boolean checkConditionDown(AutoScaleVmGroupVO asGroup) {
+        Integer currentVM = _autoScaleVmGroupVmMapDao.countByGroup(asGroup.getId());
+        Integer minVm = asGroup.getMinMembers();
+        if (currentVM - 1 < minVm) {
+            s_logger.warn("number of VM will less than the minimum in this group if scaling down, so do nothing more");
+            return false;
+        }
+        return true;
+    }
+
+    private long createNewVM(AutoScaleVmGroupVO asGroup) {
+        AutoScaleVmProfileVO profileVo = _autoScaleVmProfileDao.findById(asGroup.getProfileId());
+        long templateId = profileVo.getTemplateId();
+        long serviceOfferingId = profileVo.getServiceOfferingId();
+        if (templateId == -1) {
+            return -1;
+        }
+        // create new VM into DB
+        try {
             //Verify that all objects exist before passing them to the service
             Account owner = _accountService.getActiveAccountById(profileVo.getAccountId());
 
@@ -1258,26 +1258,31 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
             }
 
             UserVm vm = null;
-			IpAddresses addrs = new IpAddresses(null, null);
-			if (zone.getNetworkType() == NetworkType.Basic) {
-                vm = _userVmService.createBasicSecurityGroupVirtualMachine(zone, serviceOffering, template, null, owner, "autoScaleVm-" + asGroup.getId() + "-" + getCurrentTimeStampString(),
-                		"autoScaleVm-" + asGroup.getId() + "-" + getCurrentTimeStampString(), null, null, null, HypervisorType.XenServer, HTTPMethod.GET, null, null, null, null, true, null, null, null, null);
+            IpAddresses addrs = new IpAddresses(null, null);
+            if (zone.getNetworkType() == NetworkType.Basic) {
+                vm = _userVmService.createBasicSecurityGroupVirtualMachine(zone, serviceOffering, template, null, owner, "autoScaleVm-" + asGroup.getId() + "-" +
+                    getCurrentTimeStampString(),
+                    "autoScaleVm-" + asGroup.getId() + "-" + getCurrentTimeStampString(), null, null, null, HypervisorType.XenServer, HTTPMethod.GET, null, null, null,
+                    null, true, null, null, null, null);
             } else {
-                if (zone.isSecurityGroupEnabled())  {
+                if (zone.isSecurityGroupEnabled()) {
                     vm = _userVmService.createAdvancedSecurityGroupVirtualMachine(zone, serviceOffering, template, null, null,
-                            owner, "autoScaleVm-" + asGroup.getId() + "-" + getCurrentTimeStampString(), "autoScaleVm-" + asGroup.getId() + "-" + getCurrentTimeStampString(), null, null, null, HypervisorType.XenServer, HTTPMethod.GET, null, null, null, null, true, null, null, null, null);
+                        owner, "autoScaleVm-" + asGroup.getId() + "-" + getCurrentTimeStampString(),
+                        "autoScaleVm-" + asGroup.getId() + "-" + getCurrentTimeStampString(), null, null, null, HypervisorType.XenServer, HTTPMethod.GET, null, null,
+                        null, null, true, null, null, null, null);
 
                 } else {
-                    vm = _userVmService.createAdvancedVirtualMachine(zone, serviceOffering, template, null, owner, "autoScaleVm-" + asGroup.getId() + "-" + getCurrentTimeStampString(), "autoScaleVm-" + asGroup.getId() + "-" + getCurrentTimeStampString(),
-                            null, null, null, HypervisorType.XenServer, HTTPMethod.GET, null, null, null, addrs, true, null, null, null, null);
+                    vm = _userVmService.createAdvancedVirtualMachine(zone, serviceOffering, template, null, owner, "autoScaleVm-" + asGroup.getId() + "-" +
+                        getCurrentTimeStampString(), "autoScaleVm-" + asGroup.getId() + "-" + getCurrentTimeStampString(),
+                        null, null, null, HypervisorType.XenServer, HTTPMethod.GET, null, null, null, addrs, true, null, null, null, null);
 
                 }
             }
 
             if (vm != null) {
-				return vm.getId();
+                return vm.getId();
             } else {
-				return -1;
+                return -1;
             }
         } catch (InsufficientCapacityException ex) {
             s_logger.info(ex);
@@ -1286,26 +1291,26 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
         } catch (ResourceUnavailableException ex) {
             s_logger.warn("Exception: ", ex);
             throw new ServerApiException(ApiErrorCode.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());
-        }  catch (ConcurrentOperationException ex) {
+        } catch (ConcurrentOperationException ex) {
             s_logger.warn("Exception: ", ex);
             throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, ex.getMessage());
         } catch (ResourceAllocationException ex) {
             s_logger.warn("Exception: ", ex);
             throw new ServerApiException(ApiErrorCode.RESOURCE_ALLOCATION_ERROR, ex.getMessage());
         }
-	}
-	
-	private String getCurrentTimeStampString(){
-		Date current = new Date();
-		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
-		
-		return sdf.format(current);
-	}
-
-	private boolean startNewVM(long vmId) {
-		try {
-            CallContext.current().setEventDetails("Vm Id: "+vmId);
-			_userVmManager.startVirtualMachine(vmId, null, null);
+    }
+
+    private String getCurrentTimeStampString() {
+        Date current = new Date();
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+
+        return sdf.format(current);
+    }
+
+    private boolean startNewVM(long vmId) {
+        try {
+            CallContext.current().setEventDetails("Vm Id: " + vmId);
+            _userVmManager.startVirtualMachine(vmId, null, null);
         } catch (ResourceUnavailableException ex) {
             s_logger.warn("Exception: ", ex);
             throw new ServerApiException(ApiErrorCode.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());
@@ -1315,7 +1320,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
         } catch (InsufficientCapacityException ex) {
             StringBuilder message = new StringBuilder(ex.getMessage());
             if (ex instanceof InsufficientServerCapacityException) {
-                if(((InsufficientServerCapacityException)ex).isAffinityApplied()){
+                if (((InsufficientServerCapacityException)ex).isAffinityApplied()) {
                     message.append(", Please check the affinity groups provided, there may not be sufficient capacity to follow them");
                 }
             }
@@ -1323,144 +1328,143 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
             s_logger.info(message.toString(), ex);
             throw new ServerApiException(ApiErrorCode.INSUFFICIENT_CAPACITY_ERROR, message.toString());
         }
-		return true;
-	}
-	
-	private boolean assignLBruleToNewVm(long vmId, AutoScaleVmGroupVO asGroup) {
-		List<Long> lstVmId = new ArrayList<Long>();
-    	long lbId = asGroup.getLoadBalancerId();
-    	
-    	List<LoadBalancerVMMapVO>  LbVmMapVos = _LbVmMapDao.listByLoadBalancerId(lbId);
-		if ((LbVmMapVos != null) && (LbVmMapVos.size() > 0)) {
-			for (LoadBalancerVMMapVO LbVmMapVo : LbVmMapVos) {
-				long instanceId = LbVmMapVo.getInstanceId();
-				if (instanceId == vmId) {
-					s_logger.warn("the new VM is already mapped to LB rule. What's wrong?");
-					return true;
-				}
-			}
-    	}
-		lstVmId.add(new Long(vmId));
-		return _LoadBalancingRulesService.assignToLoadBalancer(lbId, lstVmId);
-
-	}
-
-	private long removeLBrule(AutoScaleVmGroupVO asGroup) {
-    	long lbId = asGroup.getLoadBalancerId();
-		long instanceId = -1;
-    	List<LoadBalancerVMMapVO>  LbVmMapVos = _LbVmMapDao.listByLoadBalancerId(lbId);
-		if ((LbVmMapVos != null) && (LbVmMapVos.size() > 0)) {
-			for (LoadBalancerVMMapVO LbVmMapVo : LbVmMapVos) {
-				instanceId = LbVmMapVo.getInstanceId();
-			}
-    	}
-		// take last VM out of the list
-		List<Long> lstVmId = new ArrayList<Long>();
-		if (instanceId != -1)
-			lstVmId.add(instanceId);
-		if (_LoadBalancingRulesService.removeFromLoadBalancer(lbId, lstVmId))
-			return instanceId;
-		else
-			return -1;
-	}
-
-	@Override
-	public void doScaleUp(long groupId, Integer numVm) {
-		AutoScaleVmGroupVO asGroup = _autoScaleVmGroupDao.findById(groupId);
-		if (asGroup == null) {
-			s_logger.error("Can not find the groupid " + groupId + " for scaling up");
-			return;
-		}
-		if (!checkConditionUp(asGroup, numVm)) {
-			return;
-		}
-		for (int i = 0; i < numVm; i++) {
-			long vmId = createNewVM(asGroup);
-			if (vmId == -1) {
-				s_logger.error("Can not deploy new VM for scaling up in the group "
-						+ asGroup.getId() + ". Waiting for next round");
-				break;
-			}
-			if (startNewVM(vmId)) {
-				if (assignLBruleToNewVm(vmId, asGroup)) {
-					// persist to DB
-					AutoScaleVmGroupVmMapVO GroupVmVO = new AutoScaleVmGroupVmMapVO(
-							asGroup.getId(), vmId);
-					_autoScaleVmGroupVmMapDao.persist(GroupVmVO);
-					// update last_quiettime
-					List<AutoScaleVmGroupPolicyMapVO> GroupPolicyVOs = _autoScaleVmGroupPolicyMapDao
-							.listByVmGroupId(groupId);
-					for (AutoScaleVmGroupPolicyMapVO GroupPolicyVO : GroupPolicyVOs) {
-						AutoScalePolicyVO vo = _autoScalePolicyDao
-								.findById(GroupPolicyVO.getPolicyId());
-						if (vo.getAction().equals("scaleup")) {
-							vo.setLastQuiteTime(new Date());
-							_autoScalePolicyDao.persist(vo);
-							break;
-						}
-					}
-				} else {
-					s_logger.error("Can not assign LB rule for this new VM");
-					break;
-				}
-			} else {
-				s_logger.error("Can not deploy new VM for scaling up in the group "
-						+ asGroup.getId() + ". Waiting for next round");
-				break;
-			}
-		}
-	}
-
-	@Override
-	public void doScaleDown(final long groupId) {
-		AutoScaleVmGroupVO asGroup = _autoScaleVmGroupDao.findById(groupId);
-		if (asGroup == null) {
-			s_logger.error("Can not find the groupid " + groupId + " for scaling up");
-			return;
-		}
-		if (!checkConditionDown(asGroup)) {
-			return;
-		}
-		final long vmId = removeLBrule(asGroup);
-		if (vmId != -1) {
-			long profileId = asGroup.getProfileId();
-
-			// update group-vm mapping
-			_autoScaleVmGroupVmMapDao.remove(groupId, vmId);
-			// update last_quiettime
-			List<AutoScaleVmGroupPolicyMapVO> GroupPolicyVOs = _autoScaleVmGroupPolicyMapDao.listByVmGroupId(groupId);
-			for (AutoScaleVmGroupPolicyMapVO GroupPolicyVO : GroupPolicyVOs) {
-				AutoScalePolicyVO vo = _autoScalePolicyDao.findById(GroupPolicyVO.getPolicyId());
-				if (vo.getAction().equals("scaledown")) {
-					vo.setLastQuiteTime(new Date());
-					_autoScalePolicyDao.persist(vo);
-					break;
-				}
-			}
-
-			// get destroyvmgrace param
-			AutoScaleVmProfileVO asProfile = _autoScaleVmProfileDao.findById(profileId);
-			Integer destroyVmGracePeriod = asProfile.getDestroyVmGraceperiod();
-			if (destroyVmGracePeriod >= 0) {
-				_executor.schedule(new Runnable() {
-					@Override
-					public void run() {
-						try {
-
-							_userVmManager.destroyVm(vmId);
-
-						} catch (ResourceUnavailableException e) {
-							e.printStackTrace();
-						} catch (ConcurrentOperationException e) {
-							e.printStackTrace();
-						}
-					}
-				}, destroyVmGracePeriod, TimeUnit.SECONDS);
-			}
-		} else {
-			s_logger.error("Can not remove LB rule for the VM being destroyed. Do nothing more.");
-		}
-	}
-	
+        return true;
+    }
+
+    private boolean assignLBruleToNewVm(long vmId, AutoScaleVmGroupVO asGroup) {
+        List<Long> lstVmId = new ArrayList<Long>();
+        long lbId = asGroup.getLoadBalancerId();
+
+        List<LoadBalancerVMMapVO> LbVmMapVos = _lbVmMapDao.listByLoadBalancerId(lbId);
+        if ((LbVmMapVos != null) && (LbVmMapVos.size() > 0)) {
+            for (LoadBalancerVMMapVO LbVmMapVo : LbVmMapVos) {
+                long instanceId = LbVmMapVo.getInstanceId();
+                if (instanceId == vmId) {
+                    s_logger.warn("the new VM is already mapped to LB rule. What's wrong?");
+                    return true;
+                }
+            }
+        }
+        lstVmId.add(new Long(vmId));
+        return _loadBalancingRulesService.assignToLoadBalancer(lbId, lstVmId);
+
+    }
+
+    private long removeLBrule(AutoScaleVmGroupVO asGroup) {
+        long lbId = asGroup.getLoadBalancerId();
+        long instanceId = -1;
+        List<LoadBalancerVMMapVO> LbVmMapVos = _lbVmMapDao.listByLoadBalancerId(lbId);
+        if ((LbVmMapVos != null) && (LbVmMapVos.size() > 0)) {
+            for (LoadBalancerVMMapVO LbVmMapVo : LbVmMapVos) {
+                instanceId = LbVmMapVo.getInstanceId();
+            }
+        }
+        // take last VM out of the list
+        List<Long> lstVmId = new ArrayList<Long>();
+        if (instanceId != -1)
+            lstVmId.add(instanceId);
+        if (_loadBalancingRulesService.removeFromLoadBalancer(lbId, lstVmId))
+            return instanceId;
+        else
+            return -1;
+    }
+
+    @Override
+    public void doScaleUp(long groupId, Integer numVm) {
+        AutoScaleVmGroupVO asGroup = _autoScaleVmGroupDao.findById(groupId);
+        if (asGroup == null) {
+            s_logger.error("Can not find the groupid " + groupId + " for scaling up");
+            return;
+        }
+        if (!checkConditionUp(asGroup, numVm)) {
+            return;
+        }
+        for (int i = 0; i < numVm; i++) {
+            long vmId = createNewVM(asGroup);
+            if (vmId == -1) {
+                s_logger.error("Can not deploy new VM for scaling up in the group "
+                    + asGroup.getId() + ". Waiting for next round");
+                break;
+            }
+            if (startNewVM(vmId)) {
+                if (assignLBruleToNewVm(vmId, asGroup)) {
+                    // persist to DB
+                    AutoScaleVmGroupVmMapVO GroupVmVO = new AutoScaleVmGroupVmMapVO(
+                        asGroup.getId(), vmId);
+                    _autoScaleVmGroupVmMapDao.persist(GroupVmVO);
+                    // update last_quiettime
+                    List<AutoScaleVmGroupPolicyMapVO> GroupPolicyVOs = _autoScaleVmGroupPolicyMapDao
+                        .listByVmGroupId(groupId);
+                    for (AutoScaleVmGroupPolicyMapVO GroupPolicyVO : GroupPolicyVOs) {
+                        AutoScalePolicyVO vo = _autoScalePolicyDao
+                            .findById(GroupPolicyVO.getPolicyId());
+                        if (vo.getAction().equals("scaleup")) {
+                            vo.setLastQuiteTime(new Date());
+                            _autoScalePolicyDao.persist(vo);
+                            break;
+                        }
+                    }
+                } else {
+                    s_logger.error("Can not assign LB rule for this new VM");
+                    break;
+                }
+            } else {
+                s_logger.error("Can not deploy new VM for scaling up in the group "
+                    + asGroup.getId() + ". Waiting for next round");
+                break;
+            }
+        }
+    }
+
+    @Override
+    public void doScaleDown(final long groupId) {
+        AutoScaleVmGroupVO asGroup = _autoScaleVmGroupDao.findById(groupId);
+        if (asGroup == null) {
+            s_logger.error("Can not find the groupid " + groupId + " for scaling up");
+            return;
+        }
+        if (!checkConditionDown(asGroup)) {
+            return;
+        }
+        final long vmId = removeLBrule(asGroup);
+        if (vmId != -1) {
+            long profileId = asGroup.getProfileId();
+
+            // update group-vm mapping
+            _autoScaleVmGroupVmMapDao.remove(groupId, vmId);
+            // update last_quiettime
+            List<AutoScaleVmGroupPolicyMapVO> GroupPolicyVOs = _autoScaleVmGroupPolicyMapDao.listByVmGroupId(groupId);
+            for (AutoScaleVmGroupPolicyMapVO GroupPolicyVO : GroupPolicyVOs) {
+                AutoScalePolicyVO vo = _autoScalePolicyDao.findById(GroupPolicyVO.getPolicyId());
+                if (vo.getAction().equals("scaledown")) {
+                    vo.setLastQuiteTime(new Date());
+                    _autoScalePolicyDao.persist(vo);
+                    break;
+                }
+            }
+
+            // get destroyvmgrace param
+            AutoScaleVmProfileVO asProfile = _autoScaleVmProfileDao.findById(profileId);
+            Integer destroyVmGracePeriod = asProfile.getDestroyVmGraceperiod();
+            if (destroyVmGracePeriod >= 0) {
+                _executor.schedule(new Runnable() {
+                    @Override
+                    public void run() {
+                        try {
+
+                            _userVmManager.destroyVm(vmId);
+
+                        } catch (ResourceUnavailableException e) {
+                            e.printStackTrace();
+                        } catch (ConcurrentOperationException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }, destroyVmGracePeriod, TimeUnit.SECONDS);
+            }
+        } else {
+            s_logger.error("Can not remove LB rule for the VM being destroyed. Do nothing more.");
+        }
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/server/src/com/cloud/network/element/CloudZonesNetworkElement.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/element/CloudZonesNetworkElement.java b/server/src/com/cloud/network/element/CloudZonesNetworkElement.java
index 3b3646a..55cd5fa 100644
--- a/server/src/com/cloud/network/element/CloudZonesNetworkElement.java
+++ b/server/src/com/cloud/network/element/CloudZonesNetworkElement.java
@@ -250,7 +250,7 @@ public class CloudZonesNetworkElement extends AdapterBase implements NetworkElem
     }
 
     @Override
-    public boolean saveSSHKey(Network network, NicProfile nic, VirtualMachineProfile vm, String SSHPublicKey) throws ResourceUnavailableException {
+    public boolean saveSSHKey(Network network, NicProfile nic, VirtualMachineProfile vm, String sshPublicKey) throws ResourceUnavailableException {
         // TODO Auto-generated method stub
         return false;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/server/src/com/cloud/network/element/VirtualRouterElement.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/element/VirtualRouterElement.java b/server/src/com/cloud/network/element/VirtualRouterElement.java
index 7833d24..455e75f 100755
--- a/server/src/com/cloud/network/element/VirtualRouterElement.java
+++ b/server/src/com/cloud/network/element/VirtualRouterElement.java
@@ -30,13 +30,11 @@ import org.apache.log4j.Logger;
 import com.google.gson.Gson;
 
 import org.apache.cloudstack.api.command.admin.router.ConfigureOvsElementCmd;
-
 import org.apache.cloudstack.api.command.admin.router.ConfigureVirtualRouterElementCmd;
 import org.apache.cloudstack.api.command.admin.router.CreateVirtualRouterElementCmd;
 import org.apache.cloudstack.api.command.admin.router.ListOvsElementsCmd;
 import org.apache.cloudstack.api.command.admin.router.ListVirtualRouterElementsCmd;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
-import org.apache.log4j.Logger;
 
 import com.cloud.agent.api.to.LoadBalancerTO;
 import com.cloud.configuration.ConfigurationManager;
@@ -103,23 +101,20 @@ import com.cloud.vm.VirtualMachine.State;
 import com.cloud.vm.VirtualMachineProfile;
 import com.cloud.vm.dao.DomainRouterDao;
 import com.cloud.vm.dao.UserVmDao;
-import com.google.gson.Gson;
-
-import com.google.gson.Gson;
 
 @Local(value = {NetworkElement.class, FirewallServiceProvider.class,
-		        DhcpServiceProvider.class, UserDataServiceProvider.class,
-		        StaticNatServiceProvider.class, LoadBalancingServiceProvider.class,
-		        PortForwardingServiceProvider.class, IpDeployer.class,
-		        RemoteAccessVPNServiceProvider.class, NetworkMigrationResponder.class} )
+    DhcpServiceProvider.class, UserDataServiceProvider.class,
+    StaticNatServiceProvider.class, LoadBalancingServiceProvider.class,
+    PortForwardingServiceProvider.class, IpDeployer.class,
+    RemoteAccessVPNServiceProvider.class, NetworkMigrationResponder.class})
 public class VirtualRouterElement extends AdapterBase implements VirtualRouterElementService, DhcpServiceProvider,
-    UserDataServiceProvider, SourceNatServiceProvider, StaticNatServiceProvider, FirewallServiceProvider,
+        UserDataServiceProvider, SourceNatServiceProvider, StaticNatServiceProvider, FirewallServiceProvider,
         LoadBalancingServiceProvider, PortForwardingServiceProvider, RemoteAccessVPNServiceProvider, IpDeployer,
         NetworkMigrationResponder {
     private static final Logger s_logger = Logger.getLogger(VirtualRouterElement.class);
-	public static final AutoScaleCounterType AutoScaleCounterCpu = new AutoScaleCounterType("cpu");
-	public static final AutoScaleCounterType AutoScaleCounterMemory = new AutoScaleCounterType("memory");
-	protected static final Map<Service, Map<Capability, String>> capabilities = setCapabilities();
+    public static final AutoScaleCounterType AutoScaleCounterCpu = new AutoScaleCounterType("cpu");
+    public static final AutoScaleCounterType AutoScaleCounterMemory = new AutoScaleCounterType("memory");
+    protected static final Map<Service, Map<Capability, String>> capabilities = setCapabilities();
 
     @Inject
     NetworkDao _networksDao;
@@ -153,8 +148,8 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
     @Inject
     VirtualRouterProviderDao _vrProviderDao;
     @Inject
-	OvsProviderDao _ovsProviderDao;
-	@Inject
+    OvsProviderDao _ovsProviderDao;
+    @Inject
     IPAddressDao _ipAddressDao;
 
     protected boolean canHandle(Network network, Service service) {
@@ -246,10 +241,10 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
                 return true;
             }
 
-            if (rules != null && rules.size() == 1 ) {
+            if (rules != null && rules.size() == 1) {
                 // for VR no need to add default egress rule to DENY traffic
                 if (rules.get(0).getTrafficType() == FirewallRule.TrafficType.Egress && rules.get(0).getType() == FirewallRule.FirewallRuleType.System &&
-                        ! _networkMgr.getNetworkEgressDefaultPolicy(config.getId()))
+                    !_networkMgr.getNetworkEgressDefaultPolicy(config.getId()))
                     return true;
             }
 
@@ -568,13 +563,13 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
         lbCapabilities.put(Capability.SupportedProtocols, "tcp, udp");
         lbCapabilities.put(Capability.SupportedStickinessMethods, getHAProxyStickinessCapability());
         lbCapabilities.put(Capability.LbSchemes, LoadBalancerContainer.Scheme.Public.toString());
-        
+
         //specifies that LB rules can support autoscaling and the list of counters it supports
         AutoScaleCounter counter;
         List<AutoScaleCounter> counterList = new ArrayList<AutoScaleCounter>();
-		counter = new AutoScaleCounter(AutoScaleCounterCpu);
+        counter = new AutoScaleCounter(AutoScaleCounterCpu);
         counterList.add(counter);
-		counter = new AutoScaleCounter(AutoScaleCounterMemory);
+        counter = new AutoScaleCounter(AutoScaleCounterMemory);
         counterList.add(counter);
         Gson gson = new Gson();
         String autoScaleCounterList = gson.toJson(counterList);
@@ -691,7 +686,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
     }
 
     @Override
-    public boolean saveSSHKey(Network network, NicProfile nic, VirtualMachineProfile vm, String SSHPublicKey) throws ResourceUnavailableException {
+    public boolean saveSSHKey(Network network, NicProfile nic, VirtualMachineProfile vm, String sshPublicKey) throws ResourceUnavailableException {
         if (!canHandle(network, null)) {
             return false;
         }
@@ -704,7 +699,7 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
         @SuppressWarnings("unchecked")
         VirtualMachineProfile uservm = vm;
 
-        return _routerMgr.saveSSHPublicKeyToRouter(network, nic, uservm, routers, SSHPublicKey);
+        return _routerMgr.saveSSHPublicKeyToRouter(network, nic, uservm, routers, sshPublicKey);
     }
 
     @Override
@@ -747,20 +742,20 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
         return element;
     }
 
-	@Override
-	public OvsProvider configure(ConfigureOvsElementCmd cmd) {
-		OvsProviderVO element = _ovsProviderDao.findById(cmd.getId());
-		if (element == null) {
-			s_logger.debug("Can't find Ovs element with network service provider id "
-					+ cmd.getId());
-			return null;
-		}
+    @Override
+    public OvsProvider configure(ConfigureOvsElementCmd cmd) {
+        OvsProviderVO element = _ovsProviderDao.findById(cmd.getId());
+        if (element == null) {
+            s_logger.debug("Can't find Ovs element with network service provider id "
+                + cmd.getId());
+            return null;
+        }
 
-		element.setEnabled(cmd.getEnabled());
-		_ovsProviderDao.persist(element);
+        element.setEnabled(cmd.getEnabled());
+        _ovsProviderDao.persist(element);
 
-		return element;
-	}
+        return element;
+    }
 
     @Override
     public VirtualRouterProvider addElement(Long nspId, Type providerType) {
@@ -992,25 +987,25 @@ public class VirtualRouterElement extends AdapterBase implements VirtualRouterEl
         return sc.list();
     }
 
-	@Override
-	public List<? extends OvsProvider> searchForOvsElement(ListOvsElementsCmd cmd) {
-		Long id = cmd.getId();
-		Long nspId = cmd.getNspId();
-		Boolean enabled = cmd.getEnabled();
-		QueryBuilder<OvsProviderVO> sc = QueryBuilder.create(OvsProviderVO.class);
-
-		if (id != null) {
-			sc.and(sc.entity().getId(), Op.EQ, id);
-		}
-		if (nspId != null) {
-			sc.and(sc.entity().getNspId(), Op.EQ, nspId);
-		}
-		if (enabled != null) {
-			sc.and(sc.entity().isEnabled(), Op.EQ, enabled);
-		}
-
-		return sc.list();
-	}
+    @Override
+    public List<? extends OvsProvider> searchForOvsElement(ListOvsElementsCmd cmd) {
+        Long id = cmd.getId();
+        Long nspId = cmd.getNspId();
+        Boolean enabled = cmd.getEnabled();
+        QueryBuilder<OvsProviderVO> sc = QueryBuilder.create(OvsProviderVO.class);
+
+        if (id != null) {
+            sc.and(sc.entity().getId(), Op.EQ, id);
+        }
+        if (nspId != null) {
+            sc.and(sc.entity().getNspId(), Op.EQ, nspId);
+        }
+        if (enabled != null) {
+            sc.and(sc.entity().isEnabled(), Op.EQ, enabled);
+        }
+
+        return sc.list();
+    }
 
     @Override
     public boolean verifyServicesCombination(Set<Service> services) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/server/src/com/cloud/network/guru/ControlNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/ControlNetworkGuru.java b/server/src/com/cloud/network/guru/ControlNetworkGuru.java
index 08cc3e6..1de12b7 100755
--- a/server/src/com/cloud/network/guru/ControlNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/ControlNetworkGuru.java
@@ -66,11 +66,11 @@ public class ControlNetworkGuru extends PodBasedNetworkGuru implements NetworkGu
     String _cidr;
     String _gateway;
 
-    private static final TrafficType[] _trafficTypes = {TrafficType.Control};
+    private static final TrafficType[] TrafficTypes = {TrafficType.Control};
 
     @Override
     public boolean isMyTrafficType(TrafficType type) {
-        for (TrafficType t : _trafficTypes) {
+        for (TrafficType t : TrafficTypes) {
             if (t == type) {
                 return true;
             }
@@ -80,7 +80,7 @@ public class ControlNetworkGuru extends PodBasedNetworkGuru implements NetworkGu
 
     @Override
     public TrafficType[] getSupportedTrafficType() {
-        return _trafficTypes;
+        return TrafficTypes;
     }
 
     protected boolean canHandle(NetworkOffering offering) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/server/src/com/cloud/network/guru/DirectNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/DirectNetworkGuru.java b/server/src/com/cloud/network/guru/DirectNetworkGuru.java
index 0fec81f..e570ddd 100755
--- a/server/src/com/cloud/network/guru/DirectNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/DirectNetworkGuru.java
@@ -98,11 +98,11 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru {
     @Inject
     IpAddressManager _ipAddrMgr;
 
-    private static final TrafficType[] _trafficTypes = {TrafficType.Guest};
+    private static final TrafficType[] TrafficTypes = {TrafficType.Guest};
 
     @Override
     public boolean isMyTrafficType(TrafficType type) {
-        for (TrafficType t : _trafficTypes) {
+        for (TrafficType t : TrafficTypes) {
             if (t == type) {
                 return true;
             }
@@ -112,7 +112,7 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru {
 
     @Override
     public TrafficType[] getSupportedTrafficType() {
-        return _trafficTypes;
+        return TrafficTypes;
     }
 
     protected boolean canHandle(NetworkOffering offering, DataCenter dc) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java b/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java
index bea9428..ec02a30 100644
--- a/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java
@@ -26,7 +26,6 @@ import org.apache.log4j.Logger;
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
 
-import com.cloud.configuration.Config;
 import com.cloud.dc.DataCenter;
 import com.cloud.dc.DataCenter.NetworkType;
 import com.cloud.dc.dao.DataCenterDao;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/server/src/com/cloud/network/guru/GuestNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/GuestNetworkGuru.java b/server/src/com/cloud/network/guru/GuestNetworkGuru.java
index 1fd3e7f..a759951 100755
--- a/server/src/com/cloud/network/guru/GuestNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/GuestNetworkGuru.java
@@ -117,7 +117,7 @@ public abstract class GuestNetworkGuru extends AdapterBase implements NetworkGur
             "If true, when account has dedicated guest vlan range(s), once the vlans dedicated to the account have been consumed vlans will be allocated from the system pool",
             false, ConfigKey.Scope.Account);
 
-    private static final TrafficType[] _trafficTypes = {TrafficType.Guest};
+    private static final TrafficType[] TrafficTypes = {TrafficType.Guest};
 
     // Currently set to anything except STT for the Nicira integration.
     protected IsolationMethod[] _isolationMethods;
@@ -132,7 +132,7 @@ public abstract class GuestNetworkGuru extends AdapterBase implements NetworkGur
 
     @Override
     public boolean isMyTrafficType(TrafficType type) {
-        for (TrafficType t : _trafficTypes) {
+        for (TrafficType t : TrafficTypes) {
             if (t == type) {
                 return true;
             }
@@ -142,7 +142,7 @@ public abstract class GuestNetworkGuru extends AdapterBase implements NetworkGur
 
     @Override
     public TrafficType[] getSupportedTrafficType() {
-        return _trafficTypes;
+        return TrafficTypes;
     }
 
     public boolean isMyIsolationMethod(PhysicalNetwork physicalNetwork) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/server/src/com/cloud/network/guru/PodBasedNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/PodBasedNetworkGuru.java b/server/src/com/cloud/network/guru/PodBasedNetworkGuru.java
index 66b80c9..84c79d0 100755
--- a/server/src/com/cloud/network/guru/PodBasedNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/PodBasedNetworkGuru.java
@@ -57,11 +57,11 @@ public class PodBasedNetworkGuru extends AdapterBase implements NetworkGuru {
     StorageNetworkManager _sNwMgr;
     Random _rand = new Random(System.currentTimeMillis());
 
-    private static final TrafficType[] _trafficTypes = {TrafficType.Management};
+    private static final TrafficType[] TrafficTypes = {TrafficType.Management};
 
     @Override
     public boolean isMyTrafficType(TrafficType type) {
-        for (TrafficType t : _trafficTypes) {
+        for (TrafficType t : TrafficTypes) {
             if (t == type) {
                 return true;
             }
@@ -71,7 +71,7 @@ public class PodBasedNetworkGuru extends AdapterBase implements NetworkGuru {
 
     @Override
     public TrafficType[] getSupportedTrafficType() {
-        return _trafficTypes;
+        return TrafficTypes;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/server/src/com/cloud/network/guru/PrivateNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/PrivateNetworkGuru.java b/server/src/com/cloud/network/guru/PrivateNetworkGuru.java
index 1710c4d..35b7b5c 100644
--- a/server/src/com/cloud/network/guru/PrivateNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/PrivateNetworkGuru.java
@@ -66,7 +66,7 @@ public class PrivateNetworkGuru extends AdapterBase implements NetworkGuru {
     @Inject
     EntityManager _entityMgr;
 
-    private static final TrafficType[] _trafficTypes = {TrafficType.Guest};
+    private static final TrafficType[] TrafficTypes = {TrafficType.Guest};
 
     protected PrivateNetworkGuru() {
         super();
@@ -74,7 +74,7 @@ public class PrivateNetworkGuru extends AdapterBase implements NetworkGuru {
 
     @Override
     public boolean isMyTrafficType(TrafficType type) {
-        for (TrafficType t : _trafficTypes) {
+        for (TrafficType t : TrafficTypes) {
             if (t == type) {
                 return true;
             }
@@ -84,7 +84,7 @@ public class PrivateNetworkGuru extends AdapterBase implements NetworkGuru {
 
     @Override
     public TrafficType[] getSupportedTrafficType() {
-        return _trafficTypes;
+        return TrafficTypes;
     }
 
     protected boolean canHandle(NetworkOffering offering, DataCenter dc) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/server/src/com/cloud/network/guru/PublicNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/PublicNetworkGuru.java b/server/src/com/cloud/network/guru/PublicNetworkGuru.java
index 58816af..34e97d3 100755
--- a/server/src/com/cloud/network/guru/PublicNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/PublicNetworkGuru.java
@@ -74,11 +74,11 @@ public class PublicNetworkGuru extends AdapterBase implements NetworkGuru {
     @Inject
     IpAddressManager _ipAddrMgr;
 
-    private static final TrafficType[] _trafficTypes = {TrafficType.Public};
+    private static final TrafficType[] TrafficTypes = {TrafficType.Public};
 
     @Override
     public boolean isMyTrafficType(TrafficType type) {
-        for (TrafficType t : _trafficTypes) {
+        for (TrafficType t : TrafficTypes) {
             if (t == type) {
                 return true;
             }
@@ -88,7 +88,7 @@ public class PublicNetworkGuru extends AdapterBase implements NetworkGuru {
 
     @Override
     public TrafficType[] getSupportedTrafficType() {
-        return _trafficTypes;
+        return TrafficTypes;
     }
 
     protected boolean canHandle(NetworkOffering offering) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/server/src/com/cloud/network/guru/StorageNetworkGuru.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/guru/StorageNetworkGuru.java b/server/src/com/cloud/network/guru/StorageNetworkGuru.java
index 2c2bd90..33a5569 100755
--- a/server/src/com/cloud/network/guru/StorageNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/StorageNetworkGuru.java
@@ -56,11 +56,11 @@ public class StorageNetworkGuru extends PodBasedNetworkGuru implements NetworkGu
         super();
     }
 
-    private static final TrafficType[] _trafficTypes = {TrafficType.Storage};
+    private static final TrafficType[] TrafficTypes = {TrafficType.Storage};
 
     @Override
     public boolean isMyTrafficType(TrafficType type) {
-        for (TrafficType t : _trafficTypes) {
+        for (TrafficType t : TrafficTypes) {
             if (t == type) {
                 return true;
             }
@@ -70,7 +70,7 @@ public class StorageNetworkGuru extends PodBasedNetworkGuru implements NetworkGu
 
     @Override
     public TrafficType[] getSupportedTrafficType() {
-        return _trafficTypes;
+        return TrafficTypes;
     }
 
     protected boolean canHandle(NetworkOffering offering) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
index aab4c6b..8214274 100755
--- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
+++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
@@ -915,8 +915,8 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
         if (provider == null || provider.size() == 0) {
             return false;
         }
-        if (provider.get(0) == Provider.Netscaler || provider.get(0) == Provider.F5BigIp || 
-        		provider.get(0) == Provider.VirtualRouter) {
+        if (provider.get(0) == Provider.Netscaler || provider.get(0) == Provider.F5BigIp ||
+            provider.get(0) == Provider.VirtualRouter) {
             return true;
         }
         return false;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/server/src/com/cloud/network/router/VirtualNetworkApplianceManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManager.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManager.java
index 86145fa..e838530 100644
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManager.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManager.java
@@ -83,7 +83,7 @@ public interface VirtualNetworkApplianceManager extends Manager, VirtualNetworkA
     boolean savePasswordToRouter(Network network, NicProfile nic, VirtualMachineProfile profile, List<? extends VirtualRouter> routers)
         throws ResourceUnavailableException;
 
-    boolean saveSSHPublicKeyToRouter(Network network, NicProfile nic, VirtualMachineProfile profile, List<? extends VirtualRouter> routers, String SSHPublicKey)
+    boolean saveSSHPublicKeyToRouter(Network network, NicProfile nic, VirtualMachineProfile profile, List<? extends VirtualRouter> routers, String sshPublicKey)
         throws ResourceUnavailableException;
 
     boolean saveUserDataToRouter(Network network, NicProfile nic, VirtualMachineProfile profile, List<? extends VirtualRouter> routers)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index 9ea3638..c2902b1 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -201,8 +201,8 @@ import com.cloud.network.router.VirtualRouter.RedundantState;
 import com.cloud.network.router.VirtualRouter.Role;
 import com.cloud.network.rules.FirewallRule;
 import com.cloud.network.rules.FirewallRule.Purpose;
-import com.cloud.network.rules.LoadBalancerContainer.Scheme;
 import com.cloud.network.rules.FirewallRuleVO;
+import com.cloud.network.rules.LoadBalancerContainer.Scheme;
 import com.cloud.network.rules.PortForwardingRule;
 import com.cloud.network.rules.RulesManager;
 import com.cloud.network.rules.StaticNat;
@@ -400,7 +400,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
     int _routerCpuMHz;
     int _retry = 2;
     String _instance;
-    String _mgmt_cidr;
+    String _mgmtCidr;
 
     int _routerStatsInterval = 300;
     int _routerCheckInterval = 30;
@@ -409,7 +409,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
     private String _dnsBasicZoneUpdates = "all";
     private final Set<String> _guestOSNeedGatewayOnNonDefaultNetwork = new HashSet<String>();
 
-    private boolean _disable_rp_filter = false;
+    private boolean _disableRpFilter = false;
     int _routerExtraPublicNics = 2;
     private int _usageAggregationRange = 1440;
     private String _usageTimeZone = "GMT";
@@ -533,7 +533,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
 
     @Override
     public boolean saveSSHPublicKeyToRouter(Network network, final NicProfile nic, VirtualMachineProfile profile, List<? extends VirtualRouter> routers,
-        final String SSHPublicKey) throws ResourceUnavailableException {
+        final String sshPublicKey) throws ResourceUnavailableException {
         final UserVmVO vm = _userVmDao.findById(profile.getVirtualMachine().getId());
         _userVmDao.loadDetails(vm);
 
@@ -549,7 +549,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
                 if (template != null && template.getEnablePassword()) {
                     createPasswordCommand(router, updatedProfile, nicVo, cmds);
                 }
-                createVmDataCommand(router, vm, nicVo, SSHPublicKey, cmds);
+                createVmDataCommand(router, vm, nicVo, sshPublicKey, cmds);
                 return sendCommandsToRouter(router, cmds);
             }
         });
@@ -714,7 +714,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
 
         String rpValue = configs.get("network.disable.rpfilter");
         if (rpValue != null && rpValue.equalsIgnoreCase("true")) {
-            _disable_rp_filter = true;
+            _disableRpFilter = true;
         }
 
         _dnsBasicZoneUpdates = String.valueOf(_configDao.getValue(Config.DnsBasicZoneUpdates.key()));
@@ -1278,7 +1278,8 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
                                 "Virtual router (name: " + router.getHostName() + ", id: " + router.getId() + " and router (name: " + dupRouter.getHostName() + ", id: " +
                                     router.getId() + ") are both in MASTER state! If the problem persist, restart both of routers. ";
                             _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_DOMAIN_ROUTER, router.getDataCenterId(), router.getPodIdToDeployIn(), title, context);
-                            _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_DOMAIN_ROUTER, dupRouter.getDataCenterId(), dupRouter.getPodIdToDeployIn(), title, context);
+                            _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_DOMAIN_ROUTER, dupRouter.getDataCenterId(), dupRouter.getPodIdToDeployIn(), title,
+                                context);
                             s_logger.warn(context);
                         } else {
                             networkRouterMaps.put(routerGuestNtwkId, router);
@@ -1356,8 +1357,8 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
         }
     }
 
-    private final int DEFAULT_PRIORITY = 100;
-    private final int DEFAULT_DELTA = 2;
+    private final static int DEFAULT_PRIORITY = 100;
+    private final static int DEFAULT_DELTA = 2;
 
     protected int getUpdatedPriority(Network guestNetwork, List<DomainRouterVO> routers, DomainRouterVO exclude) throws InsufficientVirtualNetworkCapcityException {
         int priority;
@@ -2053,9 +2054,9 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
 
                     // always add management explicit route, for basic networking setup, DomR may have two interfaces while both
                     // are on the same subnet
-                    _mgmt_cidr = _configDao.getValue(Config.ManagementNetwork.key());
-                    if (NetUtils.isValidCIDR(_mgmt_cidr)) {
-                        buf.append(" mgmtcidr=").append(_mgmt_cidr);
+                    _mgmtCidr = _configDao.getValue(Config.ManagementNetwork.key());
+                    if (NetUtils.isValidCIDR(_mgmtCidr)) {
+                        buf.append(" mgmtcidr=").append(_mgmtCidr);
                         buf.append(" localgw=").append(dest.getPod().getGateway());
                     }
 
@@ -2081,28 +2082,28 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
 
         String rpValue = _configDao.getValue(Config.NetworkRouterRpFilter.key());
         if (rpValue != null && rpValue.equalsIgnoreCase("true")) {
-            _disable_rp_filter = true;
+            _disableRpFilter = true;
         } else {
-            _disable_rp_filter = false;
+            _disableRpFilter = false;
         }
 
         String rpFilter = " ";
         String type = null;
         if (router.getVpcId() != null) {
             type = "vpcrouter";
-            if (_disable_rp_filter) {
+            if (_disableRpFilter) {
                 rpFilter = " disable_rp_filter=true";
             }
         } else if (!publicNetwork) {
             type = "dhcpsrvr";
         } else {
             type = "router";
-            if (_disable_rp_filter) {
+            if (_disableRpFilter) {
                 rpFilter = " disable_rp_filter=true";
             }
         }
 
-        if (_disable_rp_filter) {
+        if (_disableRpFilter) {
             rpFilter = " disable_rp_filter=true";
         }
 
@@ -3571,7 +3572,8 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
         String context =
             "Virtual router (name: " + disconnectedRouter.getInstanceName() + ", id: " + disconnectedRouter.getId() +
                 ") would be stopped after connecting back, due to: " + reason;
-        _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_DOMAIN_ROUTER, disconnectedRouter.getDataCenterId(), disconnectedRouter.getPodIdToDeployIn(), title, context);
+        _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_DOMAIN_ROUTER, disconnectedRouter.getDataCenterId(), disconnectedRouter.getPodIdToDeployIn(), title,
+            context);
         disconnectedRouter.setStopPending(true);
         disconnectedRouter = _routerDao.persist(disconnectedRouter);
 
@@ -4138,7 +4140,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
     // Compares MS version and router version
     private boolean checkRouterVersion(VirtualRouter router) {
         String trimmedVersion = Version.trimRouterVersion(router.getTemplateVersion());
-        return (Version.compare(trimmedVersion, _minVRVersion) >= 0);
+        return (Version.compare(trimmedVersion, MinVRVersion) >= 0);
     }
 
     private List<Long> rebootRouters(List<DomainRouterVO> routers) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
index 1c560c4..fbcd461 100644
--- a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
+++ b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
@@ -123,7 +123,7 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
 
         Account caller = CallContext.current().getCallingAccount();
 
-        if(networkId != null){
+        if (networkId != null) {
             SearchBuilder<NetworkVO> network = _networkDao.createSearchBuilder();
             network.and("networkId", network.entity().getId(), Op.EQ);
             sb.join("networkJoin", network, sb.entity().getId(), network.entity().getNetworkACLId(), JoinBuilder.JoinType.INNER);
@@ -138,9 +138,9 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
             sc.setParameters("name", name);
         }
 
-        if(vpcId != null){
+        if (vpcId != null) {
             Vpc vpc = _entityMgr.findById(Vpc.class, vpcId);
-            if(vpc == null){
+            if (vpc == null) {
                 throw new InvalidParameterValueException("Unable to find VPC");
             }
             _accountMgr.checkAccess(caller, null, true, vpc);
@@ -158,9 +158,9 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
             Long projectId = cmd.getProjectId();
             boolean listAll = cmd.listAll();
             Ternary<Long, Boolean, ListProjectResourcesCriteria> domainIdRecursiveListProject = new Ternary<Long, Boolean,
-                    ListProjectResourcesCriteria>(domainId, isRecursive, null);
+                ListProjectResourcesCriteria>(domainId, isRecursive, null);
             _accountMgr.buildACLSearchParameters(caller, id, accountName, projectId, permittedAccounts, domainIdRecursiveListProject,
-                    listAll, false);
+                listAll, false);
             domainId = domainIdRecursiveListProject.first();
             isRecursive = domainIdRecursiveListProject.second();
             ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third();
@@ -489,7 +489,7 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
             sb.join("tagSearch", tagSearch, sb.entity().getId(), tagSearch.entity().getResourceId(), JoinBuilder.JoinType.INNER);
         }
 
-        if(aclId == null){
+        if (aclId == null) {
             //Join with network_acl table when aclId is not specified to list acl_items within permitted VPCs
             SearchBuilder<NetworkACLVO> vpcSearch = _networkACLDao.createSearchBuilder();
             vpcSearch.and("vpcId", vpcSearch.entity().getVpcId(), Op.IN);
@@ -511,12 +511,12 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
             sc.setParameters("trafficType", trafficType);
         }
 
-        if(aclId != null){
+        if (aclId != null) {
             // Get VPC and check access
             NetworkACL acl = _networkACLDao.findById(aclId);
-            if(acl.getVpcId() != 0){
+            if (acl.getVpcId() != 0) {
                 Vpc vpc = _vpcDao.findById(acl.getVpcId());
-                if(vpc == null){
+                if (vpc == null) {
                     throw new InvalidParameterValueException("Unable to find VPC associated with acl");
                 }
                 _accountMgr.checkAccess(caller, null, true, vpc);
@@ -525,7 +525,6 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
         } else {
             //ToDo: Add accountId to network_acl_item table for permission check
 
-
             // aclId is not specified
             // List permitted VPCs and filter aclItems
             List<Long> permittedAccounts = new ArrayList<Long>();
@@ -535,9 +534,9 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
             Long projectId = cmd.getProjectId();
             boolean listAll = cmd.listAll();
             Ternary<Long, Boolean, ListProjectResourcesCriteria> domainIdRecursiveListProject = new Ternary<Long, Boolean,
-                    ListProjectResourcesCriteria>(domainId, isRecursive, null);
+                ListProjectResourcesCriteria>(domainId, isRecursive, null);
             _accountMgr.buildACLSearchParameters(caller, id, accountName, projectId, permittedAccounts, domainIdRecursiveListProject,
-                    listAll, false);
+                listAll, false);
             domainId = domainIdRecursiveListProject.first();
             isRecursive = domainIdRecursiveListProject.second();
             ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/server/src/com/cloud/resource/ResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java
index 7c5041b..c961ce1 100755
--- a/server/src/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/com/cloud/resource/ResourceManagerImpl.java
@@ -120,7 +120,6 @@ import com.cloud.org.Grouping.AllocationState;
 import com.cloud.org.Managed;
 import com.cloud.serializer.GsonHelper;
 import com.cloud.storage.GuestOSCategoryVO;
-import com.cloud.storage.GuestOsCategory;
 import com.cloud.storage.StorageManager;
 import com.cloud.storage.StoragePool;
 import com.cloud.storage.StoragePoolHostVO;
@@ -155,7 +154,7 @@ import com.cloud.utils.fsm.NoTransitionException;
 import com.cloud.utils.net.Ip;
 import com.cloud.utils.net.NetUtils;
 import com.cloud.utils.ssh.SSHCmdHelper;
-import com.cloud.utils.ssh.sshException;
+import com.cloud.utils.ssh.SshException;
 import com.cloud.vm.VMInstanceVO;
 import com.cloud.vm.VirtualMachine.State;
 import com.cloud.vm.VirtualMachineManager;
@@ -223,8 +222,8 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
         return _discoverers;
     }
 
-    public void setDiscoverers(List<? extends Discoverer> _discoverers) {
-        this._discoverers = _discoverers;
+    public void setDiscoverers(List<? extends Discoverer> discoverers) {
+        _discoverers = discoverers;
     }
 
     @Inject
@@ -2066,7 +2065,7 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
 
                 try {
                     SSHCmdHelper.sshExecuteCmdOneShot(connection, "service cloudstack-agent restart");
-                } catch (sshException e) {
+                } catch (SshException e) {
                     return false;
                 }
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/be5e5cc6/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java b/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java
index 6e5dce6..98912ac 100755
--- a/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java
+++ b/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java
@@ -47,7 +47,6 @@ import com.cloud.configuration.Resource.ResourceOwnerType;
 import com.cloud.configuration.Resource.ResourceType;
 import com.cloud.configuration.ResourceCount;
 import com.cloud.configuration.ResourceCountVO;
-import com.cloud.configuration.ResourceLimit;
 import com.cloud.configuration.ResourceLimitVO;
 import com.cloud.configuration.dao.ResourceCountDao;
 import com.cloud.configuration.dao.ResourceLimitDao;
@@ -253,7 +252,8 @@ public class ResourceLimitManagerImpl extends ManagerBase implements ResourceLim
         long numToDecrement = (delta.length == 0) ? 1 : delta[0].longValue();
 
         if (!updateResourceCountForAccount(accountId, type, false, numToDecrement)) {
-            _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_UPDATE_RESOURCE_COUNT, 0L, 0L, "Failed to decrement resource count of type " + type + " for account id=" +
+            _alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_UPDATE_RESOURCE_COUNT, 0L, 0L, "Failed to decrement resource count of type " + type +
+                " for account id=" +
                 accountId, "Failed to decrement resource count of type " + type + " for account id=" + accountId +
                 "; use updateResourceCount API to recalculate/fix the problem");
         }
@@ -961,7 +961,7 @@ public class ResourceLimitManagerImpl extends ManagerBase implements ResourceLim
         // TODO boilerplate code.
         boolean displayflag = (displayResource == null) || (displayResource != null && displayResource);
 
-        if(displayflag){
+        if (displayflag) {
             checkResourceLimit(account, type, count);
         }
     }
@@ -971,7 +971,7 @@ public class ResourceLimitManagerImpl extends ManagerBase implements ResourceLim
 
         // 1. If its null assume displayResource = 1
         // 2. If its not null then increment if displayResource = 1
-        if(displayResource == null || (displayResource != null && displayResource)){
+        if (displayResource == null || (displayResource != null && displayResource)) {
             incrementResourceCount(accountId, type, delta);
         }
     }
@@ -981,7 +981,7 @@ public class ResourceLimitManagerImpl extends ManagerBase implements ResourceLim
 
         // 1. If its null assume displayResource = 1
         // 2. If its not null then decrement if displayResource = 1
-        if(displayResource == null || (displayResource != null && displayResource)){
+        if (displayResource == null || (displayResource != null && displayResource)) {
             decrementResourceCount(accountId, type, delta);
         }
     }
@@ -990,13 +990,14 @@ public class ResourceLimitManagerImpl extends ManagerBase implements ResourceLim
     public void changeResourceCount(long accountId, ResourceType type, Boolean displayResource, Long... delta) {
 
         // meaning that the display flag is not changed so neither increment or decrement
-        if(displayResource == null) return;
+        if (displayResource == null)
+            return;
 
         // Increment because the display is turned on.
-        if(displayResource){
-        //            checkResourceLimit((Account)_accountDao.findById(accountId), type, delta);
+        if (displayResource) {
+            //            checkResourceLimit((Account)_accountDao.findById(accountId), type, delta);
             incrementResourceCount(accountId, type, delta);
-        }else{
+        } else {
             decrementResourceCount(accountId, type, delta);
         }
     }


Mime
View raw message