From d182e64897c94953f80223847dbef230bbda5f49 Mon Sep 17 00:00:00 2001 From: Prachi Damle Date: Wed, 23 Jan 2013 17:59:15 -0800 Subject: [PATCH] GenericDao maintains a map of VO interface -> DaoImpl. Since cloud-engine is not yet a separate service, we need to introduce dummy interfaces to load both CloudStack API daoImpls and engine daoImpls --- .../entity/api/db/EngineCluster.java | 23 ++++++++++++++++++ .../entity/api/db/EngineClusterVO.java | 2 +- .../entity/api/db/EngineDataCenter.java | 23 ++++++++++++++++++ .../entity/api/db/EngineDataCenterVO.java | 4 ++-- .../datacenter/entity/api/db/EngineHost.java | 24 +++++++++++++++++++ .../entity/api/db/EngineHostPodVO.java | 3 +-- .../entity/api/db/EngineHostVO.java | 3 +-- .../datacenter/entity/api/db/EnginePod.java | 23 ++++++++++++++++++ .../api/db/dao/EngineDataCenterDao.java | 3 +-- 9 files changed, 99 insertions(+), 9 deletions(-) create mode 100644 engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineCluster.java create mode 100644 engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenter.java create mode 100644 engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHost.java create mode 100644 engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EnginePod.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 new file mode 100644 index 00000000000..c4f1940c119 --- /dev/null +++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineCluster.java @@ -0,0 +1,23 @@ +// 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 { + +} 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 index 8d7ec384857..00344198d7a 100644 --- 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 @@ -40,7 +40,7 @@ import com.cloud.utils.db.StateMachine; @Entity @Table(name="cluster") -public class EngineClusterVO implements Cluster, Identity { +public class EngineClusterVO implements EngineCluster, Identity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) 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 new file mode 100644 index 00000000000..24e01a0b0af --- /dev/null +++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineDataCenter.java @@ -0,0 +1,23 @@ +// 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 { + +} 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 index 4f5f2bfba40..5080481dfc0 100644 --- 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 @@ -33,7 +33,7 @@ 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.dc.DataCenter; + import com.cloud.network.Network.Provider; import com.cloud.org.Grouping; import com.cloud.utils.NumbersUtil; @@ -42,7 +42,7 @@ import com.cloud.utils.db.StateMachine; @Entity @Table(name="data_center") -public class EngineDataCenterVO implements DataCenter, Identity { +public class EngineDataCenterVO implements EngineDataCenter, Identity { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) 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 new file mode 100644 index 00000000000..fe1b832633e --- /dev/null +++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHost.java @@ -0,0 +1,24 @@ +// 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 { + +} 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 index 9c06f2cb694..99c95406f9e 100644 --- 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 @@ -30,7 +30,6 @@ 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.dc.Pod; import com.cloud.org.Grouping; import com.cloud.utils.NumbersUtil; import com.cloud.utils.db.GenericDao; @@ -38,7 +37,7 @@ import com.cloud.utils.db.StateMachine; @Entity @Table(name = "host_pod_ref") -public class EngineHostPodVO implements Pod, Identity { +public class EngineHostPodVO implements EnginePod, Identity { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) long id; diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostVO.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostVO.java index 09e857efad8..4b4a5600380 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostVO.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EngineHostVO.java @@ -41,7 +41,6 @@ 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.host.Host; import com.cloud.host.Status; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.resource.ResourceState; @@ -54,7 +53,7 @@ import com.cloud.utils.db.StateMachine; @Table(name="host") @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS) @DiscriminatorColumn(name="type", discriminatorType=DiscriminatorType.STRING, length=32) -public class EngineHostVO implements Host, Identity { +public class EngineHostVO implements EngineHost, Identity { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name="id") diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EnginePod.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EnginePod.java new file mode 100644 index 00000000000..3983dd90420 --- /dev/null +++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/EnginePod.java @@ -0,0 +1,23 @@ +// 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.Pod; + +public interface EnginePod extends Pod { + +} diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDao.java b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDao.java index 7a59dfaf653..83060cfee2f 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDao.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/db/dao/EngineDataCenterDao.java @@ -15,10 +15,9 @@ package org.apache.cloudstack.engine.datacenter.entity.api.db.dao; import java.util.List; import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity; -import org.apache.cloudstack.engine.datacenter.entity.api.ZoneEntity; import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineDataCenterVO; -import com.cloud.utils.Pair; + import com.cloud.utils.db.GenericDao; import com.cloud.utils.fsm.StateDao;