cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject git commit: updated refs/heads/master to 6c23e20
Date Thu, 13 Mar 2014 23:26:05 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 90c485e5d -> 6c23e201a


1) More fixes for the problems found by findBugs
2) Corrected some logging in  MidoNetPublicNetworkGuru - removed .toString method call on
the objects in the log body as toString is called on the object by default when use log4j


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6c23e201
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6c23e201
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6c23e201

Branch: refs/heads/master
Commit: 6c23e201ad7423e405a4acfae4e8a08938cefd24
Parents: 90c485e
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Thu Mar 13 14:35:19 2014 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Thu Mar 13 16:05:45 2014 -0700

----------------------------------------------------------------------
 .../cloud/template/VirtualMachineTemplate.java  |  2 +-
 .../src/com/cloud/storage/VMTemplateVO.java     |  2 +-
 .../storage/image/store/TemplateObject.java     |  7 ++---
 .../allocator/AbstractStoragePoolAllocator.java |  3 +-
 .../ClusterScopeStoragePoolAllocator.java       |  5 ++--
 .../storage/image/TemplateEntityImpl.java       |  4 +--
 .../storage/volume/VolumeServiceImpl.java       | 26 ++++++++----------
 .../affinity/ExplicitDedicationProcessor.java   | 11 ++++----
 .../baremetal/manager/BareMetalDiscoverer.java  | 18 +-----------
 .../discoverer/HypervServerDiscoverer.java      | 20 +-------------
 .../kvm/resource/LibvirtComputingResource.java  |  4 +--
 .../kvm/resource/LibvirtXMLParser.java          |  3 +-
 .../resource/SimulatorSecondaryDiscoverer.java  |  5 +---
 .../vmware/VmwareServerDiscoverer.java          | 18 ++++--------
 .../xen/discoverer/XcpServerDiscoverer.java     | 19 ++++---------
 .../xen/resource/CitrixResourceBase.java        |  5 ++--
 .../network/guru/MidoNetPublicNetworkGuru.java  | 29 ++++++++++----------
 .../kvm/discoverer/LibvirtServerDiscoverer.java |  3 --
 .../src/com/cloud/resource/DiscovererBase.java  |  8 ++++--
 19 files changed, 67 insertions(+), 125 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c23e201/api/src/com/cloud/template/VirtualMachineTemplate.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/template/VirtualMachineTemplate.java b/api/src/com/cloud/template/VirtualMachineTemplate.java
index 9118bb2..599212b 100755
--- a/api/src/com/cloud/template/VirtualMachineTemplate.java
+++ b/api/src/com/cloud/template/VirtualMachineTemplate.java
@@ -99,5 +99,5 @@ public interface VirtualMachineTemplate extends ControlledEntity, Identity,
Inte
 
     Map getDetails();
 
-    Boolean isDynamicallyScalable();
+    boolean isDynamicallyScalable();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c23e201/engine/schema/src/com/cloud/storage/VMTemplateVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/VMTemplateVO.java b/engine/schema/src/com/cloud/storage/VMTemplateVO.java
index e619f68..c0b7d0f 100755
--- a/engine/schema/src/com/cloud/storage/VMTemplateVO.java
+++ b/engine/schema/src/com/cloud/storage/VMTemplateVO.java
@@ -593,7 +593,7 @@ public class VMTemplateVO implements VirtualMachineTemplate {
     }
 
     @Override
-    public Boolean isDynamicallyScalable() {
+    public boolean isDynamicallyScalable() {
         return dynamicallyScalable;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c23e201/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
----------------------------------------------------------------------
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
index 34db481..bd14df5 100644
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
@@ -23,8 +23,6 @@ import java.util.Map;
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.acl.IAMEntityType;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
@@ -37,6 +35,7 @@ import org.apache.cloudstack.storage.datastore.ObjectInDataStoreManager;
 import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO;
 import org.apache.cloudstack.storage.to.TemplateObjectTO;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.to.DataObjectType;
@@ -435,8 +434,8 @@ public class TemplateObject implements TemplateInfo {
     }
 
     @Override
-    public Boolean isDynamicallyScalable() {
-        return Boolean.FALSE;
+    public boolean isDynamicallyScalable() {
+        return false;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c23e201/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
index aab3876..ddbb5a4 100755
--- a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java
@@ -27,12 +27,11 @@ import java.util.Random;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
 import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
+import org.apache.log4j.Logger;
 
 import com.cloud.dc.ClusterVO;
 import com.cloud.dc.dao.ClusterDao;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c23e201/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java
b/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java
index af22810..ea084c7 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/ClusterScopeStoragePoolAllocator.java
@@ -25,11 +25,10 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
 import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
 
 import com.cloud.deploy.DeploymentPlan;
 import com.cloud.deploy.DeploymentPlanner.ExcludeList;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c23e201/engine/storage/src/org/apache/cloudstack/storage/image/TemplateEntityImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/TemplateEntityImpl.java
b/engine/storage/src/org/apache/cloudstack/storage/image/TemplateEntityImpl.java
index fd90ac9..fde13e1 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/image/TemplateEntityImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/image/TemplateEntityImpl.java
@@ -108,8 +108,8 @@ public class TemplateEntityImpl implements TemplateEntity {
     }
 
     @Override
-    public Boolean isDynamicallyScalable() {
-        return null;  //To change body of implemented methods use File | Settings | File
Templates.
+    public boolean isDynamicallyScalable() {
+        return false;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c23e201/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
index d47ee27..1c01401 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
@@ -26,9 +26,6 @@ import java.util.Map;
 
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
 import org.apache.cloudstack.engine.cloud.entity.api.VolumeEntity;
 import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo;
 import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult;
@@ -41,7 +38,6 @@ import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
 import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector;
 import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine;
 import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine.Event;
-import org.apache.cloudstack.engine.subsystem.api.storage.VolumeService.VolumeApiResult;
 import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver;
 import org.apache.cloudstack.engine.subsystem.api.storage.Scope;
@@ -61,8 +57,10 @@ import org.apache.cloudstack.storage.command.DeleteCommand;
 import org.apache.cloudstack.storage.datastore.PrimaryDataStoreProviderManager;
 import org.apache.cloudstack.storage.datastore.db.VolumeDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.VolumeDataStoreVO;
-import org.apache.cloudstack.storage.to.VolumeObjectTO;
 import org.apache.cloudstack.storage.to.TemplateObjectTO;
+import org.apache.cloudstack.storage.to.VolumeObjectTO;
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
 
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.storage.ListVolumeAnswer;
@@ -75,8 +73,8 @@ import com.cloud.event.EventTypes;
 import com.cloud.event.UsageEventUtils;
 import com.cloud.exception.ConcurrentOperationException;
 import com.cloud.exception.ResourceAllocationException;
-import com.cloud.host.dao.HostDao;
 import com.cloud.host.Host;
+import com.cloud.host.dao.HostDao;
 import com.cloud.storage.DataStoreRole;
 import com.cloud.storage.ScopeType;
 import com.cloud.storage.StoragePool;
@@ -625,15 +623,15 @@ public class VolumeServiceImpl implements VolumeService {
                     if (templatePoolRef != null) {
                         long templatePoolRefId = templatePoolRef.getId();
                         templatePoolRef = _tmpltPoolDao.acquireInLockTable(templatePoolRefId,
1200);
-                        if (templatePoolRef == null) {
-                            s_logger.warn("Reset Template State On Pool failed - unable to
lock TemplatePoolRef " + templatePoolRefId);
-                        }
-
                         try {
-                            templatePoolRef.setDownloadState(VMTemplateStorageResourceAssoc.Status.NOT_DOWNLOADED);
-                            templatePoolRef.setState(ObjectInDataStoreStateMachine.State.Allocated);
-                            _tmpltPoolDao.update(templatePoolRefId, templatePoolRef);
-                        } finally {
+                            if (templatePoolRef == null) {
+                                s_logger.warn("Reset Template State On Pool failed - unable
to lock TemplatePoolRef " + templatePoolRefId);
+                            } else {
+                                templatePoolRef.setDownloadState(VMTemplateStorageResourceAssoc.Status.NOT_DOWNLOADED);
+                                templatePoolRef.setState(ObjectInDataStoreStateMachine.State.Allocated);
+                                _tmpltPoolDao.update(templatePoolRefId, templatePoolRef);
+                            }
+                        }finally {
                             _tmpltPoolDao.releaseFromLockTable(templatePoolRefId);
                         }
                     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c23e201/plugins/affinity-group-processors/explicit-dedication/src/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java
----------------------------------------------------------------------
diff --git a/plugins/affinity-group-processors/explicit-dedication/src/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java
b/plugins/affinity-group-processors/explicit-dedication/src/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java
index 8c253ee..9aad5f4 100644
--- a/plugins/affinity-group-processors/explicit-dedication/src/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java
+++ b/plugins/affinity-group-processors/explicit-dedication/src/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java
@@ -23,10 +23,9 @@ import java.util.Set;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.affinity.dao.AffinityGroupDao;
 import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao;
+import org.apache.log4j.Logger;
 
 import com.cloud.dc.ClusterVO;
 import com.cloud.dc.DataCenter;
@@ -120,10 +119,10 @@ public class ExplicitDedicationProcessor extends AffinityProcessorBase
implement
                 DataCenterVO zoneOfHost = _dcDao.findById(host.getDataCenterId());
                 if (resourceList != null && resourceList.size() != 0) {
                     for (DedicatedResourceVO resource : resourceList) {
-                        if ((resource.getHostId() != null && resource.getHostId()
== plan.getHostId()) ||
-                            (resource.getClusterId() != null && resource.getClusterId()
== clusterofHost.getId()) ||
-                            (resource.getPodId() != null && resource.getPodId() ==
podOfHost.getId()) ||
-                            (resource.getDataCenterId() != null && resource.getDataCenterId()
== zoneOfHost.getId())) {
+                        if ((resource.getHostId() != null && resource.getHostId().longValue()
== plan.getHostId().longValue()) ||
+                                (resource.getClusterId() != null && resource.getClusterId().longValue()
== clusterofHost.getId()) ||
+                                (resource.getPodId() != null && resource.getPodId().longValue()
== podOfHost.getId()) ||
+                                (resource.getDataCenterId() != null && resource.getDataCenterId().longValue()
== zoneOfHost.getId())) {
                             canUse = true;
                         }
                     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c23e201/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalDiscoverer.java
b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalDiscoverer.java
index 76897f2..c312df7 100755
--- a/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalDiscoverer.java
+++ b/plugins/hypervisors/baremetal/src/com/cloud/baremetal/manager/BareMetalDiscoverer.java
@@ -33,10 +33,8 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.api.StartupCommand;
 import com.cloud.agent.api.StartupRoutingCommand;
@@ -44,18 +42,14 @@ import com.cloud.baremetal.networkservice.BareMetalResourceBase;
 import com.cloud.configuration.Config;
 import com.cloud.dc.ClusterVO;
 import com.cloud.dc.DataCenterVO;
-import com.cloud.dc.dao.ClusterDao;
-import com.cloud.dc.dao.DataCenterDao;
 import com.cloud.exception.DiscoveryException;
 import com.cloud.host.Host;
 import com.cloud.host.HostVO;
-import com.cloud.host.dao.HostDao;
 import com.cloud.hypervisor.Hypervisor;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.network.Network;
 import com.cloud.resource.Discoverer;
 import com.cloud.resource.DiscovererBase;
-import com.cloud.resource.ResourceManager;
 import com.cloud.resource.ResourceStateAdapter;
 import com.cloud.resource.ServerResource;
 import com.cloud.resource.UnableDeleteHostException;
@@ -71,17 +65,7 @@ import com.cloud.vm.dao.VMInstanceDao;
 public class BareMetalDiscoverer extends DiscovererBase implements Discoverer, ResourceStateAdapter
{
     protected static final Logger s_logger = Logger.getLogger(BareMetalDiscoverer.class);
     @Inject
-    protected ClusterDao _clusterDao;
-    @Inject
-    protected HostDao _hostDao;
-    @Inject
-    protected DataCenterDao _dcDao;
-    @Inject
     protected VMInstanceDao _vmDao = null;
-    @Inject
-    protected ResourceManager _resourceMgr;
-    @Inject
-    protected ConfigurationDao _configDao;
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException
{

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c23e201/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/discoverer/HypervServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/discoverer/HypervServerDiscoverer.java
b/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/discoverer/HypervServerDiscoverer.java
index 371a618..c3d79c5 100644
--- a/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/discoverer/HypervServerDiscoverer.java
+++ b/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/discoverer/HypervServerDiscoverer.java
@@ -43,12 +43,9 @@ import com.cloud.agent.api.SetupCommand;
 import com.cloud.agent.api.StartupCommand;
 import com.cloud.agent.api.StartupRoutingCommand;
 import com.cloud.alert.AlertManager;
-import com.cloud.dc.ClusterDetailsDao;
 import com.cloud.dc.ClusterVO;
 import com.cloud.dc.DataCenterVO;
 import com.cloud.dc.HostPodVO;
-import com.cloud.dc.dao.ClusterDao;
-import com.cloud.dc.dao.DataCenterDao;
 import com.cloud.dc.dao.HostPodDao;
 import com.cloud.exception.AgentUnavailableException;
 import com.cloud.exception.ConnectionException;
@@ -58,13 +55,11 @@ import com.cloud.host.Host;
 import com.cloud.host.HostEnvironment;
 import com.cloud.host.HostVO;
 import com.cloud.host.Status;
-import com.cloud.host.dao.HostDao;
 import com.cloud.hypervisor.Hypervisor;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.hypervisor.hyperv.resource.HypervDirectConnectResource;
 import com.cloud.resource.Discoverer;
 import com.cloud.resource.DiscovererBase;
-import com.cloud.resource.ResourceManager;
 import com.cloud.resource.ResourceStateAdapter;
 import com.cloud.resource.ServerResource;
 import com.cloud.resource.UnableDeleteHostException;
@@ -78,27 +73,14 @@ import com.cloud.storage.StorageLayer;
 @Local(value = Discoverer.class)
 public class HypervServerDiscoverer extends DiscovererBase implements Discoverer, Listener,
ResourceStateAdapter {
     private static final Logger s_logger = Logger.getLogger(HypervServerDiscoverer.class);
-
-    private String _instance;
-    private String _mountParent;
-    private int _timeout;
     Random _rand = new Random(System.currentTimeMillis());
 
     Map<String, String> _storageMounts = new HashMap<String, String>();
     StorageLayer _storage;
 
     @Inject
-    private HostDao _hostDao = null;
-    @Inject
-    private ClusterDao _clusterDao;
-    @Inject
-    private ClusterDetailsDao _clusterDetailsDao;
-    @Inject
-    private ResourceManager _resourceMgr;
-    @Inject
     private HostPodDao _podDao;
-    @Inject
-    private DataCenterDao _dcDao;
+
 
     // TODO: AgentManager and AlertManager not being used to transmit info,
     // may want to reconsider.

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c23e201/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index 3a5d27c..cdeedfe 100755
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -449,7 +449,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
     protected int _stopTimeout;
 
     // TODO vmsync {
-    protected static HashMap<DomainInfo.DomainState, State> s_statesTable;
+    protected static final HashMap<DomainInfo.DomainState, State> s_statesTable;
     static {
         s_statesTable = new HashMap<DomainInfo.DomainState, State>();
         s_statesTable.put(DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF, State.Stopped);
@@ -461,7 +461,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
     }
     // TODO vmsync }
 
-    protected static HashMap<DomainInfo.DomainState, PowerState> s_powerStatesTable;
+    protected static final HashMap<DomainInfo.DomainState, PowerState> s_powerStatesTable;
     static {
         s_powerStatesTable = new HashMap<DomainInfo.DomainState, PowerState>();
         s_powerStatesTable.put(DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF, PowerState.PowerOff);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c23e201/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtXMLParser.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtXMLParser.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtXMLParser.java
index c8793f1..9d34781 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtXMLParser.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtXMLParser.java
@@ -30,8 +30,7 @@ import org.xml.sax.helpers.DefaultHandler;
 
 public class LibvirtXMLParser extends DefaultHandler {
     private static final Logger s_logger = Logger.getLogger(LibvirtXMLParser.class);
-    protected static SAXParserFactory s_spf;
-
+    protected static final SAXParserFactory s_spf;
     static {
         s_spf = SAXParserFactory.newInstance();
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c23e201/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
index 654eee6..715e9f3 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorSecondaryDiscoverer.java
@@ -25,12 +25,11 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.storage.datastore.db.ImageStoreDao;
 import org.apache.cloudstack.storage.datastore.db.ImageStoreVO;
 import org.apache.cloudstack.storage.resource.SecondaryStorageDiscoverer;
 import org.apache.cloudstack.storage.resource.SecondaryStorageResource;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.Listener;
@@ -55,8 +54,6 @@ public class SimulatorSecondaryDiscoverer extends SecondaryStorageDiscoverer
imp
     @Inject
     AgentManager _agentMgr;
     @Inject
-    ResourceManager _resourceMgr;
-    @Inject
     SnapshotDao _snapshotDao;
     @Inject
     ImageStoreDao imageStoreDao;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c23e201/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
index 5ab5af0..51db0d9 100755
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java
@@ -27,12 +27,8 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
-
-import com.vmware.vim25.ClusterDasConfigInfo;
-import com.vmware.vim25.ManagedObjectReference;
-
 import org.apache.cloudstack.api.ApiConstants;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.api.StartupCommand;
 import com.cloud.agent.api.StartupRoutingCommand;
@@ -42,7 +38,6 @@ import com.cloud.dc.ClusterDetailsDao;
 import com.cloud.dc.ClusterVO;
 import com.cloud.dc.DataCenter.NetworkType;
 import com.cloud.dc.DataCenterVO;
-import com.cloud.dc.dao.DataCenterDao;
 import com.cloud.exception.DiscoveredWithErrorException;
 import com.cloud.exception.DiscoveryException;
 import com.cloud.exception.InvalidParameterValueException;
@@ -69,7 +64,6 @@ import com.cloud.network.element.CiscoNexusVSMElement;
 import com.cloud.network.element.NetworkElement;
 import com.cloud.resource.Discoverer;
 import com.cloud.resource.DiscovererBase;
-import com.cloud.resource.ResourceManager;
 import com.cloud.resource.ResourceStateAdapter;
 import com.cloud.resource.ServerResource;
 import com.cloud.resource.UnableDeleteHostException;
@@ -80,6 +74,8 @@ import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.user.Account;
 import com.cloud.utils.Pair;
 import com.cloud.utils.UriUtils;
+import com.vmware.vim25.ClusterDasConfigInfo;
+import com.vmware.vim25.ManagedObjectReference;
 
 @Local(value = Discoverer.class)
 public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer, ResourceStateAdapter
{
@@ -94,13 +90,7 @@ public class VmwareServerDiscoverer extends DiscovererBase implements Discoverer
     @Inject
     ClusterDetailsDao _clusterDetailsDao;
     @Inject
-    DataCenterDao _dcDao;
-    @Inject
-    ResourceManager _resourceMgr;
-    @Inject
     CiscoNexusVSMDeviceDao _nexusDao;
-    CiscoNexusVSMElement _nexusElement;
-    List<NetworkElement> networkElements;
     @Inject
     NetworkModel _netmgr;
     @Inject
@@ -113,6 +103,8 @@ public class VmwareServerDiscoverer extends DiscovererBase implements
Discoverer
     protected Map<String, String> _urlParams;
     protected boolean useDVS = false;
     protected boolean nexusDVS = false;
+    CiscoNexusVSMElement _nexusElement;
+    List<NetworkElement> networkElements;
 
     public VmwareServerDiscoverer() {
         s_logger.info("VmwareServerDiscoverer is constructed");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c23e201/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
index fbfd222..0ad6dc4 100755
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java
@@ -34,13 +34,6 @@ import javax.persistence.EntityExistsException;
 import org.apache.log4j.Logger;
 import org.apache.xmlrpc.XmlRpcException;
 
-import com.xensource.xenapi.Connection;
-import com.xensource.xenapi.Host;
-import com.xensource.xenapi.Pool;
-import com.xensource.xenapi.Session;
-import com.xensource.xenapi.Types.SessionAuthenticationFailed;
-import com.xensource.xenapi.Types.XenAPIException;
-
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.Listener;
 import com.cloud.agent.api.AgentControlAnswer;
@@ -57,7 +50,6 @@ import com.cloud.configuration.Config;
 import com.cloud.dc.ClusterVO;
 import com.cloud.dc.DataCenterVO;
 import com.cloud.dc.HostPodVO;
-import com.cloud.dc.dao.DataCenterDao;
 import com.cloud.dc.dao.HostPodDao;
 import com.cloud.exception.AgentUnavailableException;
 import com.cloud.exception.ConnectionException;
@@ -85,7 +77,6 @@ import com.cloud.hypervisor.xen.resource.XenServerConnectionPool;
 import com.cloud.hypervisor.xen.resource.Xenserver625Resource;
 import com.cloud.resource.Discoverer;
 import com.cloud.resource.DiscovererBase;
-import com.cloud.resource.ResourceManager;
 import com.cloud.resource.ResourceStateAdapter;
 import com.cloud.resource.ServerResource;
 import com.cloud.resource.UnableDeleteHostException;
@@ -99,6 +90,12 @@ import com.cloud.utils.db.QueryBuilder;
 import com.cloud.utils.db.SearchCriteria.Op;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.exception.HypervisorVersionChangedException;
+import com.xensource.xenapi.Connection;
+import com.xensource.xenapi.Host;
+import com.xensource.xenapi.Pool;
+import com.xensource.xenapi.Session;
+import com.xensource.xenapi.Types.SessionAuthenticationFailed;
+import com.xensource.xenapi.Types.XenAPIException;
 
 @Local(value = Discoverer.class)
 public class XcpServerDiscoverer extends DiscovererBase implements Discoverer, Listener,
ResourceStateAdapter {
@@ -122,11 +119,7 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer,
L
     @Inject
     VMTemplateDao _tmpltDao;
     @Inject
-    ResourceManager _resourceMgr;
-    @Inject
     HostPodDao _podDao;
-    @Inject
-    DataCenterDao _dcDao;
 
     protected XcpServerDiscoverer() {
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c23e201/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index d80bddc..9103b59 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -16,6 +16,7 @@
 // under the License.
 package com.cloud.hypervisor.xen.resource;
 
+
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileInputStream;
@@ -329,7 +330,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
         }
     }
 
-    protected static HashMap<Types.VmPowerState, PowerState> s_powerStatesTable;
+    protected static final HashMap<Types.VmPowerState, PowerState> s_powerStatesTable;
     static {
         s_powerStatesTable = new HashMap<Types.VmPowerState, PowerState>();
         s_powerStatesTable.put(Types.VmPowerState.HALTED, PowerState.PowerOff);
@@ -340,7 +341,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
     }
 
     // TODO vmsync {
-    protected static HashMap<Types.VmPowerState, State> s_statesTable;
+    protected static final HashMap<Types.VmPowerState, State> s_statesTable;
     static {
         s_statesTable = new HashMap<Types.VmPowerState, State>();
         s_statesTable.put(Types.VmPowerState.HALTED, State.Stopped);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c23e201/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetPublicNetworkGuru.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetPublicNetworkGuru.java
b/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetPublicNetworkGuru.java
index d81dc9d..5f0b155 100644
--- a/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetPublicNetworkGuru.java
+++ b/plugins/network-elements/midonet/src/com/cloud/network/guru/MidoNetPublicNetworkGuru.java
@@ -72,7 +72,7 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru {
     // Only change is to make broadcast domain type Mido
     @Override
     public Network design(NetworkOffering offering, DeploymentPlan plan, Network network,
Account owner) {
-        s_logger.debug("design called with network: " + network.toString());
+        s_logger.debug("design called with network: " + network);
         if (!canHandle(offering)) {
             return null;
         }
@@ -96,7 +96,7 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru {
         InsufficientAddressCapacityException, ConcurrentOperationException {
         if (nic.getIp4Address() == null) {
             PublicIp ip = _ipAddrMgr.assignPublicIpAddress(dc.getId(), null, vm.getOwner(),
Vlan.VlanType.VirtualNetwork, null, null, false);
-            nic.setIp4Address(ip.getAddress().toString());
+            nic.setIp4Address(ip.getAddress().addr());
 
             nic.setGateway(ip.getGateway());
 
@@ -121,7 +121,7 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru {
 
     @Override
     public void updateNicProfile(NicProfile profile, Network network) {
-        s_logger.debug("updateNicProfile called with network: " + network.toString() + "
profile: " + profile.toString());
+        s_logger.debug("updateNicProfile called with network: " + network + " profile: "
+ profile);
 
         DataCenter dc = _dcDao.findById(network.getDataCenterId());
         if (profile != null) {
@@ -134,17 +134,16 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru {
     public NicProfile allocate(Network network, NicProfile nic, VirtualMachineProfile vm)
throws InsufficientVirtualNetworkCapcityException,
         InsufficientAddressCapacityException, ConcurrentOperationException {
 
-        s_logger.debug("allocate called with network: " + network.toString() + " nic: " +
nic.toString() + " vm: " + vm.toString());
+        if (nic == null) {
+            nic = new NicProfile(Nic.ReservationStrategy.Create, null, null, null, null);
+        }
+        s_logger.debug("allocate called with network: " + network + " nic: " + nic + " vm:
" + vm);
         DataCenter dc = _dcDao.findById(network.getDataCenterId());
 
-        if (nic != null && nic.getRequestedIpv4() != null) {
+        if (nic.getRequestedIpv4() != null) {
             throw new CloudRuntimeException("Does not support custom ip allocation at this
time: " + nic);
         }
 
-        if (nic == null) {
-            nic = new NicProfile(Nic.ReservationStrategy.Create, null, null, null, null);
-        }
-
         getIp(nic, dc, vm, network);
 
         if (nic.getIp4Address() == null) {
@@ -163,7 +162,7 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru {
     @Override
     public void reserve(NicProfile nic, Network network, VirtualMachineProfile vm, DeployDestination
dest, ReservationContext context)
         throws InsufficientVirtualNetworkCapcityException, InsufficientAddressCapacityException,
ConcurrentOperationException {
-        s_logger.debug("reserve called with network: " + network.toString() + " nic: " +
nic.toString() + " vm: " + vm.toString());
+        s_logger.debug("reserve called with network: " + network + " nic: " + nic + " vm:
" + vm);
         if (nic.getIp4Address() == null) {
             getIp(nic, dest.getDataCenter(), vm, network);
         }
@@ -171,14 +170,14 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru {
 
     @Override
     public boolean release(NicProfile nic, VirtualMachineProfile vm, String reservationId)
{
-        s_logger.debug("release called with nic: " + nic.toString() + " vm: " + vm.toString());
+        s_logger.debug("release called with nic: " + nic + " vm: " + vm);
         return true;
     }
 
     @Override
     public Network implement(Network network, NetworkOffering offering, DeployDestination
destination, ReservationContext context)
         throws InsufficientVirtualNetworkCapcityException {
-        s_logger.debug("implement called with network: " + network.toString());
+        s_logger.debug("implement called with network: " + network);
         long dcId = destination.getDataCenter().getId();
 
         //get physical network id
@@ -205,7 +204,7 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru {
     @Override
     @DB
     public void deallocate(Network network, NicProfile nic, VirtualMachineProfile vm) {
-        s_logger.debug("deallocate called with network: " + network.toString() + " nic: "
+ nic.toString() + " vm: " + vm.toString());
+        s_logger.debug("deallocate called with network: " + network + " nic: " + nic + "
vm: " + vm);
         if (s_logger.isDebugEnabled()) {
             s_logger.debug("public network deallocate network: networkId: " + nic.getNetworkId()
+ ", ip: " + nic.getIp4Address());
         }
@@ -229,12 +228,12 @@ public class MidoNetPublicNetworkGuru extends PublicNetworkGuru {
 
     @Override
     public void shutdown(NetworkProfile network, NetworkOffering offering) {
-        s_logger.debug("shutdown called with network: " + network.toString());
+        s_logger.debug("shutdown called with network: " + network);
     }
 
     @Override
     public boolean trash(Network network, NetworkOffering offering) {
-        s_logger.debug("trash called with network: " + network.toString());
+        s_logger.debug("trash called with network: " + network);
         return true;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c23e201/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java b/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java
index 770099c..d127256 100644
--- a/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java
+++ b/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java
@@ -51,7 +51,6 @@ import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.network.PhysicalNetworkSetupInfo;
 import com.cloud.resource.Discoverer;
 import com.cloud.resource.DiscovererBase;
-import com.cloud.resource.ResourceManager;
 import com.cloud.resource.ResourceStateAdapter;
 import com.cloud.resource.ServerResource;
 import com.cloud.resource.UnableDeleteHostException;
@@ -65,8 +64,6 @@ public abstract class LibvirtServerDiscoverer extends DiscovererBase implements
     private String _kvmPublicNic;
     private String _kvmGuestNic;
     @Inject
-    ResourceManager _resourceMgr;
-    @Inject
     AgentManager _agentMgr;
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6c23e201/server/src/com/cloud/resource/DiscovererBase.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resource/DiscovererBase.java b/server/src/com/cloud/resource/DiscovererBase.java
index 0da72c0..ae2a9c9 100644
--- a/server/src/com/cloud/resource/DiscovererBase.java
+++ b/server/src/com/cloud/resource/DiscovererBase.java
@@ -25,13 +25,13 @@ import java.util.Map;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
-
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
+import org.apache.log4j.Logger;
 
 import com.cloud.configuration.Config;
 import com.cloud.dc.ClusterVO;
 import com.cloud.dc.dao.ClusterDao;
+import com.cloud.dc.dao.DataCenterDao;
 import com.cloud.host.HostVO;
 import com.cloud.host.dao.HostDao;
 import com.cloud.network.NetworkModel;
@@ -49,6 +49,10 @@ public abstract class DiscovererBase extends AdapterBase implements Discoverer
{
     protected NetworkModel _networkMgr;
     @Inject
     protected HostDao _hostDao;
+    @Inject
+    protected ResourceManager _resourceMgr;
+    @Inject
+    protected DataCenterDao _dcDao;
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException
{


Mime
View raw message