cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [6/7] Moved VOs into the schema
Date Tue, 14 May 2013 20:05:08 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/DataCenterResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/DataCenterResourceManagerImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/DataCenterResourceManagerImpl.java
new file mode 100644
index 0000000..dfbaed5
--- /dev/null
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/DataCenterResourceManagerImpl.java
@@ -0,0 +1,126 @@
+// 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 javax.inject.Inject;
+
+import org.apache.cloudstack.engine.datacenter.entity.api.ClusterEntity;
+import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity;
+import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State;
+import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
+import org.apache.cloudstack.engine.datacenter.entity.api.HostEntity;
+import org.apache.cloudstack.engine.datacenter.entity.api.PodEntity;
+import org.apache.cloudstack.engine.datacenter.entity.api.ZoneEntity;
+import org.apache.cloudstack.engine.datacenter.entity.dao.EngineClusterDao;
+import org.apache.cloudstack.engine.datacenter.entity.dao.EngineDataCenterDao;
+import org.apache.cloudstack.engine.datacenter.entity.dao.EngineHostDao;
+import org.apache.cloudstack.engine.datacenter.entity.dao.EngineHostPodDao;
+
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.utils.fsm.NoTransitionException;
+import com.cloud.utils.fsm.StateMachine2;
+
+public class DataCenterResourceManagerImpl implements DataCenterResourceManager {
+
+	@Inject
+    EngineDataCenterDao _dataCenterDao;
+
+	@Inject
+	EngineHostPodDao _podDao;
+
+	@Inject
+	EngineClusterDao _clusterDao;
+
+	@Inject
+	EngineHostDao _hostDao;
+
+
+    protected StateMachine2<State, Event, DataCenterResourceEntity> _stateMachine = DataCenterResourceEntity.State.getStateMachine();
+
+	@Override
+	public EngineDataCenterVO loadDataCenter(String dataCenterId) {
+	EngineDataCenterVO dataCenterVO = _dataCenterDao.findByUuid(dataCenterId);
+	if(dataCenterVO == null){
+		throw new InvalidParameterValueException("Zone does not exist");
+	}
+	return dataCenterVO;
+	}
+
+	@Override
+	public void saveDataCenter(EngineDataCenterVO dc) {
+		_dataCenterDao.persist(dc);
+
+	}
+
+	@Override
+	public boolean changeState(DataCenterResourceEntity entity, Event event) throws NoTransitionException {
+
+		if(entity instanceof ZoneEntity){
+			return _stateMachine.transitTo(entity, event, null, _dataCenterDao);
+		}else if(entity instanceof PodEntity){
+			return _stateMachine.transitTo(entity, event, null, _podDao);
+		}else if(entity instanceof ClusterEntity){
+			return _stateMachine.transitTo(entity, event, null, _clusterDao);
+		}else if(entity instanceof HostEntity){
+			return _stateMachine.transitTo(entity, event, null, _hostDao);
+		}
+
+		return false;
+	}
+
+	@Override
+	public EngineHostPodVO loadPod(String uuid) {
+		EngineHostPodVO pod = _podDao.findByUuid(uuid);
+	if(pod == null){
+		throw new InvalidParameterValueException("Pod does not exist");
+	}
+		return pod;
+	}
+
+	@Override
+	public EngineClusterVO loadCluster(String uuid) {
+		EngineClusterVO cluster = _clusterDao.findByUuid(uuid);
+	if(cluster == null){
+		throw new InvalidParameterValueException("Pod does not exist");
+	}
+		return cluster;
+	}
+
+	@Override
+	public void savePod(EngineHostPodVO pod) {
+		_podDao.persist(pod);
+	}
+
+	@Override
+	public void saveCluster(EngineClusterVO cluster) {
+		_clusterDao.persist(cluster);
+	}
+
+	@Override
+	public EngineHostVO loadHost(String uuid) {
+		EngineHostVO host = _hostDao.findByUuid(uuid);
+	if(host == null){
+		throw new InvalidParameterValueException("Host does not exist");
+	}
+		return host;
+	}
+
+	@Override
+	public void saveHost(EngineHostVO hostVO) {
+		_hostDao.persist(hostVO);
+	}
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/HostEntityImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/HostEntityImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/HostEntityImpl.java
new file mode 100644
index 0000000..dd8dcd3
--- /dev/null
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/HostEntityImpl.java
@@ -0,0 +1,216 @@
+// 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.EngineHostVO;
+import org.apache.cloudstack.engine.datacenter.entity.api.HostEntity;
+import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
+
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.utils.fsm.NoTransitionException;
+
+public class HostEntityImpl implements HostEntity {
+
+	private DataCenterResourceManager manager;
+
+    private EngineHostVO hostVO;
+
+    public HostEntityImpl(String uuid, DataCenterResourceManager manager) {
+	this.manager = manager;
+	hostVO = manager.loadHost(uuid);
+    }
+
+	@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 hostVO.getOrchestrationState();
+	}
+
+	@Override
+	public void persist() {
+		manager.saveHost(hostVO);
+	}
+
+	@Override
+	public String getName() {
+		return hostVO.getName();
+	}
+
+	@Override
+	public String getUuid() {
+		return hostVO.getUuid();
+	}
+
+	@Override
+	public long getId() {
+		return hostVO.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 hostVO.getCreated();
+	}
+
+	@Override
+	public Date getLastUpdatedTime() {
+		return hostVO.getLastUpdated();
+	}
+
+	@Override
+	public String getOwner() {
+		// TODO Auto-generated method stub
+		return hostVO.getOwner();
+	}
+
+
+    public void setDetails(Map<String,String> details) {
+	hostVO.setDetails(details);
+    }
+
+	@Override
+	public Map<String, String> getDetails() {
+		return hostVO.getDetails();
+	}
+
+	@Override
+	public void addDetail(String name, String value) {
+		hostVO.setDetail(name, value);
+	}
+
+	@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 Long getTotalMemory() {
+		return hostVO.getTotalMemory();
+	}
+
+	@Override
+	public Integer getCpus() {
+		return hostVO.getCpus();
+	}
+
+	@Override
+	public Long getSpeed() {
+		return hostVO.getSpeed();
+	}
+
+	@Override
+	public Long getPodId() {
+		return hostVO.getPodId();
+	}
+
+	@Override
+	public long getDataCenterId() {
+		return hostVO.getDataCenterId();
+	}
+
+	@Override
+	public HypervisorType getHypervisorType() {
+		return hostVO.getHypervisorType();
+	}
+
+	@Override
+	public String getGuid() {
+		return hostVO.getGuid();
+	}
+
+	@Override
+	public Long getClusterId() {
+		return hostVO.getClusterId();
+	}
+
+	public void setOwner(String owner) {
+		hostVO.setOwner(owner);
+	}
+
+	public void setName(String name) {
+		hostVO.setName(name);
+	}
+
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/PodEntityImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/PodEntityImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/PodEntityImpl.java
new file mode 100755
index 0000000..696c3e0
--- /dev/null
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/PodEntityImpl.java
@@ -0,0 +1,212 @@
+/*
+ * 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.EngineHostPodVO;
+import org.apache.cloudstack.engine.datacenter.entity.api.PodEntity;
+import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
+
+import com.cloud.org.Cluster;
+import com.cloud.org.Grouping.AllocationState;
+import com.cloud.utils.fsm.NoTransitionException;
+
+public class PodEntityImpl implements PodEntity {
+
+
+	private DataCenterResourceManager manager;
+
+    private EngineHostPodVO podVO;
+
+    public PodEntityImpl(String uuid, DataCenterResourceManager manager) {
+	this.manager = manager;
+	podVO = manager.loadPod(uuid);
+    }
+
+    @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 podVO.getState();
+    }
+
+    @Override
+    public String getUuid() {
+        return podVO.getUuid();
+    }
+
+    @Override
+    public long getId() {
+        return podVO.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 podVO.getCreated();
+    }
+
+    @Override
+    public Date getLastUpdatedTime() {
+        return podVO.getLastUpdated();
+    }
+
+    @Override
+    public String getOwner() {
+        return podVO.getOwner();
+    }
+
+
+    @Override
+    public List<Method> getApplicableActions() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public String getCidrAddress() {
+        return podVO.getCidrAddress();
+    }
+
+    @Override
+    public int getCidrSize() {
+        return podVO.getCidrSize();
+    }
+
+    @Override
+    public String getGateway() {
+        return podVO.getGateway();
+    }
+
+    @Override
+    public long getDataCenterId() {
+        return podVO.getDataCenterId();
+    }
+
+    @Override
+    public String getName() {
+        return podVO.getName();
+    }
+
+    @Override
+    public AllocationState getAllocationState() {
+        return podVO.getAllocationState();
+    }
+
+    @Override
+    public boolean getExternalDhcp() {
+        return podVO.getExternalDhcp();
+    }
+
+    @Override
+    public List<Cluster> listClusters() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+	@Override
+	public void persist() {
+		manager.savePod(podVO);
+
+	}
+
+	@Override
+	public Map<String, String> getDetails() {
+		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) {
+
+	}
+
+	public void setOwner(String owner) {
+		podVO.setOwner(owner);
+	}
+
+	public void setName(String name) {
+		podVO.setName(name);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/ZoneEntityImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/ZoneEntityImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/ZoneEntityImpl.java
new file mode 100644
index 0000000..043b632
--- /dev/null
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/ZoneEntityImpl.java
@@ -0,0 +1,205 @@
+/*
+ * 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.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+import org.apache.cloudstack.engine.datacenter.entity.EngineDataCenterVO;
+import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity;
+import org.apache.cloudstack.engine.datacenter.entity.api.PodEntity;
+import org.apache.cloudstack.engine.datacenter.entity.api.ZoneEntity;
+import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
+import com.cloud.utils.fsm.FiniteStateObject;
+import com.cloud.utils.fsm.NoTransitionException;
+
+
+@Path("/zone/{id}")
+public class ZoneEntityImpl implements ZoneEntity, FiniteStateObject<DataCenterResourceEntity.State, DataCenterResourceEntity.State.Event> {
+
+
+	private DataCenterResourceManager manager;
+
+	private EngineDataCenterVO dataCenterVO;
+
+
+	public ZoneEntityImpl(String dataCenterId, DataCenterResourceManager manager) {
+		this.manager = manager;
+	this.dataCenterVO = this.manager.loadDataCenter(dataCenterId);
+    }
+
+	@Override
+    @GET
+    public String getUuid() {
+        return dataCenterVO.getUuid();
+    }
+
+    @Override
+    public long getId() {
+	return dataCenterVO.getId();
+    }
+
+    @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 String getCurrentState() {
+        // TODO Auto-generated method stub
+        return "state";
+    }
+
+    @Override
+    public String getDesiredState() {
+        // TODO Auto-generated method stub
+        return "desired_state";
+    }
+
+    @Override
+    public Date getCreatedTime() {
+        return dataCenterVO.getCreated();
+    }
+
+    @Override
+    public Date getLastUpdatedTime() {
+        return  dataCenterVO.getLastUpdated();
+    }
+
+    @Override
+    public String getOwner() {
+        return dataCenterVO.getOwner();
+    }
+
+
+    public void setOwner(String owner) {
+	dataCenterVO.setOwner(owner);
+    }
+
+    @Override
+    public Map<String, String> getDetails() {
+	return dataCenterVO.getDetails();
+	}
+
+    public void setDetails(Map<String,String> details) {
+	dataCenterVO.setDetails(details);
+    }
+
+
+    @Override
+    public void addDetail(String name, String value) {
+	dataCenterVO.setDetail(name, value);
+    }
+
+    @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 State getState() {
+        return dataCenterVO.getState();
+    }
+
+
+    @Override
+    public List<PodEntity> listPods() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+	@Override
+	public void setState(State state) {
+		//use FSM to set state.
+	}
+
+	@Override
+	public void persist() {
+		manager.saveDataCenter(dataCenterVO);
+	}
+
+    @Override
+    public String getName() {
+        return dataCenterVO.getName();
+    }
+
+    @Override
+    public List<String> listPodIds() {
+        List<String> podIds = new ArrayList<String>();
+        podIds.add("pod-uuid-1");
+        podIds.add("pod-uuid-2");
+        return podIds;
+    }
+
+	public void setName(String name) {
+		dataCenterVO.setName(name);
+	}
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ClusterEntityImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ClusterEntityImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ClusterEntityImpl.java
deleted file mode 100644
index 46dd21d..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ClusterEntityImpl.java
+++ /dev/null
@@ -1,209 +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.datacenter.entity.api;
-
-import java.lang.reflect.Method;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
-import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineClusterVO;
-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/api/DataCenterResourceManager.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceManager.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceManager.java
deleted file mode 100644
index a5f6d5e..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceManager.java
+++ /dev/null
@@ -1,50 +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.datacenter.entity.api;
-
-
-import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
-import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineClusterVO;
-import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineDataCenterVO;
-import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostPodVO;
-import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO;
-
-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);
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceManagerImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceManagerImpl.java
deleted file mode 100644
index c267e55..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceManagerImpl.java
+++ /dev/null
@@ -1,129 +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.datacenter.entity.api;
-
-import javax.inject.Inject;
-
-import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State;
-import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
-import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineClusterVO;
-import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineDataCenterVO;
-import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostPodVO;
-import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO;
-import org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineClusterDao;
-import org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineDataCenterDao;
-import org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineHostDao;
-import org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineHostPodDao;
-import org.springframework.stereotype.Component;
-
-
-import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.utils.fsm.NoTransitionException;
-import com.cloud.utils.fsm.StateMachine2;
-
-@Component
-public class DataCenterResourceManagerImpl implements DataCenterResourceManager {
-
-	@Inject
-    EngineDataCenterDao _dataCenterDao;
-
-	@Inject
-	EngineHostPodDao _podDao;
-
-	@Inject
-	EngineClusterDao _clusterDao;
-
-	@Inject
-	EngineHostDao _hostDao;
-
-
-    protected StateMachine2<State, Event, DataCenterResourceEntity> _stateMachine = DataCenterResourceEntity.State.s_fsm;
-
-	@Override
-	public EngineDataCenterVO loadDataCenter(String dataCenterId) {
-	EngineDataCenterVO dataCenterVO = _dataCenterDao.findByUuid(dataCenterId);
-	if(dataCenterVO == null){
-		throw new InvalidParameterValueException("Zone does not exist");
-	}
-	return dataCenterVO;
-	}
-
-	@Override
-	public void saveDataCenter(EngineDataCenterVO dc) {
-		_dataCenterDao.persist(dc);
-
-	}
-
-	@Override
-	public boolean changeState(DataCenterResourceEntity entity, Event event) throws NoTransitionException {
-
-		if(entity instanceof ZoneEntity){
-			return _stateMachine.transitTo(entity, event, null, _dataCenterDao);
-		}else if(entity instanceof PodEntity){
-			return _stateMachine.transitTo(entity, event, null, _podDao);
-		}else if(entity instanceof ClusterEntity){
-			return _stateMachine.transitTo(entity, event, null, _clusterDao);
-		}else if(entity instanceof HostEntity){
-			return _stateMachine.transitTo(entity, event, null, _hostDao);
-		}
-
-		return false;
-	}
-
-	@Override
-	public EngineHostPodVO loadPod(String uuid) {
-		EngineHostPodVO pod = _podDao.findByUuid(uuid);
-	if(pod == null){
-		throw new InvalidParameterValueException("Pod does not exist");
-	}
-		return pod;
-	}
-
-	@Override
-	public EngineClusterVO loadCluster(String uuid) {
-		EngineClusterVO cluster = _clusterDao.findByUuid(uuid);
-	if(cluster == null){
-		throw new InvalidParameterValueException("Pod does not exist");
-	}
-		return cluster;
-	}
-
-	@Override
-	public void savePod(EngineHostPodVO pod) {
-		_podDao.persist(pod);
-	}
-
-	@Override
-	public void saveCluster(EngineClusterVO cluster) {
-		_clusterDao.persist(cluster);
-	}
-
-	@Override
-	public EngineHostVO loadHost(String uuid) {
-		EngineHostVO host = _hostDao.findByUuid(uuid);
-	if(host == null){
-		throw new InvalidParameterValueException("Host does not exist");
-	}
-		return host;
-	}
-
-	@Override
-	public void saveHost(EngineHostVO hostVO) {
-		_hostDao.persist(hostVO);
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/HostEntityImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/HostEntityImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/HostEntityImpl.java
deleted file mode 100644
index 17114e7..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/HostEntityImpl.java
+++ /dev/null
@@ -1,215 +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.datacenter.entity.api;
-
-import java.lang.reflect.Method;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
-import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO;
-
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.utils.fsm.NoTransitionException;
-
-public class HostEntityImpl implements HostEntity {
-
-	private DataCenterResourceManager manager;
-
-    private EngineHostVO hostVO;
-
-    public HostEntityImpl(String uuid, DataCenterResourceManager manager) {
-	this.manager = manager;
-	hostVO = manager.loadHost(uuid);
-    }
-
-	@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 hostVO.getOrchestrationState();
-	}
-
-	@Override
-	public void persist() {
-		manager.saveHost(hostVO);
-	}
-
-	@Override
-	public String getName() {
-		return hostVO.getName();
-	}
-
-	@Override
-	public String getUuid() {
-		return hostVO.getUuid();
-	}
-
-	@Override
-	public long getId() {
-		return hostVO.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 hostVO.getCreated();
-	}
-
-	@Override
-	public Date getLastUpdatedTime() {
-		return hostVO.getLastUpdated();
-	}
-
-	@Override
-	public String getOwner() {
-		// TODO Auto-generated method stub
-		return hostVO.getOwner();
-	}
-
-
-    public void setDetails(Map<String,String> details) {
-	hostVO.setDetails(details);
-    }
-
-	@Override
-	public Map<String, String> getDetails() {
-		return hostVO.getDetails();
-	}
-
-	@Override
-	public void addDetail(String name, String value) {
-		hostVO.setDetail(name, value);
-	}
-
-	@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 Long getTotalMemory() {
-		return hostVO.getTotalMemory();
-	}
-
-	@Override
-	public Integer getCpus() {
-		return hostVO.getCpus();
-	}
-
-	@Override
-	public Long getSpeed() {
-		return hostVO.getSpeed();
-	}
-
-	@Override
-	public Long getPodId() {
-		return hostVO.getPodId();
-	}
-
-	@Override
-	public long getDataCenterId() {
-		return hostVO.getDataCenterId();
-	}
-
-	@Override
-	public HypervisorType getHypervisorType() {
-		return hostVO.getHypervisorType();
-	}
-
-	@Override
-	public String getGuid() {
-		return hostVO.getGuid();
-	}
-
-	@Override
-	public Long getClusterId() {
-		return hostVO.getClusterId();
-	}
-
-	public void setOwner(String owner) {
-		hostVO.setOwner(owner);
-	}
-
-	public void setName(String name) {
-		hostVO.setName(name);
-	}
-
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/PodEntityImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/PodEntityImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/PodEntityImpl.java
deleted file mode 100755
index 758a997..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/PodEntityImpl.java
+++ /dev/null
@@ -1,211 +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.datacenter.entity.api;
-
-import java.lang.reflect.Method;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
-import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostPodVO;
-
-import com.cloud.org.Cluster;
-import com.cloud.org.Grouping.AllocationState;
-import com.cloud.utils.fsm.NoTransitionException;
-
-public class PodEntityImpl implements PodEntity {
-
-
-	private DataCenterResourceManager manager;
-
-    private EngineHostPodVO podVO;
-
-    public PodEntityImpl(String uuid, DataCenterResourceManager manager) {
-	this.manager = manager;
-	podVO = manager.loadPod(uuid);
-    }
-
-    @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 podVO.getState();
-    }
-
-    @Override
-    public String getUuid() {
-        return podVO.getUuid();
-    }
-
-    @Override
-    public long getId() {
-        return podVO.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 podVO.getCreated();
-    }
-
-    @Override
-    public Date getLastUpdatedTime() {
-        return podVO.getLastUpdated();
-    }
-
-    @Override
-    public String getOwner() {
-        return podVO.getOwner();
-    }
-
-
-    @Override
-    public List<Method> getApplicableActions() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public String getCidrAddress() {
-        return podVO.getCidrAddress();
-    }
-
-    @Override
-    public int getCidrSize() {
-        return podVO.getCidrSize();
-    }
-
-    @Override
-    public String getGateway() {
-        return podVO.getGateway();
-    }
-
-    @Override
-    public long getDataCenterId() {
-        return podVO.getDataCenterId();
-    }
-
-    @Override
-    public String getName() {
-        return podVO.getName();
-    }
-
-    @Override
-    public AllocationState getAllocationState() {
-        return podVO.getAllocationState();
-    }
-
-    @Override
-    public boolean getExternalDhcp() {
-        return podVO.getExternalDhcp();
-    }
-
-    @Override
-    public List<Cluster> listClusters() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-	@Override
-	public void persist() {
-		manager.savePod(podVO);
-
-	}
-
-	@Override
-	public Map<String, String> getDetails() {
-		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) {
-
-	}
-
-	public void setOwner(String owner) {
-		podVO.setOwner(owner);
-	}
-
-	public void setName(String name) {
-		podVO.setName(name);
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ZoneEntityImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ZoneEntityImpl.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ZoneEntityImpl.java
deleted file mode 100644
index e254880..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ZoneEntityImpl.java
+++ /dev/null
@@ -1,201 +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.datacenter.entity.api;
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
-import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineDataCenterVO;
-import com.cloud.utils.fsm.FiniteStateObject;
-import com.cloud.utils.fsm.NoTransitionException;
-
-
-@Path("/zone/{id}")
-public class ZoneEntityImpl implements ZoneEntity, FiniteStateObject<DataCenterResourceEntity.State, DataCenterResourceEntity.State.Event> {
-
-
-	private DataCenterResourceManager manager;
-
-	private EngineDataCenterVO dataCenterVO;
-
-
-	public ZoneEntityImpl(String dataCenterId, DataCenterResourceManager manager) {
-		this.manager = manager;
-	this.dataCenterVO = this.manager.loadDataCenter(dataCenterId);
-    }
-
-	@Override
-    @GET
-    public String getUuid() {
-        return dataCenterVO.getUuid();
-    }
-
-    @Override
-    public long getId() {
-	return dataCenterVO.getId();
-    }
-
-    @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 String getCurrentState() {
-        // TODO Auto-generated method stub
-        return "state";
-    }
-
-    @Override
-    public String getDesiredState() {
-        // TODO Auto-generated method stub
-        return "desired_state";
-    }
-
-    @Override
-    public Date getCreatedTime() {
-        return dataCenterVO.getCreated();
-    }
-
-    @Override
-    public Date getLastUpdatedTime() {
-        return  dataCenterVO.getLastUpdated();
-    }
-
-    @Override
-    public String getOwner() {
-        return dataCenterVO.getOwner();
-    }
-
-
-    public void setOwner(String owner) {
-	dataCenterVO.setOwner(owner);
-    }
-
-    @Override
-    public Map<String, String> getDetails() {
-	return dataCenterVO.getDetails();
-	}
-
-    public void setDetails(Map<String,String> details) {
-	dataCenterVO.setDetails(details);
-    }
-
-
-    @Override
-    public void addDetail(String name, String value) {
-	dataCenterVO.setDetail(name, value);
-    }
-
-    @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 State getState() {
-        return dataCenterVO.getState();
-    }
-
-
-    @Override
-    public List<PodEntity> listPods() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-	@Override
-	public void setState(State state) {
-		//use FSM to set state.
-	}
-
-	@Override
-	public void persist() {
-		manager.saveDataCenter(dataCenterVO);
-	}
-
-    @Override
-    public String getName() {
-        return dataCenterVO.getName();
-    }
-
-    @Override
-    public List<String> listPodIds() {
-        List<String> podIds = new ArrayList<String>();
-        podIds.add("pod-uuid-1");
-        podIds.add("pod-uuid-2");
-        return podIds;
-    }
-
-	public void setName(String name) {
-		dataCenterVO.setName(name);
-	}
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/ClusterDetailsVO.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/ClusterDetailsVO.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/ClusterDetailsVO.java
deleted file mode 100644
index d735c47..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/ClusterDetailsVO.java
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2012 Citrix Systems, Inc. Licensed under the
-// Apache License, Version 2.0 (the "License"); you may not use this
-// file except in compliance with the License.  Citrix Systems, Inc.
-// reserves all rights not expressly granted by 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.
-// 
-// Automatically generated by addcopyright.py at 04/03/2012
-package org.apache.cloudstack.engine.datacenter.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;
-
-@Entity
-@Table(name="cluster_details")
-public class ClusterDetailsVO {
-
-    @Id
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-    @Column(name="id")
-    private long id;
-    
-    @Column(name="cluster_id")
-    private long clusterId;
-    
-    @Column(name="name")
-    private String name;
-    
-    @Column(name="value")
-    private String value;
-    
-    protected ClusterDetailsVO() {
-    }
-    
-    public ClusterDetailsVO(long clusterId, String name, String value) {
-        this.clusterId = clusterId;
-        this.name = name;
-        this.value = value;
-    }
-
-    public long getClusterId() {
-        return clusterId;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-    public long getId() {
-        return id;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/DcDetailVO.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/DcDetailVO.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/DcDetailVO.java
deleted file mode 100644
index ef59118..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/DcDetailVO.java
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2012 Citrix Systems, Inc. Licensed under the
-// Apache License, Version 2.0 (the "License"); you may not use this
-// file except in compliance with the License.  Citrix Systems, Inc.
-// reserves all rights not expressly granted by 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.
-// 
-// Automatically generated by addcopyright.py at 04/03/2012
-package org.apache.cloudstack.engine.datacenter.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;
-
-@Entity
-@Table(name="data_center_details")
-public class DcDetailVO {
-    @Id
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-    @Column(name="id")
-    private long id;
-    
-    @Column(name="dc_id")
-    private long dcId;
-    
-    @Column(name="name")
-    private String name;
-    
-    @Column(name="value")
-    private String value;
-    
-    protected DcDetailVO() {
-    }
-    
-    public DcDetailVO(long dcId, String name, String value) {
-        this.dcId = dcId;
-        this.name = name;
-        this.value = value;
-    }
-
-    public long getDcId() {
-        return dcId;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-    public long getId() {
-        return id;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineCluster.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineCluster.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineCluster.java
deleted file mode 100644
index 98b7a99..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineCluster.java
+++ /dev/null
@@ -1,23 +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.datacenter.entity.api.db;
-
-import com.cloud.org.Cluster;
-
-public interface EngineCluster extends Cluster {
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineClusterVO.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineClusterVO.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineClusterVO.java
deleted file mode 100644
index 0034419..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineClusterVO.java
+++ /dev/null
@@ -1,243 +0,0 @@
-// Copyright 2012 Citrix Systems, Inc. Licensed under the
-// Apache License, Version 2.0 (the "License"); you may not use this
-// file except in compliance with the License.  Citrix Systems, Inc.
-// reserves all rights not expressly granted by 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.
-// 
-// Automatically generated by addcopyright.py at 04/03/2012
-package org.apache.cloudstack.engine.datacenter.entity.api.db;
-
-import java.util.Date;
-import java.util.UUID;
-
-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 javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-
-import org.apache.cloudstack.api.Identity;
-import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State;
-import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
-
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.org.Cluster;
-import com.cloud.org.Grouping;
-import com.cloud.org.Managed.ManagedState;
-import com.cloud.utils.NumbersUtil;
-import com.cloud.utils.db.GenericDao;
-import com.cloud.utils.db.StateMachine;
-
-@Entity
-@Table(name="cluster")
-public class EngineClusterVO implements EngineCluster, Identity {
-
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Column(name="id")
-    long id;
-
-    @Column(name="name")
-    String name;
-
-    @Column(name="guid")
-    String guid;
-
-    @Column(name="data_center_id")
-    long dataCenterId;
-
-    @Column(name="pod_id")
-    long podId;
-
-    @Column(name="hypervisor_type")
-    String hypervisorType;
-
-    @Column(name="cluster_type")
-    @Enumerated(value=EnumType.STRING)
-    Cluster.ClusterType clusterType;
-
-    @Column(name="allocation_state")
-    @Enumerated(value=EnumType.STRING)
-    AllocationState allocationState;
-
-    @Column(name="managed_state")
-    @Enumerated(value=EnumType.STRING)
-    ManagedState managedState;
-
-    @Column(name=GenericDao.REMOVED_COLUMN)
-    private Date removed;
-
-    @Column(name="uuid")
-    String uuid;
-
-    //orchestration
-
-    @Column(name="owner")
-    private String owner = null;
-
-    @Column(name=GenericDao.CREATED_COLUMN)
-    protected Date created;
-
-    @Column(name="lastUpdated", updatable=true)
-    @Temporal(value=TemporalType.TIMESTAMP)
-    protected Date lastUpdated;
-
-    /**
-     * 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="engine_state", updatable=true, nullable=false, length=32)
-    protected State engineState = null;
-
-
-    public EngineClusterVO() {
-        clusterType = Cluster.ClusterType.CloudManaged;
-        allocationState = Grouping.AllocationState.Enabled;
-
-        this.uuid = UUID.randomUUID().toString();
-        this.engineState = State.Disabled;
-    }
-
-    public EngineClusterVO(long dataCenterId, long podId, String name) {
-        this.dataCenterId = dataCenterId;
-        this.podId = podId;
-        this.name = name;
-        this.clusterType = Cluster.ClusterType.CloudManaged;
-        this.allocationState = Grouping.AllocationState.Enabled;
-        this.managedState = ManagedState.Managed;
-        this.uuid = UUID.randomUUID().toString();
-        this.engineState = State.Disabled;
-    }
-
-    @Override
-    public long getId() {
-        return id;
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public long getDataCenterId() {
-        return dataCenterId;
-    }
-
-    @Override
-    public long getPodId() {
-        return podId;
-    }
-
-    @Override
-    public Cluster.ClusterType getClusterType() {
-        return clusterType;
-    }
-
-    public void setClusterType(Cluster.ClusterType clusterType) {
-        this.clusterType = clusterType;
-    }
-
-    @Override
-    public AllocationState getAllocationState() {
-        return allocationState;
-    }
-
-    public void setAllocationState(AllocationState allocationState) {
-        this.allocationState = allocationState;
-    }
-
-    @Override
-    public ManagedState getManagedState() {
-        return managedState;
-    }
-
-    public void setManagedState(ManagedState managedState) {
-        this.managedState = managedState;
-    }
-
-    public EngineClusterVO(long clusterId) {
-        this.id = clusterId;
-    }
-
-    @Override
-    public int hashCode() {
-        return NumbersUtil.hash(id);
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (!(obj instanceof EngineClusterVO)) {
-            return false;
-        }
-        EngineClusterVO that = (EngineClusterVO)obj;
-        return this.id == that.id;
-    }
-
-    @Override
-    public HypervisorType getHypervisorType() {
-        return HypervisorType.getType(hypervisorType);
-    }
-
-    public void setHypervisorType(String hy) {
-        hypervisorType = hy;
-    }
-
-    public String getGuid() {
-        return guid;
-    }
-
-    public void setGuid(String guid) {
-        this.guid = guid;
-    }
-
-    public Date getRemoved() {
-        return removed;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    @Override
-    public String getUuid() {
-        return this.uuid;
-    }
-
-    public void setUuid(String uuid) {
-        this.uuid = uuid;
-    }
-
-    public String getOwner() {
-        return owner;
-    }
-
-    public void setOwner(String owner) {
-        this.owner = owner;
-    }
-
-    public Date getCreated() {
-        return created;
-    }
-
-    public Date getLastUpdated() {
-        return lastUpdated;
-    }
-
-    public State getState() {
-        return engineState;
-    }    
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenter.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenter.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenter.java
deleted file mode 100644
index 240dddf..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenter.java
+++ /dev/null
@@ -1,23 +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.datacenter.entity.api.db;
-
-import com.cloud.dc.DataCenter;
-
-public interface EngineDataCenter extends DataCenter {
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenterVO.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenterVO.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenterVO.java
deleted file mode 100644
index cdf08cc..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenterVO.java
+++ /dev/null
@@ -1,504 +0,0 @@
-// Copyright 2012 Citrix Systems, Inc. Licensed under the
-// Apache License, Version 2.0 (the "License"); you may not use this
-// file except in compliance with the License.  Citrix Systems, Inc.
-// reserves all rights not expressly granted by 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.
-//
-// Automatically generated by addcopyright.py at 04/03/2012
-package org.apache.cloudstack.engine.datacenter.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.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.TableGenerator;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-import javax.persistence.Transient;
-
-import org.apache.cloudstack.api.Identity;
-import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State;
-import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
-
-
-import com.cloud.network.Network.Provider;
-import com.cloud.org.Grouping;
-import com.cloud.utils.NumbersUtil;
-import com.cloud.utils.db.GenericDao;
-import com.cloud.utils.db.StateMachine;
-
-@Entity
-@Table(name="data_center")
-public class EngineDataCenterVO implements EngineDataCenter, Identity {
-
-    @Id
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-    @Column(name="id")
-    private long id;
-
-    @Column(name="name")
-    private String name = null;
-
-    @Column(name="description")
-    private String description = null;
-
-    @Column(name="dns1")
-    private String dns1 = null;
-
-    @Column(name="dns2")
-    private String dns2 = null;
-
-    @Column(name="ip6Dns1")
-    private String ip6Dns1 = null;
-
-    @Column(name="ip6Dns2")
-    private String ip6Dns2 = null;
-
-    @Column(name="internal_dns1")
-    private String internalDns1 = null;
-
-    @Column(name="internal_dns2")
-    private String internalDns2 = null;
-
-    @Column(name="router_mac_address", updatable = false, nullable=false)
-    private String routerMacAddress = "02:00:00:00:00:01";
-
-    @Column(name="guest_network_cidr")
-    private String guestNetworkCidr = null;
-
-    @Column(name="domain_id")
-    private Long domainId = null;
-
-    @Column(name="domain")
-    private String domain;
-
-    @Column(name="networktype")
-    @Enumerated(EnumType.STRING) 
-    NetworkType networkType;
-
-    @Column(name="dns_provider")
-    private String dnsProvider;
-
-    @Column(name="dhcp_provider")
-    private String dhcpProvider;
-
-    @Column(name="gateway_provider")
-    private String gatewayProvider;
-
-    @Column(name="vpn_provider")
-    private String vpnProvider;
-
-    @Column(name="userdata_provider")
-    private String userDataProvider;
-
-    @Column(name="lb_provider")
-    private String loadBalancerProvider;
-
-    @Column(name="firewall_provider")
-    private String firewallProvider;
-
-    @Column(name="mac_address", nullable=false)
-    @TableGenerator(name="mac_address_sq", table="data_center", pkColumnName="id", valueColumnName="mac_address", allocationSize=1)
-    private long macAddress = 1;
-
-    @Column(name="zone_token")
-    private String zoneToken;    
-
-    @Column(name=GenericDao.REMOVED_COLUMN)
-    private Date removed;
-
-    // This is a delayed load value.  If the value is null,
-    // then this field has not been loaded yet.
-    // Call the dao to load it.
-    @Transient
-    Map<String, String> details;
-
-    @Column(name="allocation_state")
-    @Enumerated(value=EnumType.STRING)
-    AllocationState allocationState;
-
-    @Column(name="uuid")
-    private String uuid;    
-
-    @Column(name="is_security_group_enabled")
-    boolean securityGroupEnabled;
-
-    @Column(name="is_local_storage_enabled")
-    boolean localStorageEnabled;
-
-    //orchestration
-    @Column(name="owner")
-    private String owner = null;
-
-    @Column(name=GenericDao.CREATED_COLUMN)
-    protected Date created;
-
-    @Column(name="lastUpdated", updatable=true)
-    @Temporal(value=TemporalType.TIMESTAMP)
-    protected Date lastUpdated;
-
-    /**
-     * 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="engine_state", updatable=true, nullable=false, length=32)
-    protected State engineState = null;
-
-
-    @Override
-    public String getDnsProvider() {
-        return dnsProvider;
-    }
-
-    public void setDnsProvider(String dnsProvider) {
-        this.dnsProvider = dnsProvider;
-    }
-
-    @Override
-    public String getDhcpProvider() {
-        return dhcpProvider;
-    }
-
-    public void setDhcpProvider(String dhcpProvider) {
-        this.dhcpProvider = dhcpProvider;
-    }
-
-    @Override
-    public String getGatewayProvider() {
-        return gatewayProvider;
-    }
-
-    public void setGatewayProvider(String gatewayProvider) {
-        this.gatewayProvider = gatewayProvider;
-    }
-
-    @Override
-    public String getLoadBalancerProvider() {
-        return loadBalancerProvider;
-    }
-
-    public void setLoadBalancerProvider(String loadBalancerProvider) {
-        this.loadBalancerProvider = loadBalancerProvider;
-    }
-
-    @Override
-    public String getFirewallProvider() {
-        return firewallProvider; 
-    }
-
-    public void setFirewallProvider(String firewallProvider) {
-        this.firewallProvider = firewallProvider;
-    }
-
-    public EngineDataCenterVO(long id, String name, String description, String dns1, String dns2, String dns3, String dns4, String guestCidr, String domain, Long domainId, NetworkType zoneType, String zoneToken, String domainSuffix) {
-        this(name, description, dns1, dns2, dns3, dns4, guestCidr, domain, domainId, zoneType, zoneToken, domainSuffix, false, false, null, null);
-        this.id = id;
-        this.allocationState = Grouping.AllocationState.Enabled;
-        this.uuid = UUID.randomUUID().toString();
-    }
-
-    public EngineDataCenterVO(String name, String description, String dns1, String dns2, String dns3, String dns4, String guestCidr, String domain, Long domainId, NetworkType zoneType, String zoneToken, String domainSuffix, boolean securityGroupEnabled, boolean localStorageEnabled, String ip6Dns1, String ip6Dns2) {
-        this.name = name;
-        this.description = description;
-        this.dns1 = dns1;
-        this.dns2 = dns2;
-        this.internalDns1 = dns3;
-        this.internalDns2 = dns4;
-        this.guestNetworkCidr = guestCidr;
-        this.domain = domain;
-        this.domainId = domainId;
-        this.networkType = zoneType;
-        this.allocationState = Grouping.AllocationState.Enabled;
-        this.securityGroupEnabled = securityGroupEnabled;
-        this.localStorageEnabled = localStorageEnabled;
-
-        if (zoneType == NetworkType.Advanced) {
-            loadBalancerProvider = Provider.VirtualRouter.getName();
-            firewallProvider = Provider.VirtualRouter.getName();
-            dhcpProvider = Provider.VirtualRouter.getName();
-            dnsProvider = Provider.VirtualRouter.getName();
-            gatewayProvider = Provider.VirtualRouter.getName();
-            vpnProvider = Provider.VirtualRouter.getName();
-            userDataProvider = Provider.VirtualRouter.getName();
-        } else if (zoneType == NetworkType.Basic){
-            dhcpProvider = Provider.VirtualRouter.getName();
-            dnsProvider = Provider.VirtualRouter.getName();
-            userDataProvider = Provider.VirtualRouter.getName();
-            loadBalancerProvider = Provider.ElasticLoadBalancerVm.getName();
-        }
-
-        this.zoneToken = zoneToken;
-        this.domain = domainSuffix;
-        this.uuid = UUID.randomUUID().toString();
-        this.engineState = State.Disabled;
-    }
-
-    @Override
-    public String getVpnProvider() {
-        return vpnProvider;
-    }
-
-    public void setVpnProvider(String vpnProvider) {
-        this.vpnProvider = vpnProvider;
-    }
-
-    @Override
-    public String getUserDataProvider() {
-        return userDataProvider;
-    }
-
-    public void setUserDataProvider(String userDataProvider) {
-        this.userDataProvider = userDataProvider;
-    }
-
-    @Override
-    public String getGuestNetworkCidr()
-    {
-        return guestNetworkCidr;
-    }
-
-    public void setGuestNetworkCidr(String guestNetworkCidr)
-    {
-        this.guestNetworkCidr = guestNetworkCidr;
-    }
-
-    @Override
-    public Long getDomainId() {
-        return domainId;
-    }
-
-    public void setDomainId(Long domainId) {
-        this.domainId = domainId;
-    }
-
-    @Override
-    public String getDescription() {
-        return description;
-    }
-
-    public String getRouterMacAddress() {
-        return routerMacAddress;
-    }
-
-    @Override
-    public String getDns1() {
-        return dns1;
-    }
-
-    @Override
-    public String getDns2() {
-        return dns2;
-    }
-
-    @Override
-    public String getInternalDns1() {
-        return internalDns1;
-    }
-
-    @Override
-    public String getInternalDns2() {
-        return internalDns2;
-    }
-
-    protected EngineDataCenterVO() {
-    }
-
-    @Override
-    public long getId() {
-        return id;
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public void setDns1(String dns1) {
-        this.dns1 = dns1;
-    }
-
-    public void setDns2(String dns2) {
-        this.dns2 = dns2;
-    }
-
-    public void setInternalDns1(String dns3) {
-        this.internalDns1 = dns3;
-    }
-
-    public void setInternalDns2(String dns4) {
-        this.internalDns2 = dns4;
-    }
-
-    public void setRouterMacAddress(String routerMacAddress) {
-        this.routerMacAddress = routerMacAddress;
-    }
-
-    @Override
-    public String getDomain() {
-        return domain;
-    }
-
-    public void setDomain(String domain) {
-        this.domain = domain;
-    }
-
-    public void setNetworkType(NetworkType zoneNetworkType) {
-        this.networkType = zoneNetworkType;
-    }
-
-    @Override
-    public NetworkType getNetworkType() {
-        return networkType;
-    }
-
-    @Override 
-    public boolean isSecurityGroupEnabled() {
-        return securityGroupEnabled;
-    }
-
-    public void setSecurityGroupEnabled(boolean enabled) {
-        this.securityGroupEnabled = enabled;
-    }
-
-    @Override
-    public boolean isLocalStorageEnabled() {
-        return localStorageEnabled;
-    }
-
-    public void setLocalStorageEnabled(boolean enabled) {
-        this.localStorageEnabled = enabled;
-    }
-
-    @Override
-    public Map<String, String> getDetails() {
-        return details;
-    }
-
-    @Override
-    public void setDetails(Map<String, String> details2) {
-        details = details2;        
-    }
-
-    public String getDetail(String name) {
-        assert (details != null) : "Did you forget to load the details?";
-
-        return details != null ? details.get(name) : null;
-    }
-
-    public void setDetail(String name, String value) {
-        assert (details != null) : "Did you forget to load the details?";
-
-        details.put(name, value);
-    }
-
-    @Override
-    public AllocationState getAllocationState() {
-        return allocationState;
-    }
-
-    public void setAllocationState(AllocationState allocationState) {
-        this.allocationState = allocationState;
-    }
-
-    @Override
-    public int hashCode() {
-        return NumbersUtil.hash(id);
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (!(obj instanceof EngineDataCenterVO)) {
-            return false;
-        }
-        EngineDataCenterVO that = (EngineDataCenterVO)obj;
-        return this.id == that.id;
-    }
-
-    @Override
-    public String getZoneToken() {
-        return zoneToken;
-    }
-
-    public void setZoneToken(String zoneToken) {
-        this.zoneToken = zoneToken;
-    }
-
-    public Date getRemoved() {
-        return removed;
-    }
-
-    @Override
-    public String getUuid() {
-        return this.uuid;
-    }
-
-    public void setUuid(String uuid) {
-        this.uuid = uuid;
-    }
-
-    public long getMacAddress() {
-        return macAddress;
-    }
-
-    public void setMacAddress(long macAddress) {
-        this.macAddress = macAddress;
-    }
-
-    public String getOwner() {
-        return owner;
-    }
-
-    public void setOwner(String owner) {
-        this.owner = owner;
-    }
-
-    public Date getCreated() {
-        return created;
-    }
-
-    public Date getLastUpdated() {
-        return lastUpdated;
-    }
-
-    public State getState() {
-        return engineState;
-    }
-
-	@Override
-	public String getIp6Dns1() {
-		return ip6Dns1;
-	}
-
-	public void setIp6Dns1(String ip6Dns1) {
-		this.ip6Dns1 = ip6Dns1;
-	}
-
-	@Override
-	public String getIp6Dns2() {
-		return ip6Dns2;
-	}
-
-	public void setIp6Dns2(String ip6Dns2) {
-		this.ip6Dns2 = ip6Dns2;
-	}
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHost.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHost.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHost.java
deleted file mode 100644
index 127c445..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHost.java
+++ /dev/null
@@ -1,24 +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.datacenter.entity.api.db;
-
-import com.cloud.host.Host;
-
-public interface EngineHost extends Host {
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2fa36120/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostPodVO.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostPodVO.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostPodVO.java
deleted file mode 100644
index 65b9db5..0000000
--- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostPodVO.java
+++ /dev/null
@@ -1,245 +0,0 @@
-// Copyright 2012 Citrix Systems, Inc. Licensed under the
-// Apache License, Version 2.0 (the "License"); you may not use this
-// file except in compliance with the License.  Citrix Systems, Inc.
-// reserves all rights not expressly granted by 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.
-//
-// Automatically generated by addcopyright.py at 04/03/2012
-package org.apache.cloudstack.engine.datacenter.entity.api.db;
-
-import java.util.Date;
-import java.util.UUID;
-
-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 javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-
-import org.apache.cloudstack.api.Identity;
-import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State;
-import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
-
-import com.cloud.org.Grouping;
-import com.cloud.utils.NumbersUtil;
-import com.cloud.utils.db.GenericDao;
-import com.cloud.utils.db.StateMachine;
-
-@Entity
-@Table(name = "host_pod_ref")
-public class EngineHostPodVO implements EnginePod, Identity {
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    long id;
-
-    @Column(name = "name")
-    private String name = null;
-
-    @Column(name = "data_center_id")
-    private long dataCenterId;
-
-    @Column(name = "gateway")
-    private String gateway;
-
-    @Column(name = "cidr_address")
-    private String cidrAddress;
-
-    @Column(name = "cidr_size")
-    private int cidrSize;
-
-    @Column(name = "description")
-    private String description;
-
-    @Column(name="allocation_state")
-    @Enumerated(value=EnumType.STRING)
-    AllocationState allocationState;
-
-    @Column(name = "external_dhcp")
-    private Boolean externalDhcp;
-
-    @Column(name=GenericDao.REMOVED_COLUMN)
-    private Date removed;
-
-    @Column(name = "uuid")
-    private String uuid;
-
-    //orchestration
-    @Column(name="owner")
-    private String owner = null;
-
-    @Column(name=GenericDao.CREATED_COLUMN)
-    protected Date created;
-
-    @Column(name="lastUpdated", updatable=true)
-    @Temporal(value=TemporalType.TIMESTAMP)
-    protected Date lastUpdated;    
-
-    /**
-     * 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="engine_state", updatable=true, nullable=false, length=32)
-    protected State engineState = null;
-
-    public EngineHostPodVO(String name, long dcId, String gateway, String cidrAddress, int cidrSize, String description) {
-        this.name = name;
-        this.dataCenterId = dcId;
-        this.gateway = gateway;
-        this.cidrAddress = cidrAddress;
-        this.cidrSize = cidrSize;
-        this.description = description;
-        this.allocationState = Grouping.AllocationState.Enabled;
-        this.externalDhcp = false;
-        this.uuid = UUID.randomUUID().toString();
-        this.engineState = State.Disabled;
-    }
-
-    /*
-     * public HostPodVO(String name, long dcId) { this(null, name, dcId); }
-     */
-    protected EngineHostPodVO() {
-        this.uuid = UUID.randomUUID().toString();
-    }
-
-    @Override
-    public long getId() {
-        return id;
-    }
-
-    @Override
-    public long getDataCenterId() {
-        return dataCenterId;
-    }
-
-    public void setDataCenterId(long dataCenterId) {
-        this.dataCenterId = dataCenterId;
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    @Override
-    public String getCidrAddress() {
-        return cidrAddress;
-    }
-
-    public void setCidrAddress(String cidrAddress) {
-        this.cidrAddress = cidrAddress;
-    }
-
-    @Override
-    public int getCidrSize() {
-        return cidrSize;
-    }
-
-    public void setCidrSize(int cidrSize) {
-        this.cidrSize = cidrSize;
-    }
-
-    @Override
-    public String getGateway() {
-        return gateway;
-    }
-
-    public void setGateway(String gateway) {
-        this.gateway = gateway;
-    }
-
-    @Override
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    @Override
-    public AllocationState getAllocationState() {
-        return allocationState;
-    }
-
-    public void setAllocationState(AllocationState allocationState) {
-        this.allocationState = allocationState;
-    }
-
-    // Use for comparisons only.
-    public EngineHostPodVO(Long id) {
-        this.id = id;
-    }
-
-    @Override
-    public int hashCode() {
-        return  NumbersUtil.hash(id);
-    }
-
-    @Override
-    public boolean getExternalDhcp() {
-        return externalDhcp;
-    }
-
-    public void setExternalDhcp(boolean use) {
-        externalDhcp = use;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof EngineHostPodVO) {
-            return id == ((EngineHostPodVO)obj).id;
-        } else {
-            return false;
-        }
-    }
-
-    public Date getRemoved() {
-        return removed;
-    }
-
-    @Override
-    public String getUuid() {
-        return this.uuid;
-    }
-
-    public void setUuid(String uuid) {
-        this.uuid = uuid;
-    }
-
-    public String getOwner() {
-        return owner;
-    }
-
-    public void setOwner(String owner) {
-        this.owner = owner;
-    }
-
-    public Date getCreated() {
-        return created;
-    }
-
-    public Date getLastUpdated() {
-        return lastUpdated;
-    }
-
-    public State getState() {
-        return engineState;
-    }
-}


Mime
View raw message