cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [7/7] git commit: updated refs/heads/vmsync to 2fa3612
Date Tue, 14 May 2013 20:05:09 GMT
Moved VOs into the schema


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

Branch: refs/heads/vmsync
Commit: 2fa361209eeeebfd9b6cb2610a5bf41b5ad890c1
Parents: 3dd26e8
Author: Alex Huang <alex.huang@gmail.com>
Authored: Tue May 14 13:06:48 2013 -0700
Committer: Alex Huang <alex.huang@gmail.com>
Committed: Tue May 14 13:06:48 2013 -0700

----------------------------------------------------------------------
 .../entity/api/DataCenterResourceEntity.java       |   13 +-
 .../engine/cloud/entity/api/VMEntityManager.java   |    2 +-
 .../cloud/entity/api/VMEntityManagerImpl.java      |    8 +-
 .../cloud/entity/api/VirtualMachineEntityImpl.java |    3 +-
 .../engine/cloud/entity/api/db/VMComputeTagVO.java |   67 --
 .../engine/cloud/entity/api/db/VMEntityVO.java     |  577 ----------
 .../engine/cloud/entity/api/db/VMNetworkMapVO.java |   71 --
 .../cloud/entity/api/db/VMReservationVO.java       |  127 ---
 .../cloud/entity/api/db/VMRootDiskTagVO.java       |   67 --
 .../cloud/entity/api/db/VolumeReservationVO.java   |  100 --
 .../cloud/entity/api/db/dao/VMComputeTagDao.java   |   31 -
 .../entity/api/db/dao/VMComputeTagDaoImpl.java     |   89 --
 .../cloud/entity/api/db/dao/VMEntityDao.java       |   41 -
 .../cloud/entity/api/db/dao/VMEntityDaoImpl.java   |  169 ---
 .../cloud/entity/api/db/dao/VMNetworkMapDao.java   |   31 -
 .../entity/api/db/dao/VMNetworkMapDaoImpl.java     |   85 --
 .../cloud/entity/api/db/dao/VMReservationDao.java  |   34 -
 .../entity/api/db/dao/VMReservationDaoImpl.java    |  111 --
 .../cloud/entity/api/db/dao/VMRootDiskTagDao.java  |   31 -
 .../entity/api/db/dao/VMRootDiskTagDaoImpl.java    |   88 --
 .../entity/api/db/dao/VolumeReservationDao.java    |   31 -
 .../api/db/dao/VolumeReservationDaoImpl.java       |   68 --
 .../datacenter/entity/ClusterEntityImpl.java       |  210 ++++
 .../entity/DataCenterResourceManager.java          |   51 +
 .../entity/DataCenterResourceManagerImpl.java      |  126 +++
 .../engine/datacenter/entity/HostEntityImpl.java   |  216 ++++
 .../engine/datacenter/entity/PodEntityImpl.java    |  212 ++++
 .../engine/datacenter/entity/ZoneEntityImpl.java   |  205 ++++
 .../datacenter/entity/api/ClusterEntityImpl.java   |  209 ----
 .../entity/api/DataCenterResourceManager.java      |   50 -
 .../entity/api/DataCenterResourceManagerImpl.java  |  129 ---
 .../datacenter/entity/api/HostEntityImpl.java      |  215 ----
 .../datacenter/entity/api/PodEntityImpl.java       |  211 ----
 .../datacenter/entity/api/ZoneEntityImpl.java      |  201 ----
 .../datacenter/entity/api/db/ClusterDetailsVO.java |   68 --
 .../datacenter/entity/api/db/DcDetailVO.java       |   67 --
 .../datacenter/entity/api/db/EngineCluster.java    |   23 -
 .../datacenter/entity/api/db/EngineClusterVO.java  |  243 -----
 .../datacenter/entity/api/db/EngineDataCenter.java |   23 -
 .../entity/api/db/EngineDataCenterVO.java          |  504 ---------
 .../datacenter/entity/api/db/EngineHost.java       |   24 -
 .../datacenter/entity/api/db/EngineHostPodVO.java  |  245 -----
 .../datacenter/entity/api/db/EngineHostVO.java     |  778 --------------
 .../engine/datacenter/entity/api/db/EnginePod.java |   23 -
 .../datacenter/entity/api/db/dao/DcDetailsDao.java |   29 -
 .../entity/api/db/dao/DcDetailsDaoImpl.java        |   94 --
 .../entity/api/db/dao/EngineClusterDao.java        |   37 -
 .../entity/api/db/dao/EngineClusterDaoImpl.java    |  288 -----
 .../entity/api/db/dao/EngineDataCenterDao.java     |   54 -
 .../entity/api/db/dao/EngineDataCenterDaoImpl.java |  327 ------
 .../entity/api/db/dao/EngineHostDao.java           |   85 --
 .../entity/api/db/dao/EngineHostDaoImpl.java       |  809 ---------------
 .../entity/api/db/dao/EngineHostPodDao.java        |   33 -
 .../entity/api/db/dao/EngineHostPodDaoImpl.java    |  184 ----
 .../entity/api/db/dao/HostDetailsDao.java          |   32 -
 .../entity/api/db/dao/HostDetailsDaoImpl.java      |  110 --
 .../datacenter/entity/api/db/dao/HostTagsDao.java  |   30 -
 .../entity/api/db/dao/HostTagsDaoImpl.java         |   75 --
 .../service/api/ProvisioningServiceImpl.java       |   10 +-
 .../provisioning/test/ChildTestConfiguration.java  |    9 +-
 .../engine/provisioning/test/ProvisioningTest.java |   16 +-
 .../engine/cloud/entity/VMComputeTagVO.java        |   67 ++
 .../cloudstack/engine/cloud/entity/VMEntityVO.java |  577 ++++++++++
 .../engine/cloud/entity/VMNetworkMapVO.java        |   71 ++
 .../engine/cloud/entity/VMReservationVO.java       |  127 +++
 .../engine/cloud/entity/VMRootDiskTagVO.java       |   67 ++
 .../engine/cloud/entity/VolumeReservationVO.java   |  100 ++
 .../engine/cloud/entity/dao/VMComputeTagDao.java   |   31 +
 .../cloud/entity/dao/VMComputeTagDaoImpl.java      |   89 ++
 .../engine/cloud/entity/dao/VMEntityDao.java       |   41 +
 .../engine/cloud/entity/dao/VMEntityDaoImpl.java   |  170 +++
 .../engine/cloud/entity/dao/VMNetworkMapDao.java   |   31 +
 .../cloud/entity/dao/VMNetworkMapDaoImpl.java      |   87 ++
 .../engine/cloud/entity/dao/VMReservationDao.java  |   34 +
 .../cloud/entity/dao/VMReservationDaoImpl.java     |  112 ++
 .../engine/cloud/entity/dao/VMRootDiskTagDao.java  |   31 +
 .../cloud/entity/dao/VMRootDiskTagDaoImpl.java     |   88 ++
 .../cloud/entity/dao/VolumeReservationDao.java     |   31 +
 .../cloud/entity/dao/VolumeReservationDaoImpl.java |   69 ++
 .../engine/datacenter/entity/ClusterDetailsVO.java |   68 ++
 .../engine/datacenter/entity/DcDetailVO.java       |   67 ++
 .../engine/datacenter/entity/EngineCluster.java    |   23 +
 .../engine/datacenter/entity/EngineClusterVO.java  |  243 +++++
 .../engine/datacenter/entity/EngineDataCenter.java |   23 +
 .../datacenter/entity/EngineDataCenterVO.java      |  504 +++++++++
 .../engine/datacenter/entity/EngineHost.java       |   24 +
 .../engine/datacenter/entity/EngineHostPodVO.java  |  245 +++++
 .../engine/datacenter/entity/EngineHostVO.java     |  778 ++++++++++++++
 .../engine/datacenter/entity/EnginePod.java        |   23 +
 .../engine/datacenter/entity/dao/DcDetailsDao.java |   29 +
 .../datacenter/entity/dao/DcDetailsDaoImpl.java    |   95 ++
 .../datacenter/entity/dao/EngineClusterDao.java    |   37 +
 .../entity/dao/EngineClusterDaoImpl.java           |  288 +++++
 .../datacenter/entity/dao/EngineDataCenterDao.java |   54 +
 .../entity/dao/EngineDataCenterDaoImpl.java        |  327 ++++++
 .../datacenter/entity/dao/EngineHostDao.java       |   85 ++
 .../datacenter/entity/dao/EngineHostDaoImpl.java   |  809 +++++++++++++++
 .../datacenter/entity/dao/EngineHostPodDao.java    |   33 +
 .../entity/dao/EngineHostPodDaoImpl.java           |  184 ++++
 .../datacenter/entity/dao/HostDetailsDao.java      |   32 +
 .../datacenter/entity/dao/HostDetailsDaoImpl.java  |  110 ++
 .../engine/datacenter/entity/dao/HostTagsDao.java  |   30 +
 .../datacenter/entity/dao/HostTagsDaoImpl.java     |   75 ++
 103 files changed, 7061 insertions(+), 7047 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/api/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceEntity.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceEntity.java b/engine/api/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceEntity.java
index 0817553..5ad4d0f 100755
--- a/engine/api/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceEntity.java
+++ b/engine/api/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceEntity.java
@@ -19,8 +19,6 @@
 package org.apache.cloudstack.engine.datacenter.entity.api;
 
 import javax.ws.rs.GET;
-
-
 import javax.ws.rs.POST;
 import javax.ws.rs.Produces;
 
@@ -30,14 +28,14 @@ import com.cloud.utils.fsm.StateMachine2;
 import com.cloud.utils.fsm.StateObject;
 
 /**
- * This interface specifies the states and operations all physical 
- * and virtual resources in the data center must implement. 
+ * This interface specifies the states and operations all physical
+ * and virtual resources in the data center must implement.
  */
 @Produces({"application/json", "application/xml"})
 public interface DataCenterResourceEntity extends CloudStackEntity, StateObject<DataCenterResourceEntity.State> {
 
     /**
-     * This is the state machine for how CloudStack should interact with 
+     * This is the state machine for how CloudStack should interact with
      *
      */
     public enum State {
@@ -66,12 +64,15 @@ public interface DataCenterResourceEntity extends CloudStackEntity, StateObject<
             s_fsm.addTransition(Deactivated, Event.ActivatedRequest, Enabled);
         }
 
+        public static StateMachine2<State, Event, DataCenterResourceEntity> getStateMachine() {
+            return s_fsm;
+        }
     }
 
     /**
      * Prepare the resource to take new on new demands.
      */
-    @POST 
+    @POST
     boolean enable();
 
     /**

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManager.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManager.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManager.java
index ca0a777..92d4401 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManager.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManager.java
@@ -16,7 +16,7 @@
 // under the License.
 package org.apache.cloudstack.engine.cloud.entity.api;
 
-import org.apache.cloudstack.engine.cloud.entity.api.db.VMEntityVO;
+import org.apache.cloudstack.engine.cloud.entity.VMEntityVO;
 
 import com.cloud.deploy.DeploymentPlan;
 import com.cloud.deploy.DeploymentPlanner.ExcludeList;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
index 25e7423..2292fac 100755
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
@@ -24,10 +24,10 @@ import java.util.UUID;
 
 import javax.inject.Inject;
 
-import org.apache.cloudstack.engine.cloud.entity.api.db.VMEntityVO;
-import org.apache.cloudstack.engine.cloud.entity.api.db.VMReservationVO;
-import org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMEntityDao;
-import org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMReservationDao;
+import org.apache.cloudstack.engine.cloud.entity.VMEntityVO;
+import org.apache.cloudstack.engine.cloud.entity.VMReservationVO;
+import org.apache.cloudstack.engine.cloud.entity.dao.VMEntityDao;
+import org.apache.cloudstack.engine.cloud.entity.dao.VMReservationDao;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
 import org.springframework.stereotype.Component;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java
index dd57f9a..9dc0262 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java
@@ -23,7 +23,8 @@ import java.util.Map;
 
 import javax.inject.Inject;
 
-import org.apache.cloudstack.engine.cloud.entity.api.db.VMEntityVO;
+import org.apache.cloudstack.engine.cloud.entity.VMEntityVO;
+
 import org.springframework.stereotype.Component;
 
 import com.cloud.deploy.DeploymentPlan;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMComputeTagVO.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMComputeTagVO.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMComputeTagVO.java
deleted file mode 100644
index e4fc228..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMComputeTagVO.java
+++ /dev/null
@@ -1,67 +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 org.apache.cloudstack.engine.cloud.entity.api.db;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import org.apache.cloudstack.api.InternalIdentity;
-
-@Entity
-@Table(name = "vm_compute_tags")
-public class VMComputeTagVO implements InternalIdentity{
-
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Column(name = "id")
-    private long id;
-
-    @Column(name = "vm_id")
-    private long vmId;
-
-    @Column(name = "compute_tag")
-    private String computeTag;
-
-    /**
-     * There should never be a public constructor for this class. Since it's
-     * only here to define the table for the DAO class.
-     */
-    protected VMComputeTagVO() {
-    }
-
-    public VMComputeTagVO(long vmId, String tag) {
-        this.vmId = vmId;
-        this.computeTag = tag;
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public long getVmId() {
-        return vmId;
-    }
-
-    public String getComputeTag() {
-        return computeTag;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java
deleted file mode 100644
index 4748215..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java
+++ /dev/null
@@ -1,577 +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 org.apache.cloudstack.engine.cloud.entity.api.db;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.UUID;
-
-import javax.persistence.Column;
-import javax.persistence.DiscriminatorColumn;
-import javax.persistence.DiscriminatorType;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.Id;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
-import javax.persistence.TableGenerator;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.persistence.Transient;
-
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.utils.db.Encrypt;
-import com.cloud.utils.db.GenericDao;
-import com.cloud.utils.db.StateMachine;
-import com.cloud.utils.fsm.FiniteStateObject;
-import com.cloud.vm.VirtualMachine;
-import com.cloud.vm.VirtualMachine.State;
-
-@Entity
-@Table(name="vm_instance")
-@Inheritance(strategy=InheritanceType.JOINED)
-@DiscriminatorColumn(name="type", discriminatorType=DiscriminatorType.STRING, length=32)
-public class VMEntityVO implements VirtualMachine, FiniteStateObject<State, VirtualMachine.Event> {
-    @Id
-    @TableGenerator(name="vm_instance_sq", table="sequence", pkColumnName="name", valueColumnName="value", pkColumnValue="vm_instance_seq", allocationSize=1)
-    @Column(name="id", updatable=false, nullable = false)
-    protected long id;
-
-    @Column(name="name", updatable=false, nullable=false, length=255)
-    protected String hostName = null;
-
-    @Encrypt
-    @Column(name="vnc_password", updatable=true, nullable=false, length=255)
-    protected String vncPassword;
-
-    @Column(name="proxy_id", updatable=true, nullable=true)
-    protected Long proxyId;
-
-    @Temporal(TemporalType.TIMESTAMP)
-    @Column(name="proxy_assign_time", updatable=true, nullable=true)
-    protected Date proxyAssignTime;
-
-    /**
-     * Note that state is intentionally missing the setter.  Any updates to
-     * the state machine needs to go through the DAO object because someone
-     * else could be updating it as well.
-     */
-    @Enumerated(value=EnumType.STRING)
-    @StateMachine(state=State.class, event=Event.class)
-    @Column(name="state", updatable=true, nullable=false, length=32)
-    protected State state = null;
-
-    @Column(name="private_ip_address", updatable=true)
-    protected String privateIpAddress;
-
-    @Column(name="instance_name", updatable=true, nullable=false)
-    protected String instanceName;
-
-    @Column(name="vm_template_id", updatable=true, nullable=true, length=17)
-    protected Long templateId = new Long(-1);
-
-    @Column(name="guest_os_id", nullable=false, length=17)
-    protected long guestOSId;
-
-    @Column(name="host_id", updatable=true, nullable=true)
-    protected Long hostId;
-
-    @Column(name="last_host_id", updatable=true, nullable=true)
-    protected Long lastHostId;
-
-    @Column(name="pod_id", updatable=true, nullable=false)
-    protected Long podIdToDeployIn;
-
-    @Column(name="private_mac_address", updatable=true, nullable=true)
-    protected String privateMacAddress;
-
-    @Column(name="data_center_id", updatable=true, nullable=false)
-    protected long dataCenterIdToDeployIn;
-
-    @Column(name="vm_type", updatable=false, nullable=false, length=32)
-    @Enumerated(value=EnumType.STRING)
-    protected Type type;
-
-    @Column(name="ha_enabled", updatable=true, nullable=true)
-    protected boolean haEnabled;
-
-    @Column(name="limit_cpu_use", updatable=true, nullable=true)
-    private boolean limitCpuUse;
-
-    @Column(name="update_count", updatable = true, nullable=false)
-    protected long updated;	// This field should be updated everytime the state is updated.  There's no set method in the vo object because it is done with in the dao code.
-
-    @Column(name=GenericDao.CREATED_COLUMN)
-    protected Date created;
-
-    @Column(name=GenericDao.REMOVED_COLUMN)
-    protected Date removed;
-
-    @Column(name="update_time", updatable=true)
-    @Temporal(value=TemporalType.TIMESTAMP)
-    protected Date updateTime;
-
-    @Column(name="domain_id")
-    protected long domainId;
-
-    @Column(name="account_id")
-    protected long accountId;
-
-    @Column(name="service_offering_id")
-    protected long serviceOfferingId;
-
-    @Column(name="reservation_id")
-    protected String reservationId;
-
-    @Column(name="hypervisor_type")
-    @Enumerated(value=EnumType.STRING)
-    protected HypervisorType hypervisorType;
-
-    @Column(name="ram")
-    protected long ram;
-
-    @Column(name="cpu")
-    protected int cpu;
-
-    @Transient
-    Map<String, String> details;
-
-    @Column(name="uuid")
-    protected String uuid = UUID.randomUUID().toString();
-
-    //orchestration columns
-    @Column(name="owner")
-    private String owner = null;
-
-    @Column(name="speed")
-    private int speed;
-
-    @Transient
-    List<String> computeTags;
-
-    @Transient
-    List<String> rootDiskTags;
-
-    @Column(name="host_name")
-    private String hostname = null;
-
-    @Column(name="display_name")
-    private String displayname = null;
-
-    @Transient
-    List<String> networkIds;
-
-    @Column(name="disk_offering_id")
-    protected Long diskOfferingId;
-    
-    @Transient
-    private VMReservationVO vmReservation;
-    
-
-    public VMEntityVO(long id,
-            long serviceOfferingId,
-            String name,
-            String instanceName,
-            Type type,
-            Long vmTemplateId,
-            HypervisorType hypervisorType,
-            long guestOSId,
-            long domainId,
-            long accountId,
-            boolean haEnabled, Long diskOfferingId) {
-        this.id = id;
-        this.hostName = name != null ? name : this.uuid;
-        if (vmTemplateId != null) {
-            this.templateId = vmTemplateId;
-        }
-        this.instanceName = instanceName;
-        this.type = type;
-        this.guestOSId = guestOSId;
-        this.haEnabled = haEnabled;
-        this.vncPassword = Long.toHexString(new Random().nextLong());
-        this.state = State.Stopped;
-        this.accountId = accountId;
-        this.domainId = domainId;
-        this.serviceOfferingId = serviceOfferingId;
-        this.hypervisorType = hypervisorType;
-        this.limitCpuUse = false;
-        this.diskOfferingId = diskOfferingId;
-    }
-
-    public VMEntityVO(long id,
-            long serviceOfferingId,
-            String name,
-            String instanceName,
-            Type type,
-            Long vmTemplateId,
-            HypervisorType hypervisorType,
-            long guestOSId,
-            long domainId,
-            long accountId,
-            boolean haEnabled,
-            boolean limitResourceUse) {
-        this(id, serviceOfferingId, name, instanceName, type, vmTemplateId, hypervisorType, guestOSId, domainId, accountId, haEnabled, null);
-        this.limitCpuUse = limitResourceUse;
-    }
-
-
-
-    protected VMEntityVO() {
-    }
-
-    public Date getRemoved() {
-        return removed;
-    }
-
-    @Override
-    public long getDomainId() {
-        return domainId;
-    }
-
-    @Override
-    public long getAccountId() {
-        return accountId;
-    }
-
-    @Override
-    public Type getType() {
-        return type;
-    }
-
-    public long getUpdated() {
-        return updated;
-    }
-
-    @Override
-    public long getId() {
-        return id;
-    }
-
-    @Override
-    public String getUuid() {
-        return uuid;
-    }
-
-    public void setUuid(String uuid) {
-        this.uuid = uuid;
-    }
-
-    @Override
-    public HypervisorType getHypervisorType() {
-        return hypervisorType;
-    }
-
-    @Override
-    public Date getCreated() {
-        return created;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    @Override
-    public long getDataCenterId() {
-        return dataCenterIdToDeployIn;
-    }
-
-    @Override
-    public String getHostName() {
-        return hostName;
-    }
-
-    @Override
-    public String getInstanceName() {
-        return instanceName;
-    }
-
-    @Override
-    public State getState() {
-        return state;
-    }
-
-    // don't use this directly, use VM state machine instead, this method is added for migration tool only
-    @Override
-    public void setState(State state) {
-        this.state = state;
-    }
-
-    @Override
-    public String getPrivateIpAddress() {
-        return privateIpAddress;
-    }
-
-    public void setPrivateIpAddress(String address) {
-        privateIpAddress = address;
-    }
-
-    public void setVncPassword(String vncPassword) {
-        this.vncPassword = vncPassword;
-    }
-
-    @Override
-    public String getVncPassword() {
-        return vncPassword;
-    }
-
-    @Override
-    public long getServiceOfferingId() {
-        return serviceOfferingId;
-    }
-
-    public Long getProxyId() {
-        return proxyId;
-    }
-
-    public void setProxyId(Long proxyId) {
-        this.proxyId = proxyId;
-    }
-
-    public Date getProxyAssignTime() {
-        return this.proxyAssignTime;
-    }
-
-    public void setProxyAssignTime(Date time) {
-        this.proxyAssignTime = time;
-    }
-
-    @Override
-    public long getTemplateId() {
-        if (templateId == null) {
-            return -1;
-        } else {
-            return templateId;
-        }
-    }
-
-    public void setTemplateId(Long templateId) {
-        this.templateId = templateId;
-    }
-
-    @Override
-    public long getGuestOSId() {
-        return guestOSId;
-    }
-
-    public void setGuestOSId(long guestOSId) {
-        this.guestOSId = guestOSId;
-    }
-
-    public void incrUpdated() {
-        updated++;
-    }
-
-    public void decrUpdated() {
-        updated--;
-    }
-
-    @Override
-    public Long getHostId() {
-        return hostId;
-    }
-
-    @Override
-    public Long getLastHostId() {
-        return lastHostId;
-    }
-
-    public void setLastHostId(Long lastHostId) {
-        this.lastHostId = lastHostId;
-    }
-
-    public void setHostId(Long hostId) {
-        this.hostId = hostId;
-    }
-
-    @Override
-    public boolean isHaEnabled() {
-        return haEnabled;
-    }
-
-    @Override
-    public boolean limitCpuUse() {
-        return limitCpuUse;
-    }
-
-    public void setLimitCpuUse(boolean value) {
-        limitCpuUse = value;
-    }
-
-    @Override
-    public String getPrivateMacAddress() {
-        return privateMacAddress;
-    }
-
-    @Override
-    public Long getPodIdToDeployIn() {
-        return podIdToDeployIn;
-    }
-
-    public void setPodId(long podId) {
-        this.podIdToDeployIn = podId;
-    }
-
-    public void setPrivateMacAddress(String privateMacAddress) {
-        this.privateMacAddress = privateMacAddress;
-    }
-
-    public void setDataCenterId(long dataCenterId) {
-        this.dataCenterIdToDeployIn = dataCenterId;
-    }
-
-    public boolean isRemoved() {
-        return removed != null;
-    }
-
-    public void setHaEnabled(boolean value) {
-        haEnabled = value;
-    }
-
-    public void setReservationId(String reservationId) {
-        this.reservationId = reservationId;
-    }
-
-    public String getReservationId() {
-        return this.reservationId;
-    }
-
-    @Override
-    public Map<String, String> getDetails() {
-        return details;
-    }
-
-    public void setDetail(String name, String value) {
-        assert (details != null) : "Did you forget to load the details?";
-
-        details.put(name, value);
-    }
-
-    public void setDetails(Map<String, String> details) {
-        this.details = details;
-    }
-
-    transient String toString;
-    @Override
-    public String toString() {
-        if (toString == null) {
-            toString = new StringBuilder("VM[").append(type.toString()).append("|").append(hostName).append("]").toString();
-        }
-        return toString;
-    }
-
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + (int) (id ^ (id >>> 32));
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        VMEntityVO other = (VMEntityVO) obj;
-        if (id != other.id)
-            return false;
-        return true;
-    }
-
-
-    public void setServiceOfferingId(long serviceOfferingId) {
-        this.serviceOfferingId = serviceOfferingId;
-    }
-
-    public String getOwner() {
-        return owner;
-    }
-
-    public void setOwner(String owner) {
-        this.owner = owner;
-    }
-
-    public int getSpeed() {
-        return speed;
-    }
-
-    public void setSpeed(int speed) {
-        this.speed = speed;
-    }
-
-    public List<String> getComputeTags() {
-        return computeTags;
-    }
-
-    public void setComputeTags(List<String> computeTags) {
-        this.computeTags = computeTags;
-    }
-
-    public List<String> getRootDiskTags() {
-        return rootDiskTags;
-    }
-
-    public void setRootDiskTags(List<String> rootDiskTags) {
-        this.rootDiskTags = rootDiskTags;
-    }
-
-    public String getHostname() {
-        return hostname;
-    }
-
-    public void setHostname(String hostname) {
-        this.hostname = hostname;
-    }
-
-    public String getDisplayname() {
-        return displayname;
-    }
-
-    public void setDisplayname(String displayname) {
-        this.displayname = displayname;
-    }
-
-    public List<String> getNetworkIds() {
-        return networkIds;
-    }
-
-    public void setNetworkIds(List<String> networkIds) {
-        this.networkIds = networkIds;
-    }
-
-	@Override
-	public Long getDiskOfferingId() {
-		return diskOfferingId;
-	}
-
-    public VMReservationVO getVmReservation() {
-        return vmReservation;
-    }
-
-    public void setVmReservation(VMReservationVO vmReservation) {
-        this.vmReservation = vmReservation;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMNetworkMapVO.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMNetworkMapVO.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMNetworkMapVO.java
deleted file mode 100644
index f29b19f..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMNetworkMapVO.java
+++ /dev/null
@@ -1,71 +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 org.apache.cloudstack.engine.cloud.entity.api.db;
-
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import org.apache.cloudstack.api.InternalIdentity;
-
-
-@Entity
-@Table(name = "vm_network_map")
-public class VMNetworkMapVO implements InternalIdentity{
-
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Column(name = "id")
-    private long id;
-
-    @Column(name = "vm_id")
-    private long vmId;
-
-    @Column(name="network_id")
-    private long networkId;
-
-
-    /**
-     * There should never be a public constructor for this class. Since it's
-     * only here to define the table for the DAO class.
-     */
-    protected VMNetworkMapVO() {
-    }
-
-    public VMNetworkMapVO(long vmId, long networkId) {
-        this.vmId = vmId;
-        this.networkId = networkId;
-    }
-
-
-    public long getId() {
-        return id;
-    }
-
-    public long getVmId() {
-        return vmId;
-    }
-
-
-    public long getNetworkId() {
-        return networkId;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMReservationVO.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMReservationVO.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMReservationVO.java
deleted file mode 100644
index 5a69ec8..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMReservationVO.java
+++ /dev/null
@@ -1,127 +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 org.apache.cloudstack.engine.cloud.entity.api.db;
-
-import java.util.Date;
-import java.util.Map;
-import java.util.UUID;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-
-import org.apache.cloudstack.api.Identity;
-import org.apache.cloudstack.api.InternalIdentity;
-
-import com.cloud.utils.db.GenericDao;
-
-@Entity
-@Table(name = "vm_reservation")
-public class VMReservationVO implements Identity, InternalIdentity{
-
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Column(name = "id")
-    private long id;
-
-    @Column(name = "vm_id")
-    private long vmId;
-
-    @Column(name="uuid")
-    private String uuid;
-
-    @Column(name="data_center_id")
-    private long dataCenterId;
-
-    @Column(name="pod_id")
-    private long podId;
-
-    @Column(name="cluster_id")
-    private long clusterId;
-
-    @Column(name="host_id")
-    private long hostId;
-
-    @Column(name=GenericDao.CREATED_COLUMN)
-    private Date created;
-
-    @Column(name=GenericDao.REMOVED_COLUMN)
-    private Date removed;
-
-    // VolumeId -> poolId
-    @Transient
-    Map<Long,Long> volumeReservationMap;
-
-    /**
-     * There should never be a public constructor for this class. Since it's
-     * only here to define the table for the DAO class.
-     */
-    protected VMReservationVO() {
-    }
-
-    public VMReservationVO(long vmId, long dataCenterId, long podId, long clusterId, long hostId) {
-        this.vmId = vmId;
-        this.dataCenterId = dataCenterId;
-        this.podId = podId;
-        this.clusterId = clusterId;
-        this.hostId = hostId;
-        this.uuid = UUID.randomUUID().toString();
-    }
-
-
-    public long getId() {
-        return id;
-    }
-
-    public long getVmId() {
-        return vmId;
-    }
-
-    @Override
-    public String getUuid() {
-        return uuid;
-    }
-
-    public long getDataCenterId() {
-        return dataCenterId;
-    }
-
-    public Long getPodId() {
-        return podId;
-    }
-
-    public Long getClusterId() {
-        return clusterId;
-    }
-
-    public Long getHostId() {
-        return hostId;
-    }
-
-    public Map<Long,Long> getVolumeReservation(){
-        return volumeReservationMap;
-    }
-
-    public void setVolumeReservation(Map<Long,Long> volumeReservationMap){
-        this.volumeReservationMap = volumeReservationMap;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMRootDiskTagVO.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMRootDiskTagVO.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMRootDiskTagVO.java
deleted file mode 100644
index 3c09e93..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMRootDiskTagVO.java
+++ /dev/null
@@ -1,67 +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 org.apache.cloudstack.engine.cloud.entity.api.db;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-import org.apache.cloudstack.api.InternalIdentity;
-
-@Entity
-@Table(name = "vm_root_disk_tags")
-public class VMRootDiskTagVO implements InternalIdentity {
-
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Column(name = "id")
-    private long id;
-
-    @Column(name = "vm_id")
-    private long vmId;
-
-    @Column(name = "root_disk_tag")
-    private String rootDiskTag;
-
-    /**
-     * There should never be a public constructor for this class. Since it's
-     * only here to define the table for the DAO class.
-     */
-    protected VMRootDiskTagVO() {
-    }
-
-    public VMRootDiskTagVO(long vmId, String rootDiskTag) {
-        this.vmId = vmId;
-        this.rootDiskTag = rootDiskTag;
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public long getVmId() {
-        return vmId;
-    }
-
-    public String getRootDiskTag() {
-        return rootDiskTag;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VolumeReservationVO.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VolumeReservationVO.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VolumeReservationVO.java
deleted file mode 100644
index f064623..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/VolumeReservationVO.java
+++ /dev/null
@@ -1,100 +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 org.apache.cloudstack.engine.cloud.entity.api.db;
-
-import java.util.Date;
-import java.util.Map;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-
-import org.apache.cloudstack.api.Identity;
-import org.apache.cloudstack.api.InternalIdentity;
-
-import com.cloud.utils.db.GenericDao;
-
-@Entity
-@Table(name = "volume_reservation")
-public class VolumeReservationVO implements InternalIdentity{
-
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Column(name = "id")
-    private long id;
-
-    @Column(name = "vm_reservation_id")
-    private Long vmReservationId;
-
-    @Column(name = "vm_id")
-    private long vmId;
-
-    @Column(name="volume_id")
-    private long volumeId;
-
-    @Column(name="pool_id")
-    private long poolId;
-
-    // VolumeId -> poolId
-    @Transient
-    Map<String, String> volumeReservationMap;
-
-    /**
-     * There should never be a public constructor for this class. Since it's
-     * only here to define the table for the DAO class.
-     */
-    protected VolumeReservationVO() {
-    }
-
-    public VolumeReservationVO(long vmId, long volumeId, long poolId, Long vmReservationId) {
-        this.vmId = vmId;
-        this.volumeId = volumeId;
-        this.poolId = poolId;
-        this.vmReservationId = vmReservationId;
-    }
-
-
-    public long getId() {
-        return id;
-    }
-
-    public long getVmId() {
-        return vmId;
-    }
-
-    public Long geVmReservationId() {
-        return vmReservationId;
-    }
-
-    public long getVolumeId() {
-        return volumeId;
-    }
-
-    public Long getPoolId() {
-        return poolId;
-    }
-
-
-    public Map<String,String> getVolumeReservation(){
-        return volumeReservationMap;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMComputeTagDao.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMComputeTagDao.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMComputeTagDao.java
deleted file mode 100644
index d8178d4..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMComputeTagDao.java
+++ /dev/null
@@ -1,31 +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 org.apache.cloudstack.engine.cloud.entity.api.db.dao;
-
-import java.util.List;
-
-import org.apache.cloudstack.engine.cloud.entity.api.db.VMComputeTagVO;
-
-import com.cloud.utils.db.GenericDao;
-
-public interface VMComputeTagDao extends GenericDao<VMComputeTagVO, Long>{
-
-    void persist(long vmId, List<String> computeTags);
-
-    List<String> getComputeTags(long vmId);
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMComputeTagDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMComputeTagDaoImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMComputeTagDaoImpl.java
deleted file mode 100644
index 6f70b35..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMComputeTagDaoImpl.java
+++ /dev/null
@@ -1,89 +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 org.apache.cloudstack.engine.cloud.entity.api.db.dao;
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.PostConstruct;
-import javax.ejb.Local;
-
-
-import org.apache.cloudstack.engine.cloud.entity.api.db.VMComputeTagVO;
-
-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 = { VMComputeTagDao.class })
-public class VMComputeTagDaoImpl extends GenericDaoBase<VMComputeTagVO, Long> implements VMComputeTagDao {
-
-    protected SearchBuilder<VMComputeTagVO> VmIdSearch;
-
-    public VMComputeTagDaoImpl() {
-    }
-
-    @PostConstruct
-    public void init() {
-        VmIdSearch = createSearchBuilder();
-        VmIdSearch.and("vmId", VmIdSearch.entity().getVmId(), SearchCriteria.Op.EQ);
-        VmIdSearch.done();
-
-    }
-
-    @Override
-    public void persist(long vmId, List<String> computeTags) {
-        Transaction txn = Transaction.currentTxn();
-
-        txn.start();
-        SearchCriteria<VMComputeTagVO> sc = VmIdSearch.create();
-        sc.setParameters("vmId", vmId);
-        expunge(sc);
-
-        for (String tag : computeTags) {
-            if(tag != null){
-                tag = tag.trim();
-                if(tag.length() > 0) {
-                    VMComputeTagVO vo = new VMComputeTagVO(vmId, tag);
-                    persist(vo);
-                }
-            }
-        }
-        txn.commit();
-    }
-
-    @Override
-    public List<String> getComputeTags(long vmId) {
-
-        SearchCriteria<VMComputeTagVO> sc = VmIdSearch.create();
-        sc.setParameters("vmId", vmId);
-
-        List<VMComputeTagVO> results = search(sc, null);
-        List<String> computeTags = new ArrayList<String>(results.size());
-        for (VMComputeTagVO result : results) {
-            computeTags.add(result.getComputeTag());
-        }
-
-        return computeTags;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMEntityDao.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMEntityDao.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMEntityDao.java
deleted file mode 100644
index aa063dc..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMEntityDao.java
+++ /dev/null
@@ -1,41 +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 org.apache.cloudstack.engine.cloud.entity.api.db.dao;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.cloudstack.engine.cloud.entity.api.db.VMEntityVO;
-
-import com.cloud.utils.Pair;
-import com.cloud.utils.db.GenericDao;
-import com.cloud.utils.fsm.StateDao;
-import com.cloud.vm.VMInstanceVO;
-import com.cloud.vm.VirtualMachine;
-import com.cloud.vm.VirtualMachine.State;
-import com.cloud.vm.VirtualMachine.Type;
-
-
-/*
- * Data Access Object for vm_instance table
- */
-public interface VMEntityDao extends GenericDao<VMEntityVO, Long> {
-  
-    void loadVmReservation(VMEntityVO vm);
-    
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMEntityDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMEntityDaoImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMEntityDaoImpl.java
deleted file mode 100644
index 3082d21..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMEntityDaoImpl.java
+++ /dev/null
@@ -1,169 +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 org.apache.cloudstack.engine.cloud.entity.api.db.dao;
-
-
-import java.sql.PreparedStatement;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.PostConstruct;
-import javax.ejb.Local;
-import javax.inject.Inject;
-
-import org.apache.cloudstack.engine.cloud.entity.api.db.VMEntityVO;
-import org.apache.cloudstack.engine.cloud.entity.api.db.VMReservationVO;
-import org.apache.log4j.Logger;
-import org.springframework.stereotype.Component;
-
-
-import com.cloud.network.dao.NetworkDao;
-import com.cloud.network.dao.NetworkVO;
-import com.cloud.utils.Pair;
-import com.cloud.utils.db.DB;
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.Transaction;
-import com.cloud.vm.NicProfile;
-
-
-
-@Component
-@Local(value = { VMEntityDao.class })
-public class VMEntityDaoImpl extends GenericDaoBase<VMEntityVO, Long> implements VMEntityDao {
-
-    public static final Logger s_logger = Logger.getLogger(VMEntityDaoImpl.class);
-
-    
-    @Inject protected VMReservationDao _vmReservationDao;
-
-    @Inject protected VMComputeTagDao _vmComputeTagDao;
-    
-    @Inject protected VMRootDiskTagDao _vmRootDiskTagsDao;
-    
-    @Inject protected VMNetworkMapDao _vmNetworkMapDao;
-
-    
-    @Inject
-    protected NetworkDao _networkDao;
-    
-    public VMEntityDaoImpl() {
-    }
-    
-    @PostConstruct
-    protected void init() {
-
-    }
-
-    @Override
-    public void loadVmReservation(VMEntityVO vm) {
-        VMReservationVO vmReservation = _vmReservationDao.findByVmId(vm.getId());
-        vm.setVmReservation(vmReservation);
-    }
-
-    @Override
-    @DB
-    public VMEntityVO persist(VMEntityVO vm) {
-        Transaction txn = Transaction.currentTxn();
-        txn.start();
-
-        VMEntityVO dbVO = super.persist(vm);
-
-        saveVmNetworks(vm);
-        loadVmNetworks(dbVO);
-        saveVmReservation(vm);
-        loadVmReservation(dbVO);
-        saveComputeTags(vm.getId(), vm.getComputeTags());
-        loadComputeTags(dbVO);
-        saveRootDiskTags(vm.getId(), vm.getRootDiskTags());
-        loadRootDiskTags(dbVO);
-
-        txn.commit();
-
-        return dbVO;
-    }
-
-    private void loadVmNetworks(VMEntityVO dbVO) {
-        List<Long> networksIds = _vmNetworkMapDao.getNetworks(dbVO.getId());
-        
-        List<String> networks = new ArrayList<String>();
-        for(Long networkId : networksIds){
-            NetworkVO network = _networkDao.findById(networkId);
-            if(network != null){
-                networks.add(network.getUuid());
-            }
-        }
-        
-        dbVO.setNetworkIds(networks);
-        
-    }
-
-    private void saveVmNetworks(VMEntityVO vm) {
-        List<Long> networks = new ArrayList<Long>();
-        
-        List<String> networksIds = vm.getNetworkIds();
-        
-        if (networksIds == null || (networksIds != null && networksIds.isEmpty())) {
-            return;
-        }
-
-        
-        for(String uuid : networksIds){
-            NetworkVO network = _networkDao.findByUuid(uuid);
-            if(network != null){
-                networks.add(network.getId());
-            }
-        }
-        _vmNetworkMapDao.persist(vm.getId(), networks);
-        
-    }
-
-    private void loadRootDiskTags(VMEntityVO dbVO) {
-        List<String> rootDiskTags = _vmRootDiskTagsDao.getRootDiskTags(dbVO.getId());
-        dbVO.setRootDiskTags(rootDiskTags);
-        
-    }
-
-    private void loadComputeTags(VMEntityVO dbVO) {
-        List<String> computeTags = _vmComputeTagDao.getComputeTags(dbVO.getId());
-        dbVO.setComputeTags(computeTags);
-        
-    }
-
-    private void saveRootDiskTags(long vmId, List<String> rootDiskTags) {
-        if (rootDiskTags == null || (rootDiskTags != null && rootDiskTags.isEmpty())) {
-            return;
-        }
-        _vmRootDiskTagsDao.persist(vmId, rootDiskTags);
-        
-    }
-
-    private void saveComputeTags(long vmId, List<String> computeTags) {
-        if (computeTags == null || (computeTags != null && computeTags.isEmpty())) {
-            return;
-        }
-
-        _vmComputeTagDao.persist(vmId, computeTags);        
-    }
-
-    private void saveVmReservation(VMEntityVO vm) {
-        if(vm.getVmReservation() != null){
-            _vmReservationDao.persist(vm.getVmReservation());
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMNetworkMapDao.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMNetworkMapDao.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMNetworkMapDao.java
deleted file mode 100644
index 59c41c2..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMNetworkMapDao.java
+++ /dev/null
@@ -1,31 +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 org.apache.cloudstack.engine.cloud.entity.api.db.dao;
-
-import java.util.List;
-
-import org.apache.cloudstack.engine.cloud.entity.api.db.VMNetworkMapVO;
-
-import com.cloud.utils.db.GenericDao;
-
-public interface VMNetworkMapDao extends GenericDao<VMNetworkMapVO, Long>{
-
-    void persist(long vmId, List<Long> networks);
-
-    List<Long> getNetworks(long vmId);
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMNetworkMapDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMNetworkMapDaoImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMNetworkMapDaoImpl.java
deleted file mode 100644
index 0f2c4cc..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMNetworkMapDaoImpl.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 org.apache.cloudstack.engine.cloud.entity.api.db.dao;
-
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.annotation.PostConstruct;
-import javax.ejb.Local;
-import javax.inject.Inject;
-import org.apache.cloudstack.engine.cloud.entity.api.db.VMNetworkMapVO;
-import org.springframework.stereotype.Component;
-import com.cloud.network.dao.NetworkDao;
-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 = { VMNetworkMapDao.class })
-public class VMNetworkMapDaoImpl extends GenericDaoBase<VMNetworkMapVO, Long> implements VMNetworkMapDao {
-
-    protected SearchBuilder<VMNetworkMapVO> VmIdSearch;
-
-    @Inject
-    protected NetworkDao _networkDao;
-
-    public VMNetworkMapDaoImpl() {
-    }
-
-    @PostConstruct
-    public void init() {
-        VmIdSearch = createSearchBuilder();
-        VmIdSearch.and("vmId", VmIdSearch.entity().getVmId(), SearchCriteria.Op.EQ);
-        VmIdSearch.done();
-
-    }
-
-    @Override
-    public void persist(long vmId, List<Long> networks) {
-        Transaction txn = Transaction.currentTxn();
-
-        txn.start();
-        SearchCriteria<VMNetworkMapVO> sc = VmIdSearch.create();
-        sc.setParameters("vmId", vmId);
-        expunge(sc);
-
-        for (Long networkId : networks) {
-            VMNetworkMapVO vo = new VMNetworkMapVO(vmId, networkId);
-            persist(vo);
-        }
-
-        txn.commit();
-    }
-
-    @Override
-    public List<Long> getNetworks(long vmId) {
-
-        SearchCriteria<VMNetworkMapVO> sc = VmIdSearch.create();
-        sc.setParameters("vmId", vmId);
-
-        List<VMNetworkMapVO> results = search(sc, null);
-        List<Long> networks = new ArrayList<Long>(results.size());
-        for (VMNetworkMapVO result : results) {
-            networks.add(result.getNetworkId());
-        }
-
-        return networks;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMReservationDao.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMReservationDao.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMReservationDao.java
deleted file mode 100644
index 721a8c4..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMReservationDao.java
+++ /dev/null
@@ -1,34 +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 org.apache.cloudstack.engine.cloud.entity.api.db.dao;
-
-
-import java.util.Map;
-
-import org.apache.cloudstack.engine.cloud.entity.api.db.VMReservationVO;
-
-import com.cloud.utils.db.GenericDao;
-
-public interface VMReservationDao extends GenericDao<VMReservationVO, Long>{
-
-    VMReservationVO findByVmId(long vmId);
-
-    void loadVolumeReservation(VMReservationVO reservation);
-
-    VMReservationVO findByReservationId(String reservationId);
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMReservationDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMReservationDaoImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMReservationDaoImpl.java
deleted file mode 100644
index 73b4dd2..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMReservationDaoImpl.java
+++ /dev/null
@@ -1,111 +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 org.apache.cloudstack.engine.cloud.entity.api.db.dao;
-
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.annotation.PostConstruct;
-import javax.ejb.Local;
-import javax.inject.Inject;
-
-import org.apache.cloudstack.engine.cloud.entity.api.db.VMEntityVO;
-import org.apache.cloudstack.engine.cloud.entity.api.db.VMReservationVO;
-import org.apache.cloudstack.engine.cloud.entity.api.db.VolumeReservationVO;
-import org.springframework.stereotype.Component;
-
-import com.cloud.host.dao.HostTagsDaoImpl;
-import com.cloud.utils.db.DB;
-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 = { VMReservationDao.class })
-public class VMReservationDaoImpl extends GenericDaoBase<VMReservationVO, Long> implements VMReservationDao {
-
-    protected SearchBuilder<VMReservationVO> VmIdSearch;
-
-    @Inject protected VolumeReservationDao _volumeReservationDao;
-
-    public VMReservationDaoImpl() {
-    }
-
-    @PostConstruct
-    public void init() {
-        VmIdSearch = createSearchBuilder();
-        VmIdSearch.and("vmId", VmIdSearch.entity().getVmId(), SearchCriteria.Op.EQ);
-        VmIdSearch.done();
-    }
-
-    @Override
-    public VMReservationVO findByVmId(long vmId) {
-        SearchCriteria<VMReservationVO> sc = VmIdSearch.create("vmId", vmId);
-        VMReservationVO vmRes = findOneBy(sc);
-        loadVolumeReservation(vmRes);
-        return vmRes;
-    }
-
-
-    @Override
-    public void loadVolumeReservation(VMReservationVO reservation){
-        if(reservation != null){
-            List<VolumeReservationVO> volumeResList = _volumeReservationDao.listVolumeReservation(reservation.getId());
-            Map<Long, Long> volumeReservationMap = new HashMap<Long,Long>();
-
-            for(VolumeReservationVO res : volumeResList){
-                volumeReservationMap.put(res.getVolumeId(), res.getPoolId());
-            }
-            reservation.setVolumeReservation(volumeReservationMap);
-        }
-    }
-
-    @Override
-    @DB
-    public VMReservationVO persist(VMReservationVO reservation) {
-        Transaction txn = Transaction.currentTxn();
-        txn.start();
-
-        VMReservationVO dbVO = super.persist(reservation);
-
-        saveVolumeReservation(reservation);
-        loadVolumeReservation(dbVO);
-
-        txn.commit();
-
-        return dbVO;
-    }
-
-    private void saveVolumeReservation(VMReservationVO reservation) {
-        if(reservation.getVolumeReservation() != null){
-            for(Long volumeId : reservation.getVolumeReservation().keySet()){
-                VolumeReservationVO volumeReservation = new VolumeReservationVO(reservation.getVmId(), volumeId, reservation.getVolumeReservation().get(volumeId), reservation.getId());
-                _volumeReservationDao.persist(volumeReservation);
-            }
-        }
-    }
-
-    @Override
-    public VMReservationVO findByReservationId(String reservationId) {
-        VMReservationVO vmRes = super.findByUuid(reservationId);
-        loadVolumeReservation(vmRes);
-        return vmRes;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMRootDiskTagDao.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMRootDiskTagDao.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMRootDiskTagDao.java
deleted file mode 100644
index dc00880..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMRootDiskTagDao.java
+++ /dev/null
@@ -1,31 +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 org.apache.cloudstack.engine.cloud.entity.api.db.dao;
-
-import java.util.List;
-
-import org.apache.cloudstack.engine.cloud.entity.api.db.VMRootDiskTagVO;
-
-import com.cloud.utils.db.GenericDao;
-
-public interface VMRootDiskTagDao extends GenericDao<VMRootDiskTagVO, Long>{
-
-    void persist(long vmId, List<String> diskTags);
-
-    List<String> getRootDiskTags(long vmId);
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMRootDiskTagDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMRootDiskTagDaoImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMRootDiskTagDaoImpl.java
deleted file mode 100644
index be194bb..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMRootDiskTagDaoImpl.java
+++ /dev/null
@@ -1,88 +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 org.apache.cloudstack.engine.cloud.entity.api.db.dao;
-
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.PostConstruct;
-import javax.ejb.Local;
-
-
-import org.apache.cloudstack.engine.cloud.entity.api.db.VMRootDiskTagVO;
-
-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 = { VMRootDiskTagDao.class })
-public class VMRootDiskTagDaoImpl extends GenericDaoBase<VMRootDiskTagVO, Long> implements VMRootDiskTagDao {
-
-    protected SearchBuilder<VMRootDiskTagVO> VmIdSearch;
-
-    public VMRootDiskTagDaoImpl() {
-    }
-
-    @PostConstruct
-    public void init() {
-        VmIdSearch = createSearchBuilder();
-        VmIdSearch.and("vmId", VmIdSearch.entity().getVmId(), SearchCriteria.Op.EQ);
-        VmIdSearch.done();
-
-    }
-
-    @Override
-    public void persist(long vmId, List<String> rootDiskTags) {
-        Transaction txn = Transaction.currentTxn();
-
-        txn.start();
-        SearchCriteria<VMRootDiskTagVO> sc = VmIdSearch.create();
-        sc.setParameters("vmId", vmId);
-        expunge(sc);
-
-        for (String tag : rootDiskTags) {
-            if(tag != null){
-                tag = tag.trim();
-                if(tag.length() > 0) {
-                    VMRootDiskTagVO vo = new VMRootDiskTagVO(vmId, tag);
-                    persist(vo);
-                }
-            }
-        }
-        txn.commit();
-    }
-
-
-    @Override
-    public List<String> getRootDiskTags(long vmId) {
-        SearchCriteria<VMRootDiskTagVO> sc = VmIdSearch.create();
-        sc.setParameters("vmId", vmId);
-
-        List<VMRootDiskTagVO> results = search(sc, null);
-        List<String> computeTags = new ArrayList<String>(results.size());
-        for (VMRootDiskTagVO result : results) {
-            computeTags.add(result.getRootDiskTag());
-        }
-        return computeTags;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VolumeReservationDao.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VolumeReservationDao.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VolumeReservationDao.java
deleted file mode 100644
index fd709b0..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VolumeReservationDao.java
+++ /dev/null
@@ -1,31 +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 org.apache.cloudstack.engine.cloud.entity.api.db.dao;
-
-import java.util.List;
-
-import org.apache.cloudstack.engine.cloud.entity.api.db.VolumeReservationVO;
-
-import com.cloud.utils.db.GenericDao;
-
-public interface VolumeReservationDao extends GenericDao<VolumeReservationVO, Long>{
-
-   VolumeReservationVO findByVmId(long vmId);
-
-   List<VolumeReservationVO> listVolumeReservation(long vmReservationId);
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VolumeReservationDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VolumeReservationDaoImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VolumeReservationDaoImpl.java
deleted file mode 100644
index 26bc65f..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VolumeReservationDaoImpl.java
+++ /dev/null
@@ -1,68 +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 org.apache.cloudstack.engine.cloud.entity.api.db.dao;
-
-
-import java.util.List;
-
-import javax.annotation.PostConstruct;
-import javax.ejb.Local;
-import javax.inject.Inject;
-
-import org.apache.cloudstack.engine.cloud.entity.api.db.VMReservationVO;
-import org.apache.cloudstack.engine.cloud.entity.api.db.VolumeReservationVO;
-import org.springframework.stereotype.Component;
-
-import com.cloud.host.dao.HostTagsDaoImpl;
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-
-@Component
-@Local(value = { VolumeReservationDao.class })
-public class VolumeReservationDaoImpl extends GenericDaoBase<VolumeReservationVO, Long> implements VolumeReservationDao {
-
-    protected SearchBuilder<VolumeReservationVO> VmIdSearch;
-    protected SearchBuilder<VolumeReservationVO> VmReservationIdSearch;
-
-    public VolumeReservationDaoImpl() {
-    }
-
-    @PostConstruct
-    public void init() {
-        VmIdSearch = createSearchBuilder();
-        VmIdSearch.and("vmId", VmIdSearch.entity().getVmId(), SearchCriteria.Op.EQ);
-        VmIdSearch.done();
-
-        VmReservationIdSearch = createSearchBuilder();
-        VmReservationIdSearch.and("vmReservationId", VmReservationIdSearch.entity().geVmReservationId(), SearchCriteria.Op.EQ);
-        VmReservationIdSearch.done();
-    }
-
-    @Override
-    public VolumeReservationVO findByVmId(long vmId) {
-        SearchCriteria<VolumeReservationVO> sc = VmIdSearch.create("vmId", vmId);
-        return findOneBy(sc);
-    }
-
-    @Override
-    public List<VolumeReservationVO> listVolumeReservation(long vmReservationId) {
-        SearchCriteria<VolumeReservationVO> sc = VmReservationIdSearch.create("vmReservationId", vmReservationId);
-        return listBy(sc);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/ClusterEntityImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/ClusterEntityImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/ClusterEntityImpl.java
new file mode 100644
index 0000000..041fa12
--- /dev/null
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/ClusterEntityImpl.java
@@ -0,0 +1,210 @@
+// 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 org.apache.cloudstack.engine.datacenter.entity;
+
+import java.lang.reflect.Method;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.cloudstack.engine.datacenter.entity.EngineClusterVO;
+import org.apache.cloudstack.engine.datacenter.entity.api.ClusterEntity;
+import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.org.Cluster.ClusterType;
+import com.cloud.org.Grouping.AllocationState;
+import com.cloud.org.Managed.ManagedState;
+import com.cloud.utils.fsm.NoTransitionException;
+
+
+public class ClusterEntityImpl implements ClusterEntity {
+
+
+	private DataCenterResourceManager manager;
+
+	private EngineClusterVO clusterVO;
+
+
+	public ClusterEntityImpl(String clusterId, DataCenterResourceManager manager) {
+		this.manager = manager;
+	this.clusterVO = this.manager.loadCluster(clusterId);
+    }
+
+	@Override
+	public boolean enable() {
+		try {
+			manager.changeState(this, Event.EnableRequest);
+		} catch (NoTransitionException e) {
+			return false;
+		}
+	return true;
+	}
+
+	@Override
+	public boolean disable() {
+		try {
+			manager.changeState(this, Event.DisableRequest);
+		} catch (NoTransitionException e) {
+			return false;
+		}
+	return true;
+	}
+
+	@Override
+	public boolean deactivate() {
+		try {
+			manager.changeState(this, Event.DeactivateRequest);
+		} catch (NoTransitionException e) {
+			return false;
+		}
+	return true;
+	}
+
+
+	@Override
+	public boolean reactivate() {
+		try {
+			manager.changeState(this, Event.ActivatedRequest);
+		} catch (NoTransitionException e) {
+			return false;
+		}
+	return true;
+	}
+
+
+	@Override
+	public State getState() {
+		return clusterVO.getState();
+	}
+
+	@Override
+	public void persist() {
+		manager.saveCluster(clusterVO);
+	}
+
+	@Override
+	public String getUuid() {
+		return clusterVO.getUuid();
+	}
+
+	@Override
+	public long getId() {
+		return clusterVO.getId();
+	}
+
+	@Override
+	public String getCurrentState() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public String getDesiredState() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Date getCreatedTime() {
+		return clusterVO.getCreated();
+	}
+
+	@Override
+	public Date getLastUpdatedTime() {
+		return clusterVO.getLastUpdated();
+	}
+
+	@Override
+	public String getOwner() {
+		return clusterVO.getOwner();
+	}
+
+	@Override
+	public Map<String, String> getDetails() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void addDetail(String name, String value) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void delDetail(String name, String value) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void updateDetail(String name, String value) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public List<Method> getApplicableActions() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public String getName() {
+		return clusterVO.getName();
+	}
+
+	@Override
+	public long getDataCenterId() {
+		return clusterVO.getDataCenterId();
+	}
+
+	@Override
+	public long getPodId() {
+		return clusterVO.getPodId();
+	}
+
+	@Override
+	public HypervisorType getHypervisorType() {
+		return clusterVO.getHypervisorType();
+	}
+
+	@Override
+	public ClusterType getClusterType() {
+		return clusterVO.getClusterType();
+	}
+
+	@Override
+	public AllocationState getAllocationState() {
+		return clusterVO.getAllocationState();
+	}
+
+	@Override
+	public ManagedState getManagedState() {
+		return clusterVO.getManagedState();
+	}
+
+	public void setOwner(String owner) {
+		clusterVO.setOwner(owner);
+	}
+
+	public void setName(String name) {
+		clusterVO.setName(name);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/DataCenterResourceManager.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/DataCenterResourceManager.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/DataCenterResourceManager.java
new file mode 100644
index 0000000..65f3c93
--- /dev/null
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/DataCenterResourceManager.java
@@ -0,0 +1,51 @@
+// 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 org.apache.cloudstack.engine.datacenter.entity;
+
+
+import org.apache.cloudstack.engine.datacenter.entity.EngineClusterVO;
+import org.apache.cloudstack.engine.datacenter.entity.EngineDataCenterVO;
+import org.apache.cloudstack.engine.datacenter.entity.EngineHostPodVO;
+import org.apache.cloudstack.engine.datacenter.entity.EngineHostVO;
+import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity;
+import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
+
+import com.cloud.utils.fsm.NoTransitionException;
+
+
+
+public interface DataCenterResourceManager {
+
+	EngineDataCenterVO loadDataCenter(String dataCenterId);
+
+	void saveDataCenter(EngineDataCenterVO dc);
+
+	void savePod(EngineHostPodVO dc);
+
+	void saveCluster(EngineClusterVO cluster);
+
+	boolean changeState(DataCenterResourceEntity entity, Event event) throws NoTransitionException;
+
+	EngineHostPodVO loadPod(String uuid);
+
+	EngineClusterVO loadCluster(String uuid);
+
+	EngineHostVO loadHost(String uuid);
+
+	void saveHost(EngineHostVO hostVO);
+
+}


Mime
View raw message