Skip to content

Commit 2fa3612

Browse files
committed
Moved VOs into the schema
1 parent 3dd26e8 commit 2fa3612

55 files changed

Lines changed: 149 additions & 135 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

engine/api/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceEntity.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
package org.apache.cloudstack.engine.datacenter.entity.api;
2020

2121
import javax.ws.rs.GET;
22-
23-
2422
import javax.ws.rs.POST;
2523
import javax.ws.rs.Produces;
2624

@@ -30,14 +28,14 @@
3028
import com.cloud.utils.fsm.StateObject;
3129

3230
/**
33-
* This interface specifies the states and operations all physical
34-
* and virtual resources in the data center must implement.
31+
* This interface specifies the states and operations all physical
32+
* and virtual resources in the data center must implement.
3533
*/
3634
@Produces({"application/json", "application/xml"})
3735
public interface DataCenterResourceEntity extends CloudStackEntity, StateObject<DataCenterResourceEntity.State> {
3836

3937
/**
40-
* This is the state machine for how CloudStack should interact with
38+
* This is the state machine for how CloudStack should interact with
4139
*
4240
*/
4341
public enum State {
@@ -66,12 +64,15 @@ public enum Event {
6664
s_fsm.addTransition(Deactivated, Event.ActivatedRequest, Enabled);
6765
}
6866

67+
public static StateMachine2<State, Event, DataCenterResourceEntity> getStateMachine() {
68+
return s_fsm;
69+
}
6970
}
7071

7172
/**
7273
* Prepare the resource to take new on new demands.
7374
*/
74-
@POST
75+
@POST
7576
boolean enable();
7677

7778
/**

engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// under the License.
1717
package org.apache.cloudstack.engine.cloud.entity.api;
1818

19-
import org.apache.cloudstack.engine.cloud.entity.api.db.VMEntityVO;
19+
import org.apache.cloudstack.engine.cloud.entity.VMEntityVO;
2020

2121
import com.cloud.deploy.DeploymentPlan;
2222
import com.cloud.deploy.DeploymentPlanner.ExcludeList;

engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424

2525
import javax.inject.Inject;
2626

27-
import org.apache.cloudstack.engine.cloud.entity.api.db.VMEntityVO;
28-
import org.apache.cloudstack.engine.cloud.entity.api.db.VMReservationVO;
29-
import org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMEntityDao;
30-
import org.apache.cloudstack.engine.cloud.entity.api.db.dao.VMReservationDao;
27+
import org.apache.cloudstack.engine.cloud.entity.VMEntityVO;
28+
import org.apache.cloudstack.engine.cloud.entity.VMReservationVO;
29+
import org.apache.cloudstack.engine.cloud.entity.dao.VMEntityDao;
30+
import org.apache.cloudstack.engine.cloud.entity.dao.VMReservationDao;
3131
import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
3232
import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
3333
import org.springframework.stereotype.Component;

engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VirtualMachineEntityImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323

2424
import javax.inject.Inject;
2525

26-
import org.apache.cloudstack.engine.cloud.entity.api.db.VMEntityVO;
26+
import org.apache.cloudstack.engine.cloud.entity.VMEntityVO;
27+
2728
import org.springframework.stereotype.Component;
2829

2930
import com.cloud.deploy.DeploymentPlan;

engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ClusterEntityImpl.java renamed to engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/ClusterEntityImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
package org.apache.cloudstack.engine.datacenter.entity.api;
18+
package org.apache.cloudstack.engine.datacenter.entity;
1919

2020
import java.lang.reflect.Method;
2121
import java.util.Date;
2222
import java.util.List;
2323
import java.util.Map;
2424

25+
import org.apache.cloudstack.engine.datacenter.entity.EngineClusterVO;
26+
import org.apache.cloudstack.engine.datacenter.entity.api.ClusterEntity;
2527
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
26-
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineClusterVO;
2728
import com.cloud.hypervisor.Hypervisor.HypervisorType;
2829
import com.cloud.org.Cluster.ClusterType;
2930
import com.cloud.org.Grouping.AllocationState;

engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceManager.java renamed to engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/DataCenterResourceManager.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@
1414
// KIND, either express or implied. See the License for the
1515
// specific language governing permissions and limitations
1616
// under the License.
17-
package org.apache.cloudstack.engine.datacenter.entity.api;
17+
package org.apache.cloudstack.engine.datacenter.entity;
1818

1919

20+
import org.apache.cloudstack.engine.datacenter.entity.EngineClusterVO;
21+
import org.apache.cloudstack.engine.datacenter.entity.EngineDataCenterVO;
22+
import org.apache.cloudstack.engine.datacenter.entity.EngineHostPodVO;
23+
import org.apache.cloudstack.engine.datacenter.entity.EngineHostVO;
24+
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity;
2025
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
21-
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineClusterVO;
22-
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineDataCenterVO;
23-
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostPodVO;
24-
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO;
2526

2627
import com.cloud.utils.fsm.NoTransitionException;
2728

engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/DataCenterResourceManagerImpl.java renamed to engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/DataCenterResourceManagerImpl.java

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,26 @@
1414
// KIND, either express or implied. See the License for the
1515
// specific language governing permissions and limitations
1616
// under the License.
17-
package org.apache.cloudstack.engine.datacenter.entity.api;
17+
package org.apache.cloudstack.engine.datacenter.entity;
1818

1919
import javax.inject.Inject;
2020

21+
import org.apache.cloudstack.engine.datacenter.entity.api.ClusterEntity;
22+
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity;
2123
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State;
2224
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
23-
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineClusterVO;
24-
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineDataCenterVO;
25-
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostPodVO;
26-
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO;
27-
import org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineClusterDao;
28-
import org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineDataCenterDao;
29-
import org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineHostDao;
30-
import org.apache.cloudstack.engine.datacenter.entity.api.db.dao.EngineHostPodDao;
31-
import org.springframework.stereotype.Component;
32-
25+
import org.apache.cloudstack.engine.datacenter.entity.api.HostEntity;
26+
import org.apache.cloudstack.engine.datacenter.entity.api.PodEntity;
27+
import org.apache.cloudstack.engine.datacenter.entity.api.ZoneEntity;
28+
import org.apache.cloudstack.engine.datacenter.entity.dao.EngineClusterDao;
29+
import org.apache.cloudstack.engine.datacenter.entity.dao.EngineDataCenterDao;
30+
import org.apache.cloudstack.engine.datacenter.entity.dao.EngineHostDao;
31+
import org.apache.cloudstack.engine.datacenter.entity.dao.EngineHostPodDao;
3332

3433
import com.cloud.exception.InvalidParameterValueException;
3534
import com.cloud.utils.fsm.NoTransitionException;
3635
import com.cloud.utils.fsm.StateMachine2;
3736

38-
@Component
3937
public class DataCenterResourceManagerImpl implements DataCenterResourceManager {
4038

4139
@Inject
@@ -51,7 +49,7 @@ public class DataCenterResourceManagerImpl implements DataCenterResourceManager
5149
EngineHostDao _hostDao;
5250

5351

54-
protected StateMachine2<State, Event, DataCenterResourceEntity> _stateMachine = DataCenterResourceEntity.State.s_fsm;
52+
protected StateMachine2<State, Event, DataCenterResourceEntity> _stateMachine = DataCenterResourceEntity.State.getStateMachine();
5553

5654
@Override
5755
public EngineDataCenterVO loadDataCenter(String dataCenterId) {
@@ -125,5 +123,4 @@ public EngineHostVO loadHost(String uuid) {
125123
public void saveHost(EngineHostVO hostVO) {
126124
_hostDao.persist(hostVO);
127125
}
128-
129126
}

engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/HostEntityImpl.java renamed to engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/HostEntityImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@
1414
// KIND, either express or implied. See the License for the
1515
// specific language governing permissions and limitations
1616
// under the License.
17-
package org.apache.cloudstack.engine.datacenter.entity.api;
17+
package org.apache.cloudstack.engine.datacenter.entity;
1818

1919
import java.lang.reflect.Method;
2020
import java.util.Date;
2121
import java.util.List;
2222
import java.util.Map;
2323

24+
import org.apache.cloudstack.engine.datacenter.entity.EngineHostVO;
25+
import org.apache.cloudstack.engine.datacenter.entity.api.HostEntity;
2426
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
25-
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostVO;
2627

2728
import com.cloud.hypervisor.Hypervisor.HypervisorType;
2829
import com.cloud.utils.fsm.NoTransitionException;

engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/PodEntityImpl.java renamed to engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/PodEntityImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.apache.cloudstack.engine.datacenter.entity.api;
19+
package org.apache.cloudstack.engine.datacenter.entity;
2020

2121
import java.lang.reflect.Method;
2222
import java.util.Date;
2323
import java.util.List;
2424
import java.util.Map;
2525

26+
import org.apache.cloudstack.engine.datacenter.entity.EngineHostPodVO;
27+
import org.apache.cloudstack.engine.datacenter.entity.api.PodEntity;
2628
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
27-
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineHostPodVO;
2829

2930
import com.cloud.org.Cluster;
3031
import com.cloud.org.Grouping.AllocationState;

engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/api/ZoneEntityImpl.java renamed to engine/orchestration/src/org/apache/cloudstack/engine/datacenter/entity/ZoneEntityImpl.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
package org.apache.cloudstack.engine.datacenter.entity.api;
19+
package org.apache.cloudstack.engine.datacenter.entity;
2020

2121
import java.lang.reflect.Method;
2222
import java.util.ArrayList;
@@ -25,8 +25,12 @@
2525
import java.util.Map;
2626
import javax.ws.rs.GET;
2727
import javax.ws.rs.Path;
28+
29+
import org.apache.cloudstack.engine.datacenter.entity.EngineDataCenterVO;
30+
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity;
31+
import org.apache.cloudstack.engine.datacenter.entity.api.PodEntity;
32+
import org.apache.cloudstack.engine.datacenter.entity.api.ZoneEntity;
2833
import org.apache.cloudstack.engine.datacenter.entity.api.DataCenterResourceEntity.State.Event;
29-
import org.apache.cloudstack.engine.datacenter.entity.api.db.EngineDataCenterVO;
3034
import com.cloud.utils.fsm.FiniteStateObject;
3135
import com.cloud.utils.fsm.NoTransitionException;
3236

0 commit comments

Comments
 (0)