diff --git a/framework/ipc/.settings/org.eclipse.m2e.core.prefs b/framework/ipc/.settings/org.eclipse.m2e.core.prefs new file mode 100755 index 00000000000..f897a7f1cb2 --- /dev/null +++ b/framework/ipc/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/platform/api/.settings/org.eclipse.jdt.core.prefs b/platform/api/.settings/org.eclipse.jdt.core.prefs new file mode 100755 index 00000000000..abec6ca389a --- /dev/null +++ b/platform/api/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/platform/api/.settings/org.eclipse.m2e.core.prefs b/platform/api/.settings/org.eclipse.m2e.core.prefs new file mode 100755 index 00000000000..f897a7f1cb2 --- /dev/null +++ b/platform/api/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/NetworkEntity.java b/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/NetworkEntity.java new file mode 100755 index 00000000000..3092905e4b9 --- /dev/null +++ b/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/NetworkEntity.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.platform.cloud.entity.api; + +import org.apache.cloudstack.platform.entity.api.CloudEntity; + +public interface NetworkEntity extends CloudEntity { +} diff --git a/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/NicEntity.java b/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/NicEntity.java new file mode 100755 index 00000000000..b710db9ee91 --- /dev/null +++ b/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/NicEntity.java @@ -0,0 +1,29 @@ +/* + * 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.platform.cloud.entity.api; + +import org.apache.cloudstack.platform.entity.api.CloudEntity; + +/** + * @author ahuang + * + */ +public interface NicEntity extends CloudEntity { + +} diff --git a/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/SnapshotEntity.java b/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/SnapshotEntity.java new file mode 100755 index 00000000000..13bc7276ccf --- /dev/null +++ b/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/SnapshotEntity.java @@ -0,0 +1,27 @@ +/* + * 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.platform.cloud.entity.api; + +import org.apache.cloudstack.platform.entity.api.CloudEntity; + +import com.cloud.storage.Snapshot; + +public interface SnapshotEntity extends CloudEntity, Snapshot { + +} diff --git a/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/TemplateEntity.java b/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/TemplateEntity.java new file mode 100755 index 00000000000..873f125bdea --- /dev/null +++ b/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/TemplateEntity.java @@ -0,0 +1,27 @@ +/* + * 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.platform.cloud.entity.api; + +import org.apache.cloudstack.platform.entity.api.CloudEntity; + +import com.cloud.template.VirtualMachineTemplate; + +public interface TemplateEntity extends CloudEntity, VirtualMachineTemplate { + +} diff --git a/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/VirtualMachineEntity.java b/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/VirtualMachineEntity.java new file mode 100755 index 00000000000..75fdaee4f23 --- /dev/null +++ b/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/VirtualMachineEntity.java @@ -0,0 +1,113 @@ +/* + * 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.platform.cloud.entity.api; + +import java.util.List; + +import org.apache.cloudstack.platform.entity.api.CloudEntity; + +import com.cloud.deploy.DeployDestination; +import com.cloud.deploy.DeploymentPlanner.ExcludeList; +import com.cloud.vm.VirtualMachine; + +/** + * VirtualMachineEntity represents a Virtual Machine in Cloud Orchestration + * Platform. + * + */ +public interface VirtualMachineEntity extends CloudEntity, VirtualMachine { + + /** + * @return the list of tags associated with the virtual machine + */ + List getTags(); + + /** + * Start the virtual machine with a given deploy destination + * @param dest destination to which to deploy the machine + * @param exclude list of areas to exclude + * @param plannerToUse the Deployment Planner that should be used + */ + void startIn(DeployDestination dest, ExcludeList exclude, String plannerToUse); + + /** + * Migrate this VM to a certain destination. + * + * @param dest + * @param exclude + * @param plannerToUse + */ + void migrateTo(DeployDestination dest, ExcludeList exclude); + + /** + * Stop the virtual machine + * + */ + void stop(); + + /** + * Cleans up after any botched starts. CloudStack Orchestration Platform + * will attempt a best effort to actually shutdown any resource but + * even if it cannot, it releases the resource from its database. + */ + void cleanup(); + + /** + * Destroys the VM. + */ + void destroy(); + + /** + * Duplicate this VM in the database so that it will start new + * @param externalId + * @return a new VirtualMachineEntity + */ + VirtualMachineEntity duplicate(String externalId); + + /** + * Take a VM snapshot + */ + void takeSnapshotOf(); + + /** + * Attach volume to this VM + * @param volume volume to attach + * @param deviceId deviceId to use + */ + void attach(VolumeEntity volume, short deviceId); + + /** + * Detach the volume from this VM + * @param volume volume to detach + */ + void detach(VolumeEntity volume); + + /** + * Connect the VM to a network + * @param network network to attach + * @param deviceId device id to use when a nic is created + */ + void connectTo(NetworkEntity network, short deviceId); + + /** + * Disconnect the VM from this network + * @param netowrk network to disconnect from + */ + void disconnectFrom(NetworkEntity netowrk); +} diff --git a/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/VolumeEntity.java b/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/VolumeEntity.java new file mode 100755 index 00000000000..4ba204c227f --- /dev/null +++ b/platform/api/src/org/apache/cloudstack/platform/cloud/entity/api/VolumeEntity.java @@ -0,0 +1,34 @@ +/* + * 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.platform.cloud.entity.api; + +import org.apache.cloudstack.platform.entity.api.CloudEntity; + +import com.cloud.storage.Volume; + +public interface VolumeEntity extends CloudEntity, Volume { + + /** + * Take a snapshot of the volume + */ + void takeSnapshotOf(); + + + +} diff --git a/platform/api/src/org/apache/cloudstack/platform/entity/api/CloudEntity.java b/platform/api/src/org/apache/cloudstack/platform/entity/api/CloudEntity.java new file mode 100755 index 00000000000..27ff543d564 --- /dev/null +++ b/platform/api/src/org/apache/cloudstack/platform/entity/api/CloudEntity.java @@ -0,0 +1,90 @@ +/* + * 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.platform.entity.api; + +import java.lang.reflect.Method; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * All entities returned by the Cloud Orchestration Platform must implement + * this interface. CloudValueEntity is an immutable representation of + * an entity exposed by Cloud Orchestration Platform. For each object, it + * defines two ids: uuid, generated by CloudStack Orchestration Platform, and + * an external id that is set by the caller when the entity is created. All + * ids must be unique for that entity. CloudValueEntity also can be converted + * to a CloudActionableEntity which contains actions the object can perform. + */ +public interface CloudEntity { + /** + * @return the uuid of the object. + */ + String getUuid(); + + /** + * @return the id which is often the database id. + */ + long getId(); + + /** + * @return external id set by the caller + */ + String getExternalId(); + + /** + * @return current state for the entity + */ + String getCurrentState(); + + /** + * @return desired state for the entity + */ + String getDesiredState(); + + /** + * Get the time the entity was created + */ + Date getCreatedTime(); + + /** + * Get the time the entity was last updated + */ + Date getLastUpdatedTime(); + + /** + * @return reference to the owner of this entity + */ + String getOwner(); + + /** + * @return details stored for this entity when created. + */ + Map getDetails(String source); + + /** + * @return a list of sources that have added to the details. + */ + List getDetailSources(); + + /** + * @return list of actions that can be performed on the object in its current state + */ + List getApplicableActions(); +} diff --git a/platform/api/src/org/apache/cloudstack/platform/exception/InsufficientCapacityException.java b/platform/api/src/org/apache/cloudstack/platform/exception/InsufficientCapacityException.java new file mode 100755 index 00000000000..d2f9112aaef --- /dev/null +++ b/platform/api/src/org/apache/cloudstack/platform/exception/InsufficientCapacityException.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.platform.exception; + +public class InsufficientCapacityException { + + +} diff --git a/platform/compute/.settings/org.eclipse.jdt.core.prefs b/platform/compute/.settings/org.eclipse.jdt.core.prefs new file mode 100755 index 00000000000..abec6ca389a --- /dev/null +++ b/platform/compute/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/platform/compute/.settings/org.eclipse.m2e.core.prefs b/platform/compute/.settings/org.eclipse.m2e.core.prefs new file mode 100755 index 00000000000..f897a7f1cb2 --- /dev/null +++ b/platform/compute/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/platform/storage/.settings/org.eclipse.jdt.core.prefs b/platform/storage/.settings/org.eclipse.jdt.core.prefs new file mode 100755 index 00000000000..abec6ca389a --- /dev/null +++ b/platform/storage/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/platform/storage/.settings/org.eclipse.m2e.core.prefs b/platform/storage/.settings/org.eclipse.m2e.core.prefs new file mode 100755 index 00000000000..f897a7f1cb2 --- /dev/null +++ b/platform/storage/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/plugins/deployment-planners/user-dispersing/.settings/org.eclipse.core.resources.prefs b/plugins/deployment-planners/user-dispersing/.settings/org.eclipse.core.resources.prefs new file mode 100755 index 00000000000..99f26c0203a --- /dev/null +++ b/plugins/deployment-planners/user-dispersing/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/plugins/deployment-planners/user-dispersing/.settings/org.eclipse.m2e.core.prefs b/plugins/deployment-planners/user-dispersing/.settings/org.eclipse.m2e.core.prefs new file mode 100755 index 00000000000..f897a7f1cb2 --- /dev/null +++ b/plugins/deployment-planners/user-dispersing/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1