diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in index 6cec8b38223..608ffc43356 100644 --- a/client/tomcatconf/applicationContext.xml.in +++ b/client/tomcatconf/applicationContext.xml.in @@ -32,8 +32,6 @@ - - @@ -91,9 +89,6 @@ - - - @@ -165,5 +160,586 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/tomcatconf/componentContext.xml.in b/client/tomcatconf/componentContext.xml.in index 0b81016d184..159bf851f9e 100644 --- a/client/tomcatconf/componentContext.xml.in +++ b/client/tomcatconf/componentContext.xml.in @@ -30,298 +30,172 @@ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> - + - - + - + + - - - - + + + + + + + + + - - + + - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - + + + + + + + + + + + - - + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/client/tomcatconf/nonossComponentContext.xml.in b/client/tomcatconf/nonossComponentContext.xml.in index 6659e21b292..13bb3f536a5 100644 --- a/client/tomcatconf/nonossComponentContext.xml.in +++ b/client/tomcatconf/nonossComponentContext.xml.in @@ -33,315 +33,12 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -351,4 +48,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/src/com/cloud/deploy/FirstFitPlanner.java b/server/src/com/cloud/deploy/FirstFitPlanner.java index c219cfccaf2..0cbf72f2d7a 100755 --- a/server/src/com/cloud/deploy/FirstFitPlanner.java +++ b/server/src/com/cloud/deploy/FirstFitPlanner.java @@ -103,12 +103,24 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner { @Inject DataStoreManager dataStoreMgr; @Inject protected ClusterDetailsDao _clusterDetailsDao; - //@com.cloud.utils.component.Inject(adapter=StoragePoolAllocator.class) - @Inject protected List _storagePoolAllocators; + protected List _storagePoolAllocators; + public List getStoragePoolAllocators() { + return _storagePoolAllocators; + } + public void setStoragePoolAllocators( + List _storagePoolAllocators) { + this._storagePoolAllocators = _storagePoolAllocators; + } - //@com.cloud.utils.component.Inject(adapter=HostAllocator.class) - @Inject protected List _hostAllocators; - protected String _allocationAlgorithm = "random"; + protected List _hostAllocators; + public List getHostAllocators() { + return _hostAllocators; + } + public void setHostAllocators(List _hostAllocators) { + this._hostAllocators = _hostAllocators; + } + + protected String _allocationAlgorithm = "random"; @Override diff --git a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java index bba8be5c649..25c5a043b6c 100755 --- a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java +++ b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java @@ -116,11 +116,23 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai ClusterDetailsDao _clusterDetailsDao; long _serverId; - @Inject List _investigators; - @Inject - List _fenceBuilders; - @Inject + public List getInvestigators() { + return _investigators; + } + public void setInvestigators(List _investigators) { + this._investigators = _investigators; + } + + List _fenceBuilders; + public List getFenceBuilders() { + return _fenceBuilders; + } + public void setFenceBuilders(List _fenceBuilders) { + this._fenceBuilders = _fenceBuilders; + } + + @Inject AgentManager _agentMgr; @Inject AlertManager _alertMgr; diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java index b2ceb46d1ab..a4eac3687ad 100755 --- a/server/src/com/cloud/network/NetworkManagerImpl.java +++ b/server/src/com/cloud/network/NetworkManagerImpl.java @@ -243,16 +243,41 @@ public class NetworkManagerImpl extends ManagerBase implements NetworkManager, L @Inject PodVlanMapDao _podVlanMapDao; - @Inject List _networkGurus; + public List getNetworkGurus() { + return _networkGurus; + } + public void setNetworkGurus(List _networkGurus) { + this._networkGurus = _networkGurus; + } - @Inject protected List _networkElements; + List _networkElements; + public List getNetworkElements() { + return _networkElements; + } + public void setNetworkElements(List _networkElements) { + this._networkElements = _networkElements; + } - @Inject NetworkDomainDao _networkDomainDao; - @Inject List _ipDeployers; - @Inject List _dhcpProviders; - - @Inject + @Inject NetworkDomainDao _networkDomainDao; + + List _ipDeployers; + public List getIpDeployers() { + return _ipDeployers; + } + public void setIpDeployers(List _ipDeployers) { + this._ipDeployers = _ipDeployers; + } + + List _dhcpProviders; + public List getDhcpProviders() { + return _dhcpProviders; + } + public void setDhcpProviders(List _dhcpProviders) { + this._dhcpProviders = _dhcpProviders; + } + + @Inject VMInstanceDao _vmDao; @Inject FirewallManager _firewallMgr; diff --git a/server/src/com/cloud/network/NetworkModelImpl.java b/server/src/com/cloud/network/NetworkModelImpl.java index 41ce103b360..788e031d4a6 100644 --- a/server/src/com/cloud/network/NetworkModelImpl.java +++ b/server/src/com/cloud/network/NetworkModelImpl.java @@ -143,9 +143,15 @@ public class NetworkModelImpl extends ManagerBase implements NetworkModel { @Inject PodVlanMapDao _podVlanMapDao; - @Inject List _networkElements; - - @Inject + List _networkElements; + public List getNetworkElements() { + return _networkElements; + } + public void setNetworkElements(List _networkElements) { + this._networkElements = _networkElements; + } + + @Inject NetworkDomainDao _networkDomainDao; @Inject VMInstanceDao _vmDao; diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java index 15d32e0640d..82bca5194bf 100755 --- a/server/src/com/cloud/resource/ResourceManagerImpl.java +++ b/server/src/com/cloud/resource/ResourceManagerImpl.java @@ -206,19 +206,29 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager, protected HighAvailabilityManager _haMgr; @Inject protected StorageService _storageSvr; - // @com.cloud.utils.component.Inject(adapter = Discoverer.class) + + protected List _discoverers; + public List getDiscoverers() { + return _discoverers; + } + public void setDiscoverers(List _discoverers) { + this._discoverers = _discoverers; + } + @Inject - protected List _discoverers; - @Inject protected ClusterManager _clusterMgr; @Inject protected StoragePoolHostDao _storagePoolHostDao; - // @com.cloud.utils.component.Inject(adapter = PodAllocator.class) - @Inject - protected List _podAllocators = null; + protected List _podAllocators; + public List getPodAllocators() { + return _podAllocators; + } + public void setPodAllocators(List _podAllocators) { + this._podAllocators = _podAllocators; + } - @Inject + @Inject protected VMTemplateDao _templateDao; @Inject protected ConfigurationManager _configMgr; diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index 26bc18d986a..d0904e1049c 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -16,6 +16,98 @@ // under the License. package com.cloud.server; +import java.lang.reflect.Field; +import java.net.Inet6Address; +import java.net.InetAddress; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.UnknownHostException; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Comparator; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TimeZone; +import java.util.UUID; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +import javax.annotation.PostConstruct; +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import javax.inject.Inject; +import javax.management.InstanceAlreadyExistsException; +import javax.management.MBeanRegistrationException; +import javax.management.MalformedObjectNameException; +import javax.management.NotCompliantMBeanException; +import javax.naming.ConfigurationException; + +import com.cloud.storage.dao.*; +import org.apache.cloudstack.acl.SecurityChecker.AccessType; +import org.apache.cloudstack.api.ApiConstants; + +import com.cloud.event.ActionEventUtils; +import org.apache.cloudstack.api.BaseUpdateTemplateOrIsoCmd; +import org.apache.cloudstack.api.command.admin.account.*; +import org.apache.cloudstack.api.command.admin.autoscale.*; +import org.apache.cloudstack.api.command.admin.cluster.*; +import org.apache.cloudstack.api.command.admin.config.*; +import org.apache.cloudstack.api.command.admin.domain.*; +import org.apache.cloudstack.api.command.admin.host.*; +import org.apache.cloudstack.api.command.admin.ldap.*; +import org.apache.cloudstack.api.command.admin.network.*; +import org.apache.cloudstack.api.command.admin.offering.*; +import org.apache.cloudstack.api.command.admin.pod.*; +import org.apache.cloudstack.api.command.admin.region.*; +import org.apache.cloudstack.api.command.admin.resource.*; +import org.apache.cloudstack.api.command.admin.router.*; +import org.apache.cloudstack.api.command.admin.storage.*; +import org.apache.cloudstack.api.command.admin.swift.*; +import org.apache.cloudstack.api.command.admin.systemvm.*; +import org.apache.cloudstack.api.command.admin.template.*; +import org.apache.cloudstack.api.command.admin.usage.*; +import org.apache.cloudstack.api.command.admin.user.*; +import org.apache.cloudstack.api.command.admin.vlan.*; +import org.apache.cloudstack.api.command.admin.vm.*; +import org.apache.cloudstack.api.command.admin.vpc.*; +import org.apache.cloudstack.api.command.admin.zone.*; +import org.apache.cloudstack.api.command.user.account.*; +import org.apache.cloudstack.api.command.user.address.*; +import org.apache.cloudstack.api.command.user.autoscale.*; +import org.apache.cloudstack.api.command.user.config.*; +import org.apache.cloudstack.api.command.user.event.*; +import org.apache.cloudstack.api.command.user.firewall.*; +import org.apache.cloudstack.api.command.user.guest.*; +import org.apache.cloudstack.api.command.user.iso.*; +import org.apache.cloudstack.api.command.user.job.*; +import org.apache.cloudstack.api.command.user.loadbalancer.*; +import org.apache.cloudstack.api.command.user.nat.*; +import org.apache.cloudstack.api.command.user.network.*; +import org.apache.cloudstack.api.command.user.offering.*; +import org.apache.cloudstack.api.command.user.project.*; +import org.apache.cloudstack.api.command.user.region.*; +import org.apache.cloudstack.api.command.user.resource.*; +import org.apache.cloudstack.api.command.user.securitygroup.*; +import org.apache.cloudstack.api.command.user.snapshot.*; +import org.apache.cloudstack.api.command.user.ssh.*; +import org.apache.cloudstack.api.command.user.tag.*; +import org.apache.cloudstack.api.command.user.template.*; +import org.apache.cloudstack.api.command.user.vm.*; +import org.apache.cloudstack.api.command.user.vmgroup.*; +import org.apache.cloudstack.api.command.user.volume.*; +import org.apache.cloudstack.api.command.user.vpc.*; +import org.apache.cloudstack.api.command.user.vpn.*; +import org.apache.cloudstack.api.command.user.zone.*; +import org.apache.cloudstack.api.response.ExtractResponse; +import org.apache.commons.codec.binary.Base64; +import org.apache.log4j.Logger; +import org.springframework.stereotype.Component; + import com.cloud.agent.AgentManager; import com.cloud.agent.api.GetVncPortAnswer; import com.cloud.agent.api.GetVncPortCommand; @@ -97,7 +189,15 @@ import com.cloud.user.*; import com.cloud.user.dao.AccountDao; import com.cloud.user.dao.SSHKeyPairDao; import com.cloud.user.dao.UserDao; -import com.cloud.utils.*; +import com.cloud.utils.EnumUtils; +import com.cloud.utils.NumbersUtil; +import com.cloud.utils.Pair; +import com.cloud.utils.PasswordGenerator; +import com.cloud.utils.ReflectUtil; +import com.cloud.utils.Ternary; +import com.cloud.utils.component.Adapter; +import com.cloud.utils.component.AdapterBase; +import com.cloud.utils.component.ComponentContext; import com.cloud.utils.component.ComponentLifecycle; import com.cloud.utils.component.ManagerBase; import com.cloud.utils.concurrency.NamedThreadFactory; @@ -324,9 +424,9 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe @Inject private HypervisorCapabilitiesDao _hypervisorCapabilitiesDao; - @Inject private List _hostAllocators; - @Inject + + @Inject private ConfigurationManager _configMgr; @Inject private ResourceTagDao _resourceTagDao; @@ -373,6 +473,14 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe public void setUserAuthenticators(List authenticators) { _userAuthenticators = authenticators; } + + public List getHostAllocators() { + return _hostAllocators; + } + + public void setHostAllocators(List _hostAllocators) { + this._hostAllocators = _hostAllocators; + } @Override public boolean configure(String name, Map params) @@ -406,7 +514,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe return true; } - @Override + @Override public boolean start() { s_logger.info("Startup CloudStack management server..."); diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index f37654bb317..a33d524d8ea 100755 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -276,8 +276,6 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C @Inject protected SecondaryStorageVmManager _ssvmMgr; @Inject - protected List _storagePoolAllocators; - @Inject ConfigurationDao _configDao; @Inject ManagementServer _msServer; @@ -296,12 +294,26 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C @Inject protected HypervisorCapabilitiesDao _hypervisorCapabilitiesDao; - // TODO : we don't have any instantiated pool discover, disable injection - // temporarily - // @Inject - protected List _discoverers; + @Inject protected ResourceTagDao _resourceTagDao; - protected SearchBuilder HostTemplateStatesSearch; + protected List _storagePoolAllocators; + public List getStoragePoolAllocators() { + return _storagePoolAllocators; + } + public void setStoragePoolAllocators( + List _storagePoolAllocators) { + this._storagePoolAllocators = _storagePoolAllocators; + } + + protected List _discoverers; + public List getDiscoverers() { + return _discoverers; + } + public void setDiscoverers(List _discoverers) { + this._discoverers = _discoverers; + } + + protected SearchBuilder HostTemplateStatesSearch; protected GenericSearchBuilder UpHostsInPoolSearch; protected SearchBuilder StoragePoolSearch; protected SearchBuilder LocalStorageSearch; diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java index 77864fdfb8e..40db4ed2f86 100755 --- a/server/src/com/cloud/user/AccountManagerImpl.java +++ b/server/src/com/cloud/user/AccountManagerImpl.java @@ -230,9 +230,9 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M UserVO _systemUser; AccountVO _systemAccount; - @Inject List _securityCheckers; - int _cleanupInterval; + + int _cleanupInterval; public List getUserAuthenticators() { return _userAuthenticators; @@ -242,6 +242,14 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M _userAuthenticators = authenticators; } + public List getSecurityCheckers() { + return _securityCheckers; + } + + public void setSecurityCheckers(List securityCheckers) { + this._securityCheckers = securityCheckers; + } + @Override public boolean configure(final String name, final Map params) throws ConfigurationException { _systemAccount = _accountDao.findById(AccountVO.ACCOUNT_ID_SYSTEM); diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java index a6d0b1b5d11..23746ae64f9 100755 --- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -208,13 +208,23 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac @Inject protected VMSnapshotDao _vmSnapshotDao; - @Inject protected List _planners; + public List getPlanners() { + return _planners; + } + public void setPlanners(List _planners) { + this._planners = _planners; + } - @Inject protected List _hostAllocators; + public List getHostAllocators() { + return _hostAllocators; + } + public void setHostAllocators(List _hostAllocators) { + this._hostAllocators = _hostAllocators; + } - @Inject + @Inject protected ResourceManager _resourceMgr; @Inject