cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [04/36] Moved NetworkManagerImpl to NetworkOrchestrator
Date Fri, 06 Sep 2013 22:38:34 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/src/com/cloud/network/NetworkRuleApplier.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkRuleApplier.java b/server/src/com/cloud/network/NetworkRuleApplier.java
deleted file mode 100644
index 31763d0..0000000
--- a/server/src/com/cloud/network/NetworkRuleApplier.java
+++ /dev/null
@@ -1,28 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package com.cloud.network;
-
-import java.util.List;
-
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.network.rules.FirewallRule;
-
-public interface NetworkRuleApplier {
-    public boolean applyRules(Network network, FirewallRule.Purpose purpose, List<? extends FirewallRule> rules) throws ResourceUnavailableException;
-    
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/src/com/cloud/network/addr/PublicIp.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/addr/PublicIp.java b/server/src/com/cloud/network/addr/PublicIp.java
deleted file mode 100644
index b18c691..0000000
--- a/server/src/com/cloud/network/addr/PublicIp.java
+++ /dev/null
@@ -1,235 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.addr;
-
-import java.util.Date;
-
-import com.cloud.dc.VlanVO;
-import com.cloud.network.PublicIpAddress;
-import com.cloud.network.dao.IPAddressVO;
-import com.cloud.utils.net.Ip;
-import com.cloud.utils.net.NetUtils;
-
-/**
- */
-public class PublicIp implements PublicIpAddress {
-    IPAddressVO _addr;
-    VlanVO _vlan;
-    String macAddress;
-
-    public PublicIp(IPAddressVO addr, VlanVO vlan, long macAddress) {
-        _addr = addr;
-        _vlan = vlan;
-        this.macAddress = NetUtils.long2Mac(macAddress);
-    }
-
-    public static PublicIp createFromAddrAndVlan(IPAddressVO addr, VlanVO vlan) {
-    	return new PublicIp(addr, vlan, NetUtils.createSequenceBasedMacAddress(addr.getMacAddress()));
-    }
-    
-    @Override
-    public Ip getAddress() {
-        return _addr.getAddress();
-    }
-
-    @Override
-    public String getNetmask() {
-        return _vlan.getVlanNetmask();
-    }
-
-    @Override
-    public String getGateway() {
-        return _vlan.getVlanGateway();
-    }
-
-    @Override
-    public String getVlanTag() {
-        return _vlan.getVlanTag();
-    }
-
-    @Override
-    public long getDataCenterId() {
-        return _addr.getDataCenterId();
-    }
-
-    @Override
-    public boolean readyToUse() {
-        return _addr.getAllocatedTime() != null && _addr.getState() == State.Allocated;
-    }
-
-    @Override
-    public boolean isSourceNat() {
-        return _addr.isSourceNat();
-    }
-
-    @Override
-    public boolean isOneToOneNat() {
-        return _addr.isOneToOneNat();
-    }
-
-    @Override
-    public Long getAssociatedWithVmId() {
-        return _addr.getAssociatedWithVmId();
-    }
-
-    @Override
-    public Date getAllocatedTime() {
-        return _addr.getAllocatedTime();
-    }
-
-    @Override
-    public long getAccountId() {
-        return _addr.getAccountId();
-    }
-
-    @Override
-    public long getDomainId() {
-        return _addr.getDomainId();
-    }
-
-    @Override
-    public long getVlanId() {
-        return _vlan.getId();
-    }
-
-    @Override
-    public State getState() {
-        return _addr.getState();
-    }
-
-    public IPAddressVO ip() {
-        return _addr;
-    }
-
-    public VlanVO vlan() {
-        return _vlan;
-    }
-
-    @Override
-    public String getMacAddress() {
-        return macAddress;
-    }
-
-    @Override
-    public Long getAssociatedWithNetworkId() {
-        return _addr.getAssociatedWithNetworkId();
-    }
-
-    @Override
-    public Long getNetworkId() {
-        return _vlan.getNetworkId();
-    }
-
-    @Override
-    public String getVlanGateway() {
-        return _vlan.getVlanGateway();
-    }
-
-    @Override
-    public String getVlanNetmask() {
-        return _vlan.getVlanNetmask();
-    }
-
-    @Override
-    public String getIpRange() {
-        return _vlan.getIpRange();
-    }
-
-    @Override
-    public VlanType getVlanType() {
-        return _vlan.getVlanType();
-    }
-
-    @Override
-    public long getId() {
-        return _addr.getId();
-    }
-
-
-    @Override
-    public String getUuid() {
-        return _addr.getUuid();
-    }
-
-    @Override
-    public String toString() {
-        return _addr.getAddress().toString();
-    }
-
-    @Override
-    public Long getPhysicalNetworkId() {
-        return _vlan.getPhysicalNetworkId();
-    }
-
-	@Override
-	public void setState(State state) {
-		_addr.setState(state);
-	}
-
-	@Override
-	public Long getAllocatedToAccountId() {
-		return _addr.getAllocatedToAccountId();
-	}
-
-	@Override
-	public Long getAllocatedInDomainId() {
-		return _addr.getAllocatedInDomainId();
-	}
-
-	@Override
-    public boolean getSystem() {
-        return _addr.getSystem();
-    }
-	
-    @Override
-    public Long getVpcId() {
-       return _addr.getVpcId();
-    }
-
-    @Override
-    public String getIp6Gateway() {
-        return _vlan.getIp6Gateway();
-    }
-
-    @Override
-    public String getIp6Cidr() {
-        return _vlan.getIp6Cidr();
-    }
-
-    @Override
-    public String getIp6Range() {
-        return _vlan.getIp6Range();
-    }
-
-    @Override
-    public String getVmIp() {
-        return _addr.getVmIp();
-    }
-
-    @Override
-    public boolean isPortable() {
-        return _addr.isPortable();
-    }
-
-    public void setPortable(boolean portable) {
-        _addr.setPortable(portable);
-    }
-
-    public Long getIpMacAddress() {
-        return  _addr.getMacAddress();
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/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 893e140..1943e16 100755
--- a/server/src/com/cloud/network/guru/ControlNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/ControlNetworkGuru.java
@@ -232,7 +232,7 @@ public class ControlNetworkGuru extends PodBasedNetworkGuru implements NetworkGu
     }
 
     @Override
-    public boolean trash(Network config, NetworkOffering offering, Account owner) {
+    public boolean trash(Network config, NetworkOffering offering) {
         return true;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/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 b30a0c6..55da113 100755
--- a/server/src/com/cloud/network/guru/DirectNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/DirectNetworkGuru.java
@@ -303,7 +303,7 @@ public class DirectNetworkGuru extends AdapterBase implements NetworkGuru {
 
     @Override
     @DB
-    public boolean trash(Network network, NetworkOffering offering, Account owner) {
+    public boolean trash(Network network, NetworkOffering offering) {
         //Have to remove all placeholder nics
         List<NicVO> nics = _nicDao.listPlaceholderNicsByNetworkId(network.getId());
         Transaction txn = Transaction.currentTxn();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/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 aed470a..a3eab0f 100755
--- a/server/src/com/cloud/network/guru/GuestNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/GuestNetworkGuru.java
@@ -424,7 +424,7 @@ public abstract class GuestNetworkGuru extends AdapterBase implements NetworkGur
     }
 
     @Override
-    public boolean trash(Network network, NetworkOffering offering, Account owner) {
+    public boolean trash(Network network, NetworkOffering offering) {
         return true;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/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 3862465..ab64f8e 100755
--- a/server/src/com/cloud/network/guru/PodBasedNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/PodBasedNetworkGuru.java
@@ -166,7 +166,7 @@ public class PodBasedNetworkGuru extends AdapterBase implements NetworkGuru {
     }
     
     @Override
-    public boolean trash(Network config, NetworkOffering offering, Account owner) {
+    public boolean trash(Network config, NetworkOffering offering) {
         return true;
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/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 9f02175..12dce85 100644
--- a/server/src/com/cloud/network/guru/PrivateNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/PrivateNetworkGuru.java
@@ -234,7 +234,7 @@ public class PrivateNetworkGuru extends AdapterBase implements NetworkGuru {
     }
 
     @Override
-    public boolean trash(Network network, NetworkOffering offering, Account owner) {
+    public boolean trash(Network network, NetworkOffering offering) {
         return true;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/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 b6ecb84..f82e22e 100755
--- a/server/src/com/cloud/network/guru/PublicNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/PublicNetworkGuru.java
@@ -215,7 +215,7 @@ public class PublicNetworkGuru extends AdapterBase implements NetworkGuru {
     }
 
     @Override
-    public boolean trash(Network network, NetworkOffering offering, Account owner) {
+    public boolean trash(Network network, NetworkOffering offering) {
         return true;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/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 86dd5f6..6d82dc5 100755
--- a/server/src/com/cloud/network/guru/StorageNetworkGuru.java
+++ b/server/src/com/cloud/network/guru/StorageNetworkGuru.java
@@ -177,7 +177,7 @@ public class StorageNetworkGuru extends PodBasedNetworkGuru implements NetworkGu
 	}
 
 	@Override
-	public boolean trash(Network network, NetworkOffering offering, Account owner) {
+	public boolean trash(Network network, NetworkOffering offering) {
 		// TODO Auto-generated method stub
 		return false;
 	}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/src/com/cloud/network/lb/LoadBalancingRulesManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/lb/LoadBalancingRulesManager.java b/server/src/com/cloud/network/lb/LoadBalancingRulesManager.java
deleted file mode 100644
index 2218f7d..0000000
--- a/server/src/com/cloud/network/lb/LoadBalancingRulesManager.java
+++ /dev/null
@@ -1,62 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.network.lb;
-
-import java.util.List;
-
-import org.apache.cloudstack.context.CallContext;
-
-import com.cloud.exception.NetworkRuleConflictException;
-import com.cloud.exception.ResourceUnavailableException;
-import com.cloud.network.lb.LoadBalancingRule.LbDestination;
-import com.cloud.network.lb.LoadBalancingRule.LbHealthCheckPolicy;
-import com.cloud.network.lb.LoadBalancingRule.LbStickinessPolicy;
-import com.cloud.network.rules.LbStickinessMethod;
-import com.cloud.network.rules.LoadBalancer;
-import com.cloud.network.rules.LoadBalancerContainer.Scheme;
-import com.cloud.user.Account;
-
-public interface LoadBalancingRulesManager extends LoadBalancingRulesService {
-
-    LoadBalancer createPublicLoadBalancer(String xId, String name, String description, 
-            int srcPort, int destPort, long sourceIpId, String protocol, String algorithm, boolean openFirewall, CallContext caller)
-            throws NetworkRuleConflictException;
-
-    boolean removeAllLoadBalanacersForIp(long ipId, Account caller, long callerUserId);
-    boolean removeAllLoadBalanacersForNetwork(long networkId, Account caller, long callerUserId);
-    List<LbDestination> getExistingDestinations(long lbId);
-    List<LbStickinessPolicy> getStickinessPolicies(long lbId);
-    List<LbStickinessMethod> getStickinessMethods(long networkid);
-    List<LbHealthCheckPolicy> getHealthCheckPolicies(long lbId);
-
-    /**
-     * Remove vm from all load balancers
-     * @param vmId
-     * @return true if removal is successful
-     */
-    boolean removeVmFromLoadBalancers(long vmId);
-    boolean applyLoadBalancersForNetwork(long networkId, Scheme scheme) throws ResourceUnavailableException;
-    String getLBCapability(long networkid, String capabilityName);
-    boolean configureLbAutoScaleVmGroup(long vmGroupid, String currentState) throws ResourceUnavailableException;
-    boolean revokeLoadBalancersForNetwork(long networkId, Scheme scheme) throws ResourceUnavailableException;
-
-    boolean validateLbRule(LoadBalancingRule lbRule);
-
-    void removeLBRule(LoadBalancer rule);
-
-    void isLbServiceSupportedInNetwork(long networkId, Scheme scheme);
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/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 ca562a9..c685ee3 100755
--- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
+++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
@@ -31,7 +31,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
@@ -162,7 +161,6 @@ import com.cloud.vm.VirtualMachine.State;
 import com.cloud.vm.dao.NicDao;
 import com.cloud.vm.dao.UserVmDao;
 
-@Component
 @Local(value = { LoadBalancingRulesManager.class, LoadBalancingRulesService.class })
 public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements LoadBalancingRulesManager,
         LoadBalancingRulesService {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/src/com/cloud/resource/ResourceManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/resource/ResourceManager.java b/server/src/com/cloud/resource/ResourceManager.java
index 6efe867..85af36f 100755
--- a/server/src/com/cloud/resource/ResourceManager.java
+++ b/server/src/com/cloud/resource/ResourceManager.java
@@ -18,14 +18,11 @@ package com.cloud.resource;
 
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 import com.cloud.agent.api.StartupCommand;
 import com.cloud.agent.api.StartupRoutingCommand;
-import com.cloud.dc.DataCenter;
 import com.cloud.dc.DataCenterVO;
 import com.cloud.dc.HostPodVO;
-import com.cloud.dc.Pod;
 import com.cloud.dc.PodCluster;
 import com.cloud.exception.AgentUnavailableException;
 import com.cloud.host.Host;
@@ -34,10 +31,7 @@ import com.cloud.host.HostStats;
 import com.cloud.host.HostVO;
 import com.cloud.host.Status;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.offering.ServiceOffering;
 import com.cloud.resource.ResourceState.Event;
-import com.cloud.template.VirtualMachineTemplate;
-import com.cloud.utils.Pair;
 import com.cloud.utils.fsm.NoTransitionException;
 
 /**
@@ -117,16 +111,6 @@ public interface ResourceManager extends ResourceService {
 
     public List<HostVO> listHostsByNameLike(String name);
 
-    /**
-     * Find a pod based on the user id, template, and data center.
-     * 
-     * @param template
-     * @param dc
-     * @param userId
-     * @return
-     */
-    Pair<Pod, Long> findPod(VirtualMachineTemplate template, ServiceOffering offering, DataCenter dc, long accountId, Set<Long> avoids);
-
     HostStats getHostStatistics(long hostId);
 
     Long getGuestOSCategoryId(long hostId);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/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 400879d..59c7097 100755
--- a/server/src/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/com/cloud/resource/ResourceManagerImpl.java
@@ -25,7 +25,6 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 import javax.ejb.Local;
 import javax.inject.Inject;
@@ -67,7 +66,6 @@ import com.cloud.agent.api.UnsupportedAnswer;
 import com.cloud.agent.api.UpdateHostPasswordCommand;
 import com.cloud.agent.manager.AgentAttache;
 import com.cloud.agent.manager.ClusteredAgentManagerImpl;
-import com.cloud.agent.manager.allocator.PodAllocator;
 import com.cloud.agent.transport.Request;
 import com.cloud.api.ApiDBUtils;
 import com.cloud.capacity.Capacity;
@@ -79,13 +77,11 @@ import com.cloud.configuration.ConfigurationManager;
 import com.cloud.dc.ClusterDetailsDao;
 import com.cloud.dc.ClusterDetailsVO;
 import com.cloud.dc.ClusterVO;
-import com.cloud.dc.DataCenter;
 import com.cloud.dc.DataCenter.NetworkType;
 import com.cloud.dc.DataCenterIpAddressVO;
 import com.cloud.dc.DataCenterVO;
 import com.cloud.dc.DedicatedResourceVO;
 import com.cloud.dc.HostPodVO;
-import com.cloud.dc.Pod;
 import com.cloud.dc.PodCluster;
 import com.cloud.dc.dao.ClusterDao;
 import com.cloud.dc.dao.ClusterVSMMapDao;
@@ -119,7 +115,6 @@ import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.hypervisor.kvm.discoverer.KvmDummyResourceBase;
 import com.cloud.network.dao.IPAddressDao;
 import com.cloud.network.dao.IPAddressVO;
-import com.cloud.offering.ServiceOffering;
 import com.cloud.org.Cluster;
 import com.cloud.org.Grouping;
 import com.cloud.org.Grouping.AllocationState;
@@ -136,11 +131,9 @@ import com.cloud.storage.dao.GuestOSCategoryDao;
 import com.cloud.storage.dao.StoragePoolHostDao;
 import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.storage.secondary.SecondaryStorageVmManager;
-import com.cloud.template.VirtualMachineTemplate;
 import com.cloud.user.Account;
 import com.cloud.user.AccountManager;
 import com.cloud.user.User;
-import com.cloud.utils.Pair;
 import com.cloud.utils.StringUtils;
 import com.cloud.utils.UriUtils;
 import com.cloud.utils.component.Manager;
@@ -237,15 +230,6 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
     @Inject
     protected StoragePoolHostDao _storagePoolHostDao;
 
-    protected List<PodAllocator> _podAllocators;
-
-    public List<PodAllocator> getPodAllocators() {
-        return _podAllocators;
-    }
-
-    public void setPodAllocators(List<PodAllocator> _podAllocators) {
-        this._podAllocators = _podAllocators;
-    }
 
     @Inject
     protected VMTemplateDao _templateDao;
@@ -2472,17 +2456,6 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
         return sc.list();
     }
 
-    @Override
-    public Pair<Pod, Long> findPod(VirtualMachineTemplate template, ServiceOffering offering, DataCenter dc, long accountId,
-            Set<Long> avoids) {
-        for (PodAllocator allocator : _podAllocators) {
-            final Pair<Pod, Long> pod = allocator.allocateTo(template, offering, dc, accountId, avoids);
-            if (pod != null) {
-                return pod;
-            }
-        }
-        return null;
-    }
 
     @Override
     public HostStats getHostStatistics(long hostId) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/src/com/cloud/storage/VolumeApiServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
index d50a1d0..cc99589 100644
--- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java
+++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java
@@ -18,10 +18,8 @@ package com.cloud.storage;
 
 import java.util.ArrayList;
 import java.util.Date;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.ExecutionException;
 
@@ -48,7 +46,6 @@ import org.apache.cloudstack.engine.subsystem.api.storage.HostScope;
 import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
 import org.apache.cloudstack.engine.subsystem.api.storage.Scope;
 import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotDataFactory;
-import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo;
 import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator;
 import org.apache.cloudstack.engine.subsystem.api.storage.TemplateDataFactory;
 import org.apache.cloudstack.engine.subsystem.api.storage.VolumeDataFactory;
@@ -86,7 +83,6 @@ import com.cloud.consoleproxy.ConsoleProxyManager;
 import com.cloud.dc.ClusterVO;
 import com.cloud.dc.DataCenter;
 import com.cloud.dc.DataCenterVO;
-import com.cloud.dc.Pod;
 import com.cloud.dc.dao.ClusterDao;
 import com.cloud.dc.dao.DataCenterDao;
 import com.cloud.dc.dao.HostPodDao;
@@ -140,7 +136,6 @@ import com.cloud.user.dao.UserDao;
 import com.cloud.user.dao.VmDiskStatisticsDao;
 import com.cloud.utils.EnumUtils;
 import com.cloud.utils.NumbersUtil;
-import com.cloud.utils.Pair;
 import com.cloud.utils.UriUtils;
 import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.DB;
@@ -149,7 +144,6 @@ import com.cloud.utils.db.Transaction;
 import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.utils.fsm.NoTransitionException;
 import com.cloud.utils.fsm.StateMachine2;
-import com.cloud.vm.DiskProfile;
 import com.cloud.vm.UserVmManager;
 import com.cloud.vm.UserVmVO;
 import com.cloud.vm.VMInstanceVO;
@@ -692,7 +686,7 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
     protected VolumeVO createVolumeFromSnapshot(VolumeVO volume, long snapshotId) throws StorageUnavailableException {
         VolumeInfo createdVolume = null;
         SnapshotVO snapshot = _snapshotDao.findById(snapshotId);
-        createdVolume = createVolumeFromSnapshot(volume, snapshot);
+        createdVolume = _volumeMgr.createVolumeFromSnapshot(volume, snapshot);
 
         UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_CREATE, createdVolume.getAccountId(), createdVolume.getDataCenterId(), createdVolume.getId(),
                 createdVolume.getName(), createdVolume.getDiskOfferingId(), null, createdVolume.getSize(), Volume.class.getName(), createdVolume.getUuid());
@@ -700,56 +694,6 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic
         return _volsDao.findById(createdVolume.getId());
     }
 
-    @DB
-    protected VolumeInfo createVolumeFromSnapshot(VolumeVO volume, SnapshotVO snapshot) throws StorageUnavailableException {
-        Account account = _accountDao.findById(volume.getAccountId());
-
-        final HashSet<StoragePool> poolsToAvoid = new HashSet<StoragePool>();
-        StoragePool pool = null;
-
-        Set<Long> podsToAvoid = new HashSet<Long>();
-        Pair<Pod, Long> pod = null;
-
-        DiskOfferingVO diskOffering = _diskOfferingDao.findByIdIncludingRemoved(volume.getDiskOfferingId());
-        DataCenterVO dc = _dcDao.findById(volume.getDataCenterId());
-        DiskProfile dskCh = new DiskProfile(volume, diskOffering, snapshot.getHypervisorType());
-
-        // Determine what pod to store the volume in
-        while ((pod = _resourceMgr.findPod(null, null, dc, account.getId(), podsToAvoid)) != null) {
-            podsToAvoid.add(pod.first().getId());
-            // Determine what storage pool to store the volume in
-            while ((pool = _volumeMgr.findStoragePool(dskCh, dc, pod.first(), null, null, null, poolsToAvoid)) != null) {
-                break;
-            }
-        }
-
-        if (pool == null) {
-            String msg = "There are no available storage pools to store the volume in";
-            s_logger.info(msg);
-            throw new StorageUnavailableException(msg, -1);
-        }
-
-        VolumeInfo vol = volFactory.getVolume(volume.getId());
-        DataStore store = dataStoreMgr.getDataStore(pool.getId(), DataStoreRole.Primary);
-        SnapshotInfo snapInfo = snapshotFactory.getSnapshot(snapshot.getId(), DataStoreRole.Image);
-        AsyncCallFuture<VolumeApiResult> future = volService.createVolumeFromSnapshot(vol, store, snapInfo);
-        try {
-            VolumeApiResult result = future.get();
-            if (result.isFailed()) {
-                s_logger.debug("Failed to create volume from snapshot:" + result.getResult());
-                throw new CloudRuntimeException("Failed to create volume from snapshot:" + result.getResult());
-            }
-            return result.getVolume();
-        } catch (InterruptedException e) {
-            s_logger.debug("Failed to create volume from snapshot", e);
-            throw new CloudRuntimeException("Failed to create volume from snapshot", e);
-        } catch (ExecutionException e) {
-            s_logger.debug("Failed to create volume from snapshot", e);
-            throw new CloudRuntimeException("Failed to create volume from snapshot", e);
-        }
-
-    }
-
     @Override
     @DB
     @ActionEvent(eventType = EventTypes.EVENT_VOLUME_RESIZE, eventDescription = "resizing volume", async = true)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/src/com/cloud/storage/dao/GuestOSHypervisorDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/dao/GuestOSHypervisorDao.java b/server/src/com/cloud/storage/dao/GuestOSHypervisorDao.java
deleted file mode 100644
index 945a542..0000000
--- a/server/src/com/cloud/storage/dao/GuestOSHypervisorDao.java
+++ /dev/null
@@ -1,27 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.storage.dao;
-
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.storage.GuestOSHypervisorVO;
-import com.cloud.utils.db.GenericDao;
-
-public interface GuestOSHypervisorDao extends GenericDao<GuestOSHypervisorVO, Long> {
-
-     HypervisorType findHypervisorTypeByGuestOsId(long guestOsId);
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/src/com/cloud/storage/dao/GuestOSHypervisorDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/dao/GuestOSHypervisorDaoImpl.java b/server/src/com/cloud/storage/dao/GuestOSHypervisorDaoImpl.java
deleted file mode 100644
index 48de6e9..0000000
--- a/server/src/com/cloud/storage/dao/GuestOSHypervisorDaoImpl.java
+++ /dev/null
@@ -1,49 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.storage.dao;
-
-import javax.ejb.Local;
-
-import org.springframework.stereotype.Component;
-
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.storage.GuestOSHypervisorVO;
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-
-@Component
-@Local(value = { GuestOSHypervisorDao.class })
-public class GuestOSHypervisorDaoImpl extends GenericDaoBase<GuestOSHypervisorVO, Long> implements GuestOSHypervisorDao {
-
-    protected final SearchBuilder<GuestOSHypervisorVO> guestOsSearch;
-
-    protected GuestOSHypervisorDaoImpl() {
-        guestOsSearch = createSearchBuilder();
-        guestOsSearch.and("guest_os_id", guestOsSearch.entity().getGuestOsId(), SearchCriteria.Op.EQ);
-        guestOsSearch.done();
-    }
-
-    @Override
-    public HypervisorType findHypervisorTypeByGuestOsId(long guestOsId) {
-        SearchCriteria<GuestOSHypervisorVO> sc = guestOsSearch.create();
-        sc.setParameters("guest_os_id", guestOsId);
-        GuestOSHypervisorVO goh = findOneBy(sc);
-        return HypervisorType.getType(goh.getHypervisorType());
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/src/com/cloud/storage/dao/VolumeDetailsDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/dao/VolumeDetailsDao.java b/server/src/com/cloud/storage/dao/VolumeDetailsDao.java
deleted file mode 100644
index 4e786ba..0000000
--- a/server/src/com/cloud/storage/dao/VolumeDetailsDao.java
+++ /dev/null
@@ -1,36 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.storage.dao;
-
-import java.util.List;
-import java.util.Map;
-
-import com.cloud.storage.VolumeDetailVO;
-import com.cloud.utils.db.GenericDao;
-
-public interface VolumeDetailsDao extends GenericDao<VolumeDetailVO, Long> {
-    List<VolumeDetailVO> findDetails(long volumeId);
-
-    void persist(long vmId, Map<String, String> details);
-
-    VolumeDetailVO findDetail(long vmId, String name);
-
-    void deleteDetails(long vmId);
-
-    public void removeDetails(long volumeId, String key);
-
-    }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/src/com/cloud/storage/dao/VolumeDetailsDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/dao/VolumeDetailsDaoImpl.java b/server/src/com/cloud/storage/dao/VolumeDetailsDaoImpl.java
deleted file mode 100644
index 40af999..0000000
--- a/server/src/com/cloud/storage/dao/VolumeDetailsDaoImpl.java
+++ /dev/null
@@ -1,114 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.storage.dao;
-
-import java.util.List;
-import java.util.Map;
-
-import javax.ejb.Local;
-
-import com.cloud.storage.VolumeDetailVO;
-import org.springframework.stereotype.Component;
-
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-import com.cloud.utils.db.Transaction;
-
-@Component
-@Local(value=VolumeDetailsDao.class)
-public class VolumeDetailsDaoImpl extends GenericDaoBase<VolumeDetailVO, Long> implements VolumeDetailsDao {
-    protected final SearchBuilder<VolumeDetailVO> VolumeSearch;
-    protected final SearchBuilder<VolumeDetailVO> DetailSearch;
-    protected final SearchBuilder<VolumeDetailVO> VolumeDetailSearch;
-
-    public VolumeDetailsDaoImpl() {
-        VolumeSearch = createSearchBuilder();
-        VolumeSearch.and("volumeId", VolumeSearch.entity().getVolumeId(), SearchCriteria.Op.EQ);
-        VolumeSearch.done();
-
-        DetailSearch = createSearchBuilder();
-        DetailSearch.and("volumeId", DetailSearch.entity().getVolumeId(), SearchCriteria.Op.EQ);
-        DetailSearch.and("name", DetailSearch.entity().getName(), SearchCriteria.Op.EQ);
-        DetailSearch.done();
-
-        VolumeDetailSearch = createSearchBuilder();
-        VolumeDetailSearch.and("volumeId", VolumeDetailSearch.entity().getVolumeId(), SearchCriteria.Op.EQ);
-        VolumeDetailSearch.and("name", VolumeDetailSearch.entity().getName(), SearchCriteria.Op.IN);
-        VolumeDetailSearch.done();
-
-    }
-
-    @Override
-    public void deleteDetails(long volumeId) {
-        SearchCriteria<VolumeDetailVO> sc = VolumeSearch.create();
-        sc.setParameters("volumeId", volumeId);
-
-        List<VolumeDetailVO> results = search(sc, null);
-        for (VolumeDetailVO result : results) {
-            remove(result.getId());
-        }
-    }
-
-    @Override
-    public VolumeDetailVO findDetail(long volumeId, String name) {
-        SearchCriteria<VolumeDetailVO> sc = DetailSearch.create();
-        sc.setParameters("volumeId", volumeId);
-        sc.setParameters("name", name);
-
-        return findOneBy(sc);
-    }
-
-    @Override
-    public void removeDetails(long volumeId, String key) {
-
-        if(key != null){
-            VolumeDetailVO detail = findDetail(volumeId, key);
-            if(detail != null){
-                remove(detail.getId());
-            }
-        }else {
-           deleteDetails(volumeId);
-        }
-
-    }
-
-    @Override
-    public List<VolumeDetailVO> findDetails(long volumeId) {
-        SearchCriteria<VolumeDetailVO> sc = VolumeSearch.create();
-        sc.setParameters("volumeId", volumeId);
-
-        List<VolumeDetailVO> results = search(sc, null);
-        return results;
-    }
-
-    @Override
-    public void persist(long volumeId, Map<String, String> details) {
-        Transaction txn = Transaction.currentTxn();
-        txn.start();
-        SearchCriteria<VolumeDetailVO> sc = VolumeSearch.create();
-        sc.setParameters("volumeId", volumeId);
-        expunge(sc);
-
-        for (Map.Entry<String, String> detail : details.entrySet()) {
-            VolumeDetailVO vo = new VolumeDetailVO(volumeId, detail.getKey(), detail.getValue());
-            persist(vo);
-        }
-        txn.commit();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/src/com/cloud/template/TemplateManager.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateManager.java b/server/src/com/cloud/template/TemplateManager.java
deleted file mode 100755
index 8427fa9..0000000
--- a/server/src/com/cloud/template/TemplateManager.java
+++ /dev/null
@@ -1,117 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.template;
-
-import java.util.List;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
-import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
-import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO;
-
-import com.cloud.dc.DataCenterVO;
-import com.cloud.exception.InternalErrorException;
-import com.cloud.exception.ResourceAllocationException;
-import com.cloud.exception.StorageUnavailableException;
-import com.cloud.host.HostVO;
-import com.cloud.storage.StoragePool;
-import com.cloud.storage.VMTemplateHostVO;
-import com.cloud.storage.VMTemplateStoragePoolVO;
-import com.cloud.storage.VMTemplateVO;
-import com.cloud.utils.Pair;
-
-/**
- * TemplateManager manages the templates stored on secondary storage. It is responsible for creating private/public templates.
- */
-public interface TemplateManager extends TemplateApiService{
-
-    /**
-     * Prepares a template for vm creation for a certain storage pool.
-     *
-     * @param template
-     *            template to prepare
-     * @param pool
-     *            pool to make sure the template is ready in.
-     * @return VMTemplateStoragePoolVO if preparation is complete; null if not.
-     */
-    VMTemplateStoragePoolVO prepareTemplateForCreate(VMTemplateVO template, StoragePool pool);
-
-    boolean resetTemplateDownloadStateOnPool(long templateStoragePoolRefId);
-
-    /**
-     * Copies a template from its current secondary storage server to the secondary storage server in the specified zone.
-     *
-     * @param template
-     * @param srcSecStore
-     * @param destZone
-     * @return true if success
-     * @throws InternalErrorException
-     * @throws StorageUnavailableException
-     * @throws ResourceAllocationException
-     */
-    boolean copy(long userId, VMTemplateVO template, DataStore srcSecStore, DataCenterVO dstZone) throws StorageUnavailableException, ResourceAllocationException;
-
-    /**
-     * Deletes a template from secondary storage servers
-     *
-     * @param userId
-     * @param templateId
-     * @param zoneId
-     *            - optional. If specified, will only delete the template from the specified zone's secondary storage server.
-     * @return true if success
-     */
-    boolean delete(long userId, long templateId, Long zoneId);
-
-    /**
-     * Lists templates in the specified storage pool that are not being used by any VM.
-     *
-     * @param pool
-     * @return list of VMTemplateStoragePoolVO
-     */
-    List<VMTemplateStoragePoolVO> getUnusedTemplatesInPool(StoragePoolVO pool);
-
-    /**
-     * Deletes a template in the specified storage pool.
-     *
-     * @param templatePoolVO
-     */
-    void evictTemplateFromStoragePool(VMTemplateStoragePoolVO templatePoolVO);
-
-    boolean templateIsDeleteable(VMTemplateHostVO templateHostRef);
-
-    boolean templateIsDeleteable(long templateId);
-
-    Pair<String, String> getAbsoluteIsoPath(long templateId, long dataCenterId);
-
-    String getSecondaryStorageURL(long zoneId);
-
-    DataStore getImageStore(long zoneId, long tmpltId);
-
-    Long getTemplateSize(long templateId, long zoneId);
-
-    DataStore getImageStore(String storeUuid, Long zoneId);
-
-    String getChecksum(DataStore store, String templatePath);
-
-    List<DataStore> getImageStoreByTemplate(long templateId, Long zoneId);
-
-    TemplateInfo prepareIso(long isoId, long dcId);
-
-
-
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/src/com/cloud/template/TemplateManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java
index e085be6..8a54355 100755
--- a/server/src/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/com/cloud/template/TemplateManagerImpl.java
@@ -31,7 +31,6 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.acl.SecurityChecker.AccessType;
 import org.apache.cloudstack.api.BaseListTemplateOrIsoPermissionsCmd;
@@ -183,7 +182,6 @@ import com.cloud.vm.VirtualMachine.State;
 import com.cloud.vm.dao.UserVmDao;
 import com.cloud.vm.dao.VMInstanceDao;
 
-@Component
 @Local(value = { TemplateManager.class, TemplateApiService.class })
 public class TemplateManagerImpl extends ManagerBase implements TemplateManager, TemplateApiService {
     private final static Logger s_logger = Logger.getLogger(TemplateManagerImpl.class);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/src/com/cloud/vm/NicDetailVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/NicDetailVO.java b/server/src/com/cloud/vm/NicDetailVO.java
deleted file mode 100644
index 9149972..0000000
--- a/server/src/com/cloud/vm/NicDetailVO.java
+++ /dev/null
@@ -1,85 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.vm;
-
-import org.apache.cloudstack.api.InternalIdentity;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name="nic_details")
-public class NicDetailVO implements InternalIdentity {
-    @Id
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-    @Column(name="id")
-    private long id;
-
-    @Column(name="nic_id")
-    private long nicId;
-
-    @Column(name="name")
-    private String name;
-
-    @Column(name="value", length=1024)
-    private String value;
-
-    public NicDetailVO() {}
-
-    public NicDetailVO(long nicId, String name, String value) {
-        this.nicId = nicId;
-        this.name = name;
-        this.value = value;
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public long getNicId() {
-        return nicId;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setId(long id) {
-        this.id = id;
-    }
-
-    public void setNicId(long nicId) {
-        this.nicId = nicId;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/src/com/cloud/vm/ReservationContextImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/ReservationContextImpl.java b/server/src/com/cloud/vm/ReservationContextImpl.java
deleted file mode 100644
index b53841c..0000000
--- a/server/src/com/cloud/vm/ReservationContextImpl.java
+++ /dev/null
@@ -1,96 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.vm;
-
-import com.cloud.domain.Domain;
-import com.cloud.user.Account;
-import com.cloud.user.User;
-import com.cloud.utils.Journal;
-import com.cloud.utils.db.EntityManager;
-
-public class ReservationContextImpl implements ReservationContext {
-    User _caller;
-    Account _account;
-    Domain _domain;
-    Journal _journal;
-    String _reservationId;
-    
-    public ReservationContextImpl(String reservationId, Journal journal, User caller) {
-        this(reservationId, journal, caller, null, null);
-    }
-    
-    public ReservationContextImpl(String reservationId, Journal journal, User caller, Account account) {
-        this(reservationId, journal, caller, account, null);
-        
-    }
-    
-    public ReservationContextImpl(String reservationId, Journal journal, User caller, Account account, Domain domain) {
-        _caller = caller;
-        _account = account;
-        _domain = domain;
-        _journal = journal;
-        _reservationId = reservationId;
-    }
-    
-    @Override
-    public long getDomainId() {
-        return 0;
-    }
-
-    @Override
-    public long getAccountId() {
-        return _caller.getAccountId();
-    }
-
-    @Override
-    public User getCaller() {
-        return _caller;
-    }
-
-    @Override
-    public Account getAccount() {
-        if (_account == null) {
-            _account = s_entityMgr.findById(Account.class, _caller.getId());
-        }
-        return _account;
-    }
-
-    @Override
-    public Domain getDomain() {
-        if (_domain == null) {
-            getAccount();
-            _domain = s_entityMgr.findById(Domain.class, _account.getDomainId());
-        }
-        return _domain;
-    }
-
-    @Override
-    public Journal getJournal() {
-        return _journal;
-    }
-
-    @Override
-    public String getReservationId() {
-        return _reservationId;
-    }
-    
-    static EntityManager s_entityMgr;
-    
-    static public void init(EntityManager entityMgr) {
-        s_entityMgr = entityMgr;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/src/com/cloud/vm/VirtualMachineProfileImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/VirtualMachineProfileImpl.java b/server/src/com/cloud/vm/VirtualMachineProfileImpl.java
deleted file mode 100644
index 8282b16..0000000
--- a/server/src/com/cloud/vm/VirtualMachineProfileImpl.java
+++ /dev/null
@@ -1,258 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.vm;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import com.cloud.agent.api.to.DiskTO;
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.offering.ServiceOffering;
-import com.cloud.service.ServiceOfferingVO;
-import com.cloud.template.VirtualMachineTemplate;
-import com.cloud.template.VirtualMachineTemplate.BootloaderType;
-import com.cloud.user.Account;
-import com.cloud.utils.db.EntityManager;
-
-/**
- * Implementation of VirtualMachineProfile.
- *
- */
-public class VirtualMachineProfileImpl implements VirtualMachineProfile {
-
-    VirtualMachine _vm;
-    ServiceOffering _offering;
-    VirtualMachineTemplate _template;
-    UserVmDetailVO _userVmDetails;
-    Map<Param, Object> _params;
-    List<NicProfile> _nics = new ArrayList<NicProfile>();
-    List<DiskTO> _disks = new ArrayList<DiskTO>();
-    StringBuilder _bootArgs = new StringBuilder();
-    Account _owner;
-    BootloaderType _bootloader;
-    Float cpuOvercommitRatio = 1.0f;
-    Float memoryOvercommitRatio = 1.0f;
-
-    VirtualMachine.Type _type;
-
-    public VirtualMachineProfileImpl(VirtualMachine vm, VirtualMachineTemplate template, ServiceOffering offering, Account owner, Map<Param, Object> params) {
-        _vm = vm;
-        _template = template;
-        _offering = offering;
-        _params = params;
-        _owner = owner;
-        if (_params == null) {
-            _params = new HashMap<Param, Object>();
-        }
-        if (vm != null)
-        	_type = vm.getType();
-    }
-
-    public VirtualMachineProfileImpl(VirtualMachine vm) {
-        this(vm, null, null, null, null);
-    }
-
-    public VirtualMachineProfileImpl(VirtualMachine.Type type) {
-        _type = type;
-    }
-
-    @Override
-    public String toString() {
-        return _vm.toString();
-    }
-
-    @Override
-    public VirtualMachine getVirtualMachine() {
-        return _vm;
-    }
-
-    @Override
-    public ServiceOffering getServiceOffering() {
-        if (_offering == null) {
-            _offering = s_entityMgr.findById(ServiceOffering.class, _vm.getServiceOfferingId());
-        }
-        return _offering;
-    }
-
-    @Override
-    public void setParameter(Param name, Object value) {
-        _params.put(name, value);
-    }
-
-    @Override
-    public void setBootLoaderType(BootloaderType bootLoader) {
-    	_bootloader = bootLoader;
-    }
-
-    @Override
-    public VirtualMachineTemplate getTemplate() {
-        if (_template == null && _vm != null) {
-            _template = s_entityMgr.findById(VirtualMachineTemplate.class, _vm.getTemplateId());
-        }
-        return _template;
-    }
-
-    @Override
-    public HypervisorType getHypervisorType() {
-        return _vm.getHypervisorType();
-    }
-
-    @Override
-    public long getTemplateId() {
-        return _vm.getTemplateId();
-    }
-
-    @Override
-    public long getServiceOfferingId() {
-        return _vm.getServiceOfferingId();
-    }
-
-    @Override
-    public long getId() {
-        return _vm.getId();
-    }
-
-    @Override
-    public String getUuid() {
-	return _vm.getUuid();
-    }
-
-    public void setNics(List<NicProfile> nics) {
-        _nics = nics;
-    }
-
-    public void setDisks(List<DiskTO> disks) {
-        _disks = disks;
-    }
-
-    @Override
-    public List<NicProfile> getNics() {
-        return _nics;
-    }
-
-    @Override
-    public List<DiskTO> getDisks() {
-        return _disks;
-    }
-
-    @Override
-    public void addNic(int index, NicProfile nic) {
-        _nics.add(index, nic);
-    }
-
-    @Override
-    public void addDisk(int index, DiskTO disk) {
-        _disks.add(index, disk);
-    }
-
-    @Override
-    public StringBuilder getBootArgsBuilder() {
-        return _bootArgs;
-    }
-
-    @Override
-    public void addBootArgs(String... args) {
-        for (String arg : args) {
-            _bootArgs.append(arg).append(" ");
-        }
-    }
-
-    @Override
-    public VirtualMachine.Type getType() {
-        return _type;
-    }
-
-    @Override
-    public Account getOwner() {
-        if (_owner == null) {
-            _owner = s_entityMgr.findById(Account.class, _vm.getAccountId());
-        }
-        return _owner;
-    }
-
-    @Override
-    public String getBootArgs() {
-        return _bootArgs.toString();
-    }
-
-    static EntityManager s_entityMgr;
-
-    static void init(EntityManager entityMgr) {
-        s_entityMgr = entityMgr;
-    }
-
-    @Override
-    public void addNic(NicProfile nic) {
-        _nics.add(nic);
-    }
-
-    @Override
-    public void addDisk(DiskTO disk) {
-        _disks.add(disk);
-    }
-
-    @Override
-    public Object getParameter(Param name) {
-        return _params.get(name);
-    }
-
-    @Override
-    public String getHostName() {
-        return _vm.getHostName();
-    }
-
-    @Override
-    public String getInstanceName() {
-        return _vm.getInstanceName();
-    }
-
-	@Override
-	public BootloaderType getBootLoaderType() {
-		return _bootloader;
-	}
-
-	@Override
-	public Map<Param, Object> getParameters() {
-	    return _params;
-	}
-
-	public void setServiceOffering(ServiceOfferingVO offering) {
-		_offering = offering;
-	}
-
-    public void setCpuOvercommitRatio(Float cpuOvercommitRatio) {
-        this.cpuOvercommitRatio = cpuOvercommitRatio;
-
-    }
-
-    public void setMemoryOvercommitRatio(Float memoryOvercommitRatio) {
-        this.memoryOvercommitRatio = memoryOvercommitRatio;
-
-    }
-
-    @Override
-    public Float getCpuOvercommitRatio() {
-        return  cpuOvercommitRatio;
-    }
-
-    @Override
-    public Float getMemoryOvercommitRatio() {
-        return memoryOvercommitRatio;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/src/com/cloud/vm/dao/NicDetailDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/dao/NicDetailDao.java b/server/src/com/cloud/vm/dao/NicDetailDao.java
deleted file mode 100644
index 38eb2f2..0000000
--- a/server/src/com/cloud/vm/dao/NicDetailDao.java
+++ /dev/null
@@ -1,35 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.vm.dao;
-
-import java.util.List;
-import java.util.Map;
-
-import com.cloud.utils.db.GenericDao;
-import com.cloud.vm.NicDetailVO;
-
-public interface NicDetailDao extends GenericDao<NicDetailVO, Long> {
-    List<NicDetailVO> findDetails(long nicId);
-
-    void persist(long nicId, Map<String, String> details);
-
-    NicDetailVO findDetail(long nicId, String name);
-
-    void deleteDetails(long nicId);
-
-    void removeDetails(Long id, String key);
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/src/com/cloud/vm/dao/NicDetailDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/dao/NicDetailDaoImpl.java b/server/src/com/cloud/vm/dao/NicDetailDaoImpl.java
deleted file mode 100644
index e166891..0000000
--- a/server/src/com/cloud/vm/dao/NicDetailDaoImpl.java
+++ /dev/null
@@ -1,110 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.vm.dao;
-
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-import com.cloud.utils.db.Transaction;
-import com.cloud.vm.NicDetailVO;
-import org.springframework.stereotype.Component;
-
-import javax.ejb.Local;
-import java.util.List;
-import java.util.Map;
-
-@Component
-@Local (value={NicDetailDao.class})
-public class NicDetailDaoImpl extends GenericDaoBase<NicDetailVO, Long> implements NicDetailDao {
-    protected final SearchBuilder<NicDetailVO> NicSearch;
-    protected final SearchBuilder<NicDetailVO> DetailSearch;
-
-    public NicDetailDaoImpl() {
-        NicSearch = createSearchBuilder();
-        NicSearch.and("nicId", NicSearch.entity().getNicId(), SearchCriteria.Op.EQ);
-        NicSearch.done();
-
-        DetailSearch = createSearchBuilder();
-        DetailSearch.and("nicId", DetailSearch.entity().getNicId(), SearchCriteria.Op.EQ);
-        DetailSearch.and("name", DetailSearch.entity().getName(), SearchCriteria.Op.EQ);
-        DetailSearch.done();
-    }
-
-    @Override
-    public void deleteDetails(long nicId) {
-        SearchCriteria<NicDetailVO> sc = NicSearch.create();
-        sc.setParameters("nicId", nicId);
-
-        List<NicDetailVO> results = search(sc, null);
-        for (NicDetailVO result : results) {
-            remove(result.getId());
-        }
-    }
-
-    @Override
-    public NicDetailVO findDetail(long nicId, String name) {
-        SearchCriteria<NicDetailVO> sc = DetailSearch.create();
-        sc.setParameters("nicId", nicId);
-        sc.setParameters("name", name);
-
-        return findOneBy(sc);
-    }
-
-    @Override
-    public List<NicDetailVO> findDetails(long nicId) {
-        SearchCriteria<NicDetailVO> sc = NicSearch.create();
-        sc.setParameters("nicId", nicId);
-
-        List<NicDetailVO> results = search(sc, null);
-        /*Map<String, String> details = new HashMap<String, String>(results.size());
-        for (NicDetailVO result : results) {
-            details.put(result.getName(), result.getValue());
-        } */
-
-        return results;
-    }
-
-    @Override
-    public void persist(long nicId, Map<String, String> details) {
-        Transaction txn = Transaction.currentTxn();
-        txn.start();
-        SearchCriteria<NicDetailVO> sc = NicSearch.create();
-        sc.setParameters("nicId", nicId);
-        expunge(sc);
-
-        for (Map.Entry<String, String> detail : details.entrySet()) {
-            NicDetailVO vo = new NicDetailVO(nicId, detail.getKey(), detail.getValue());
-            persist(vo);
-        }
-        txn.commit();
-    }
-
-    @Override
-    public void removeDetails(Long nicId, String key) {
-
-        if(key != null){
-            NicDetailVO detail = findDetail(nicId, key);
-            if(detail != null){
-                remove(detail.getId());
-            }
-        }else {
-            deleteDetails(nicId);
-        }
-
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/src/com/cloud/vm/dao/NicIpAliasDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/dao/NicIpAliasDao.java b/server/src/com/cloud/vm/dao/NicIpAliasDao.java
deleted file mode 100644
index 2a0da92..0000000
--- a/server/src/com/cloud/vm/dao/NicIpAliasDao.java
+++ /dev/null
@@ -1,60 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.vm.dao;
-
-import java.util.List;
-import com.cloud.utils.db.GenericDao;
-import com.cloud.vm.NicIpAlias;
-
-public interface NicIpAliasDao extends GenericDao<NicIpAliasVO, Long> {
-    List<NicIpAliasVO> listByVmId(long instanceId);
-
-    List<String> listAliasIpAddressInNetwork(long networkConfigId);
-    List<NicIpAliasVO> listByNetworkId(long networkId);
-
-    NicIpAliasVO findByInstanceIdAndNetworkId(long networkId, long instanceId);
-
-    NicIpAliasVO findByIp4AddressAndNetworkId(String ip4Address, long networkId);
-
-    /**
-     * @param networkId
-     * @param instanceId
-     * @return
-     */
-
-    List<NicIpAliasVO> getAliasIpForVm(long vmId);
-
-    List<NicIpAliasVO> listByNicId(long nicId);
-
-    List<NicIpAliasVO> listByNicIdAndVmid(long nicId, long vmId);
-
-    NicIpAliasVO findByIp4AddressAndNicId(String ip4Address, long nicId);
-
-    NicIpAliasVO findByIp4AddressAndNetworkIdAndInstanceId(long networkId,
-                                                               Long vmId, String vmIp);
-
-    List<String> getAliasIpAddressesForNic(long nicId);
-
-    Integer countAliasIps(long NicId);
-
-    public NicIpAliasVO findByIp4AddressAndVmId(String ip4Address, long vmId);
-
-    NicIpAliasVO findByGatewayAndNetworkIdAndState(String gateway, long networkId, NicIpAlias.state state);
-
-    List<NicIpAliasVO> listByNetworkIdAndState(long networkId, NicIpAlias.state state);
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/src/com/cloud/vm/dao/NicIpAliasDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/dao/NicIpAliasDaoImpl.java b/server/src/com/cloud/vm/dao/NicIpAliasDaoImpl.java
deleted file mode 100644
index 2cd8a2f..0000000
--- a/server/src/com/cloud/vm/dao/NicIpAliasDaoImpl.java
+++ /dev/null
@@ -1,177 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.vm.dao;
-
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.GenericSearchBuilder;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-import com.cloud.utils.db.SearchCriteria.Func;
-import com.cloud.utils.db.SearchCriteria.Op;
-import com.cloud.vm.NicIpAlias;
-import org.springframework.stereotype.Component;
-
-import javax.ejb.Local;
-import java.util.ArrayList;
-import java.util.List;
-
-
-@Component
-@Local(value=NicIpAliasDao.class)
-public class NicIpAliasDaoImpl extends GenericDaoBase<NicIpAliasVO, Long> implements NicIpAliasDao {
-    private final SearchBuilder<NicIpAliasVO> AllFieldsSearch;
-    private final GenericSearchBuilder<NicIpAliasVO, String> IpSearch;
-
-    protected NicIpAliasDaoImpl() {
-        super();
-        AllFieldsSearch = createSearchBuilder();
-        AllFieldsSearch.and("instanceId", AllFieldsSearch.entity().getVmId(), Op.EQ);
-        AllFieldsSearch.and("network", AllFieldsSearch.entity().getNetworkId(), Op.EQ);
-        AllFieldsSearch.and("address", AllFieldsSearch.entity().getIp4Address(), Op.EQ);
-        AllFieldsSearch.and("nicId", AllFieldsSearch.entity().getNicId(), Op.EQ);
-        AllFieldsSearch.and("gateway", AllFieldsSearch.entity().getGateway(), Op.EQ);
-        AllFieldsSearch.and("state", AllFieldsSearch.entity().getState(), Op.EQ);
-        AllFieldsSearch.done();
-
-        IpSearch = createSearchBuilder(String.class);
-        IpSearch.select(null, Func.DISTINCT, IpSearch.entity().getIp4Address());
-        IpSearch.and("network", IpSearch.entity().getNetworkId(), Op.EQ);
-        IpSearch.and("address", IpSearch.entity().getIp4Address(), Op.NNULL);
-        IpSearch.done();
-    }
-
-    @Override
-    public List<NicIpAliasVO> listByVmId(long instanceId) {
-        SearchCriteria<NicIpAliasVO> sc = AllFieldsSearch.create();
-        sc.setParameters("instanceId", instanceId);
-        return listBy(sc);
-    }
-
-    @Override
-    public List<NicIpAliasVO> listByNicId(long nicId) {
-        SearchCriteria<NicIpAliasVO> sc = AllFieldsSearch.create();
-        sc.setParameters("nicId", nicId);
-        return listBy(sc);
-    }
-
-    @Override
-    public List<String> listAliasIpAddressInNetwork(long networkId) {
-        SearchCriteria<String> sc = IpSearch.create();
-        sc.setParameters("network", networkId);
-        return customSearch(sc, null);
-    }
-
-    @Override
-    public List<NicIpAliasVO> listByNetworkId(long networkId) {
-        SearchCriteria<NicIpAliasVO> sc = AllFieldsSearch.create();
-        sc.setParameters("network", networkId);
-        return listBy(sc);
-    }
-
-
-    @Override
-    public List<NicIpAliasVO> listByNetworkIdAndState(long networkId, NicIpAlias.state state) {
-        SearchCriteria<NicIpAliasVO> sc = AllFieldsSearch.create();
-        sc.setParameters("network", networkId);
-        sc.setParameters("state", state);
-        return listBy(sc);
-    }
-
-    @Override
-    public List<NicIpAliasVO> listByNicIdAndVmid(long nicId, long vmId) {
-        SearchCriteria<NicIpAliasVO> sc = AllFieldsSearch.create();
-        sc.setParameters("nicId", nicId);
-        sc.setParameters("instanceId", vmId);
-        return listBy(sc);
-    }
-
-    @Override
-    public List<NicIpAliasVO> getAliasIpForVm(long vmId) {
-        SearchCriteria<NicIpAliasVO> sc = AllFieldsSearch.create();
-        sc.setParameters("instanceId", vmId);
-        sc.setParameters("state", NicIpAlias.state.active);
-        return listBy(sc);
-    }
-
-    @Override
-    public List<String> getAliasIpAddressesForNic(long nicId) {
-        SearchCriteria<NicIpAliasVO> sc = AllFieldsSearch.create();
-        sc.setParameters("nicId", nicId);
-        List<NicIpAliasVO> results = search(sc, null);
-        List<String> ips = new ArrayList<String>(results.size());
-        for (NicIpAliasVO result : results) {
-            ips.add(result.getIp4Address());
-        }
-        return ips;
-    }
-
-    @Override
-    public NicIpAliasVO findByInstanceIdAndNetworkId(long networkId, long instanceId) {
-        SearchCriteria<NicIpAliasVO> sc = AllFieldsSearch.create();
-        sc.setParameters("network", networkId);
-        sc.setParameters("instanceId", instanceId);
-        sc.setParameters("state", NicIpAlias.state.active);
-        return findOneBy(sc);
-    }
-
-    @Override
-    public NicIpAliasVO findByIp4AddressAndNetworkId(String ip4Address, long networkId) {
-        return null;  //To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public NicIpAliasVO findByGatewayAndNetworkIdAndState(String gateway, long networkId, NicIpAlias.state state) {
-        SearchCriteria<NicIpAliasVO> sc = AllFieldsSearch.create();
-        sc.setParameters("gateway", gateway);
-        sc.setParameters("network", networkId);
-        sc.setParameters("state", state);
-        return findOneBy(sc);
-    }
-
-    @Override
-    public NicIpAliasVO findByIp4AddressAndVmId(String ip4Address, long vmId) {
-        SearchCriteria<NicIpAliasVO> sc = AllFieldsSearch.create();
-        sc.setParameters("address", ip4Address);
-        sc.setParameters("instanceId", vmId);
-        return findOneBy(sc);
-    }
-    @Override
-    public NicIpAliasVO findByIp4AddressAndNicId(String ip4Address, long nicId) {
-        SearchCriteria<NicIpAliasVO> sc = AllFieldsSearch.create();
-        sc.setParameters("address", ip4Address);
-        sc.setParameters("nicId", nicId);
-        return findOneBy(sc);
-    }
-
-    @Override
-    public NicIpAliasVO findByIp4AddressAndNetworkIdAndInstanceId(
-            long networkId, Long vmId, String vmIp) {
-        SearchCriteria<NicIpAliasVO> sc = AllFieldsSearch.create();
-        sc.setParameters("network", networkId);
-        sc.setParameters("instanceId", vmId);
-        sc.setParameters("address", vmIp);
-        return findOneBy(sc);
-    }
-
-    @Override
-    public Integer countAliasIps(long id) {
-        SearchCriteria<NicIpAliasVO> sc = AllFieldsSearch.create();
-        sc.setParameters("instanceId",id);
-        List<NicIpAliasVO> list = listBy(sc);
-        return list.size();
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/src/com/cloud/vm/dao/NicIpAliasVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/dao/NicIpAliasVO.java b/server/src/com/cloud/vm/dao/NicIpAliasVO.java
deleted file mode 100644
index 4ed89d8..0000000
--- a/server/src/com/cloud/vm/dao/NicIpAliasVO.java
+++ /dev/null
@@ -1,226 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.vm.dao;
-
-import com.cloud.utils.db.GenericDao;
-import com.cloud.utils.net.NetUtils;
-import com.cloud.vm.NicIpAlias;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import java.util.Date;
-import java.util.UUID;
-
-@Entity
-@Table(name = "nic_ip_alias")
-public class NicIpAliasVO implements NicIpAlias  {
-
-    public NicIpAliasVO(Long nicId, String ipaddr, Long vmId,
-                        Long accountId, Long domainId, Long networkId, String gateway, String netmask) {
-        this.nicId = nicId;
-        this.vmId = vmId;
-        this.ip4Address = ipaddr;
-        this.accountId = accountId;
-        this.domainId = domainId;
-        this.networkId = networkId;
-        this.netmask =netmask;
-        this.gateway = gateway;
-        this.state = NicIpAlias.state.active;
-        String cidr = NetUtils.getCidrFromGatewayAndNetmask(gateway, netmask);
-        String[] cidrPair = cidr.split("\\/");
-        String cidrAddress = cidrPair[0];
-        long cidrSize = Long.parseLong(cidrPair[1]);
-        this.startIpOfSubnet = NetUtils.getIpRangeStartIpFromCidr(cidrAddress, cidrSize);
-    }
-
-    protected NicIpAliasVO() {
-    }
-
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Column(name = "id")
-    long id;
-
-    @Column(name = "nic_Id")
-    long nicId;
-
-    @Column(name="domain_id", updatable=false)
-    long domainId;
-
-    @Column(name="account_id", updatable=false)
-    private Long accountId;
-
-    @Column(name = "ip4_address")
-    String ip4Address;
-
-    @Column(name = "ip6_address")
-    String ip6Address;
-
-    @Column(name = "netmask")
-    String netmask;
-
-    @Column(name = "network_id")
-    long networkId;
-
-    @Column(name = GenericDao.CREATED_COLUMN)
-    Date created;
-
-    @Column(name = "uuid")
-    String uuid = UUID.randomUUID().toString();
-
-    @Column(name = "vmId")
-    Long vmId;
-
-    @Column(name = "alias_count")
-    Long aliasCount;
-
-    @Column(name = "gateway")
-    String gateway;
-
-    @Column(name= "state")
-    @Enumerated(value=EnumType.STRING)
-    NicIpAlias.state state;
-
-    @Column(name = "start_ip_of_subnet")
-    String startIpOfSubnet;
-
-
-
-
-    public long getId() {
-        return id;
-    }
-
-    public void setId(long id) {
-        this.id = id;
-    }
-
-    public long getNicId() {
-        return nicId;
-    }
-
-    public void setNicId(long nicId) {
-        this.nicId = nicId;
-    }
-
-    public long getDomainId() {
-        return domainId;
-    }
-
-    public void setDomainId(Long domainId) {
-        this.domainId = domainId;
-    }
-
-    public long getAccountId() {
-        return accountId;
-    }
-
-    public void setAccountId(Long accountId) {
-        this.accountId = accountId;
-    }
-
-    public String getIp4Address() {
-        return ip4Address;
-    }
-
-    public void setIp4Address(String ip4Address) {
-        this.ip4Address = ip4Address;
-    }
-
-    public String getIp6Address() {
-        return ip6Address;
-    }
-
-    public void setIp6Address(String ip6Address) {
-        this.ip6Address = ip6Address;
-    }
-
-    public long getNetworkId() {
-        return networkId;
-    }
-
-    public void setNetworkId(long networkId) {
-        this.networkId = networkId;
-    }
-
-    public Date getCreated() {
-        return created;
-    }
-
-    public void setCreated(Date created) {
-        this.created = created;
-    }
-
-    public String getUuid() {
-        return uuid;
-    }
-
-    public void setUuid(String uuid) {
-        this.uuid = uuid;
-    }
-
-    public long getVmId() {
-        return vmId;
-    }
-
-    public void setVmId(Long vmId) {
-        this.vmId = vmId;
-    }
-
-    public Long getAliasCount() {
-        return aliasCount;
-    }
-
-    public void setAliasCount(long count) {
-        this.aliasCount = count;
-    }
-
-    public void setNetmask(String netmask){
-        this.netmask = netmask;
-    }
-
-    public  String getNetmask() {
-        return netmask;
-    }
-
-    public  String getGateway() {
-        return  gateway;
-    }
-
-    public void setGateway(String gateway) {
-          this.gateway = gateway;
-    }
-
-    public NicIpAlias.state getState() {
-        return state;
-    }
-
-    public void setState(NicIpAlias.state state) {
-        this.state = state;
-    }
-
-    public String getStartIpOfSubnet() {
-        return startIpOfSubnet;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerManagerImpl.java b/server/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerManagerImpl.java
index 885ac87..2385edc 100644
--- a/server/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerManagerImpl.java
+++ b/server/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerManagerImpl.java
@@ -54,6 +54,7 @@ import com.cloud.network.lb.LoadBalancingRule.LbDestination;
 import com.cloud.network.lb.LoadBalancingRule.LbHealthCheckPolicy;
 import com.cloud.network.lb.LoadBalancingRule.LbStickinessPolicy;
 import com.cloud.network.lb.LoadBalancingRulesManager;
+import com.cloud.network.lb.LoadBalancingRulesService;
 import com.cloud.network.rules.FirewallRule.State;
 import com.cloud.network.rules.LoadBalancerContainer.Scheme;
 import com.cloud.projects.Project.ListProjectResourcesCriteria;
@@ -89,6 +90,8 @@ public class ApplicationLoadBalancerManagerImpl extends ManagerBase implements A
     @Inject NetworkOrchestrationService _ntwkMgr;
     @Inject
     IpAddressManager _ipAddrMgr;
+    @Inject
+    LoadBalancingRulesService _lbService;
     
     
     @Override
@@ -362,7 +365,7 @@ public class ApplicationLoadBalancerManagerImpl extends ManagerBase implements A
     
     @Override
     public boolean deleteApplicationLoadBalancer(long id) {
-        return _lbMgr.deleteLoadBalancerRule(id, true);
+        return _lbService.deleteLoadBalancerRule(id, true);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/test/com/cloud/network/NetworkManagerTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/network/NetworkManagerTest.java b/server/test/com/cloud/network/NetworkManagerTest.java
deleted file mode 100644
index b60079e..0000000
--- a/server/test/com/cloud/network/NetworkManagerTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-
-package com.cloud.network;
-
-
-import javax.inject.Inject;
-
-import junit.framework.Assert;
-
-import org.apache.log4j.Logger;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
-
-import com.cloud.network.element.DhcpServiceProvider;
-import com.cloud.network.element.IpDeployer;
-import com.cloud.utils.component.AdapterBase;
-
-
-@Ignore("Requires database to be set up")
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations="classpath:/testContext.xml")
-//@ComponentSetup(managerName="management-server", setupXml="network-mgr-component.xml")
-public class NetworkManagerTest {
-    private static final Logger s_logger = Logger.getLogger(NetworkManagerTest.class);
-    @Inject NetworkOrchestrationService _networkMgr;
-
-    @Test
-    public void testInjected() {
-        NetworkManagerImpl networkMgr = (NetworkManagerImpl)_networkMgr;
-        Assert.assertTrue(networkMgr._ipDeployers.iterator().hasNext());
-        Assert.assertTrue(networkMgr._networkElements.iterator().hasNext());
-        Assert.assertTrue(networkMgr._dhcpProviders.iterator().hasNext());
-        Assert.assertNotNull(networkMgr._networkModel);
-
-        Assert.assertNotNull(AdapterBase.getAdapterByName(networkMgr._ipDeployers, "VirtualRouter"));
-        Assert.assertNotNull(AdapterBase.getAdapterByName(networkMgr._ipDeployers, "VpcVirtualRouter"));
-
-        Assert.assertNotNull(AdapterBase.getAdapterByName(networkMgr._dhcpProviders, "VirtualRouter"));
-        Assert.assertNotNull(AdapterBase.getAdapterByName(networkMgr._dhcpProviders, "VpcVirtualRouter"));
-
-
-        Assert.assertTrue(AdapterBase.getAdapterByName(networkMgr._ipDeployers, "VirtualRouter") instanceof IpDeployer);
-        Assert.assertTrue(AdapterBase.getAdapterByName(networkMgr._dhcpProviders, "VirtualRouter") instanceof DhcpServiceProvider);
-
-        s_logger.info("Done testing injection of network manager's network elements");
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2e5bb63f/server/test/com/cloud/resource/MockResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/resource/MockResourceManagerImpl.java b/server/test/com/cloud/resource/MockResourceManagerImpl.java
index 651badc..3f6fb19 100644
--- a/server/test/com/cloud/resource/MockResourceManagerImpl.java
+++ b/server/test/com/cloud/resource/MockResourceManagerImpl.java
@@ -19,7 +19,6 @@ package com.cloud.resource;
 
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 import javax.ejb.Local;
 import javax.naming.ConfigurationException;
@@ -36,10 +35,8 @@ import org.apache.cloudstack.api.command.admin.host.UpdateHostPasswordCmd;
 
 import com.cloud.agent.api.StartupCommand;
 import com.cloud.agent.api.StartupRoutingCommand;
-import com.cloud.dc.DataCenter;
 import com.cloud.dc.DataCenterVO;
 import com.cloud.dc.HostPodVO;
-import com.cloud.dc.Pod;
 import com.cloud.dc.PodCluster;
 import com.cloud.exception.AgentUnavailableException;
 import com.cloud.exception.DiscoveryException;
@@ -51,11 +48,8 @@ import com.cloud.host.HostStats;
 import com.cloud.host.HostVO;
 import com.cloud.host.Status;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.offering.ServiceOffering;
 import com.cloud.org.Cluster;
 import com.cloud.resource.ResourceState.Event;
-import com.cloud.template.VirtualMachineTemplate;
-import com.cloud.utils.Pair;
 import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.fsm.NoTransitionException;
 
@@ -431,16 +425,6 @@ public class MockResourceManagerImpl extends ManagerBase implements ResourceMana
     }
 
     /* (non-Javadoc)
-     * @see com.cloud.resource.ResourceManager#findPod(com.cloud.template.VirtualMachineTemplate, com.cloud.service.ServiceOfferingVO, com.cloud.dc.DataCenterVO, long, java.util.Set)
-     */
-    @Override
-    public Pair<Pod, Long> findPod(VirtualMachineTemplate template, ServiceOffering offering, DataCenter dc,
-            long accountId, Set<Long> avoids) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    /* (non-Javadoc)
      * @see com.cloud.resource.ResourceManager#getHostStatistics(long)
      */
     @Override


Mime
View raw message