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

This commit is contained in:
Prachi Damle 2013-01-23 17:59:15 -08:00
parent 057097d0e0
commit d182e64897
9 changed files with 99 additions and 9 deletions

View File

@ -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 {
}

View File

@ -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)

View File

@ -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 {
}

View File

@ -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)

View File

@ -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 {
}

View File

@ -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;

View File

@ -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")

View File

@ -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 {
}

View File

@ -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;