incubator-cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject git commit: add storage motion interface
Date Thu, 15 Nov 2012 01:47:35 GMT
Updated Branches:
  refs/heads/javelin b38d9b82b -> cad75e722


add storage motion interface


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/cad75e72
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/cad75e72
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/cad75e72

Branch: refs/heads/javelin
Commit: cad75e7220a85c03891b0708e11a59297f5a8007
Parents: b38d9b8
Author: Edison Su <sudison@gmail.com>
Authored: Wed Nov 14 17:47:09 2012 -0800
Committer: Edison Su <sudison@gmail.com>
Committed: Wed Nov 14 17:47:24 2012 -0800

----------------------------------------------------------------------
 .../com/cloud/template/VirtualMachineTemplate.java |    1 -
 .../engine/cloud/entity/api/TemplateEntity.java    |    2 +-
 .../storage/StorageOrchestratorImpl.java           |    2 +-
 .../datastore/DefaultPrimaryDataStoreImpl.java     |   20 +++++---
 .../storage/datastore/PrimaryDataStore.java        |    2 +
 .../storage/image/ImageMotionService.java          |   24 ---------
 .../storage/image/ImageMotionServiceImpl.java      |   35 -------------
 .../cloudstack/storage/image/TemplateObject.java   |    8 +++
 .../image/motion/DefaultImageMotionProvider.java   |   23 +++++++++
 .../storage/image/motion/ImageMotionProvider.java  |   26 ++++++++++
 .../storage/image/motion/ImageMotionService.java   |   27 ++++++++++
 .../image/motion/ImageMotionServiceImpl.java       |   38 +++++++++++++++
 12 files changed, 139 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cad75e72/api/src/com/cloud/template/VirtualMachineTemplate.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/template/VirtualMachineTemplate.java b/api/src/com/cloud/template/VirtualMachineTemplate.java
index 27f5871..00a4143 100755
--- a/api/src/com/cloud/template/VirtualMachineTemplate.java
+++ b/api/src/com/cloud/template/VirtualMachineTemplate.java
@@ -92,6 +92,5 @@ public interface VirtualMachineTemplate extends ControlledEntity {
     Long getSourceTemplateId();
 
     String getTemplateTag();
-
     Map getDetails();
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cad75e72/engine/api/src/org/apache/cloudstack/engine/cloud/entity/api/TemplateEntity.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/cloud/entity/api/TemplateEntity.java
b/engine/api/src/org/apache/cloudstack/engine/cloud/entity/api/TemplateEntity.java
index 5978cc7..ac01bde 100755
--- a/engine/api/src/org/apache/cloudstack/engine/cloud/entity/api/TemplateEntity.java
+++ b/engine/api/src/org/apache/cloudstack/engine/cloud/entity/api/TemplateEntity.java
@@ -23,5 +23,5 @@ import org.apache.cloudstack.engine.entity.api.CloudStackEntity;
 import com.cloud.template.VirtualMachineTemplate;
 
 public interface TemplateEntity extends CloudStackEntity, VirtualMachineTemplate {
-
+	
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cad75e72/engine/storage/src/org/apache/cloudstack/storage/StorageOrchestratorImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/StorageOrchestratorImpl.java
b/engine/storage/src/org/apache/cloudstack/storage/StorageOrchestratorImpl.java
index eb3b1e0..356190f 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/StorageOrchestratorImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/StorageOrchestratorImpl.java
@@ -348,7 +348,7 @@ public class StorageOrchestratorImpl implements StorageOrchestrator {
 		PrimaryDataStore pd = primaryStorageMgr.getPrimaryDataStore(dataStoreId);
 		boolean existsOnPrimaryStorage = pd.templateExists(template.getId());
 		if (!existsOnPrimaryStorage) {
-			
+			pd.installTemplate(template);
 		}
 		return false;
 	}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cad75e72/engine/storage/src/org/apache/cloudstack/storage/datastore/DefaultPrimaryDataStoreImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/DefaultPrimaryDataStoreImpl.java
b/engine/storage/src/org/apache/cloudstack/storage/datastore/DefaultPrimaryDataStoreImpl.java
index bafd280..a87b195 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/DefaultPrimaryDataStoreImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/DefaultPrimaryDataStoreImpl.java
@@ -14,6 +14,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.disktype.VolumeDiskTyp
 import org.apache.cloudstack.storage.HypervisorHostEndPoint;
 import org.apache.cloudstack.storage.datastore.db.DataStoreVO;
 import org.apache.cloudstack.storage.datastore.driver.PrimaryDataStoreDriver;
+import org.apache.cloudstack.storage.image.TemplateInfo;
 
 import org.apache.cloudstack.storage.volume.VolumeEntityImpl;
 import org.apache.cloudstack.storage.volume.VolumeEvent;
@@ -66,13 +67,6 @@ public class DefaultPrimaryDataStoreImpl implements PrimaryDataStore {
 	}
 
 	@Override
-	public VolumeInfo createVolume(VolumeInfo vol, VolumeDiskType diskType) {
-		
-		
-	
-	}
-
-	@Override
 	public List<EndPoint> getEndPoints() {
 		Long clusterId = pdsv.getClusterId();
 		if (clusterId == null) {
@@ -141,4 +135,16 @@ public class DefaultPrimaryDataStoreImpl implements PrimaryDataStore
{
 		// TODO Auto-generated method stub
 		return false;
 	}
+
+	@Override
+	public boolean templateExists(long templateId) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean createTemplate(TemplateObject template) {
+		// TODO Auto-generated method stub
+		return false;
+	}
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cad75e72/engine/storage/src/org/apache/cloudstack/storage/datastore/PrimaryDataStore.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/PrimaryDataStore.java
b/engine/storage/src/org/apache/cloudstack/storage/datastore/PrimaryDataStore.java
index dd9be51..4917fc3 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/PrimaryDataStore.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/PrimaryDataStore.java
@@ -25,6 +25,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
 import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
 import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
 import org.apache.cloudstack.engine.subsystem.api.storage.disktype.VolumeDiskType;
+import org.apache.cloudstack.storage.image.TemplateObject;
 import org.apache.cloudstack.storage.volume.VolumeObject;
 
 
@@ -37,4 +38,5 @@ public interface PrimaryDataStore extends PrimaryDataStoreInfo {
 	PrimaryDataStoreInfo getDataStoreInfo();
 	boolean exists(VolumeInfo vi);
 	boolean templateExists(long templateId);
+	boolean installTemplate(TemplateObject template);
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cad75e72/engine/storage/src/org/apache/cloudstack/storage/image/ImageMotionService.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/ImageMotionService.java
b/engine/storage/src/org/apache/cloudstack/storage/image/ImageMotionService.java
deleted file mode 100644
index dd35e5d..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/ImageMotionService.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.storage.image;
-
-public interface ImageMotionService {
-	boolean copyTemplate(String templateUri, String destTemplateUri);
-	boolean copyIso(String isoUri, String destIsoUri);
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cad75e72/engine/storage/src/org/apache/cloudstack/storage/image/ImageMotionServiceImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/ImageMotionServiceImpl.java
b/engine/storage/src/org/apache/cloudstack/storage/image/ImageMotionServiceImpl.java
deleted file mode 100644
index 2dc4e74..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/ImageMotionServiceImpl.java
+++ /dev/null
@@ -1,35 +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.storage.image;
-
-public class ImageMotionServiceImpl implements ImageMotionService {
-
-	@Override
-	public boolean copyTemplate(String templateUri, String destTemplateUri) {
-		// TODO Auto-generated method stub
-		return false;
-	}
-
-	@Override
-	public boolean copyIso(String isoUri, String destIsoUri) {
-		// TODO Auto-generated method stub
-		return false;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cad75e72/engine/storage/src/org/apache/cloudstack/storage/image/TemplateObject.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/TemplateObject.java b/engine/storage/src/org/apache/cloudstack/storage/image/TemplateObject.java
index f1181db..ad43ec9 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/image/TemplateObject.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/image/TemplateObject.java
@@ -18,6 +18,14 @@
  */
 package org.apache.cloudstack.storage.image;
 
+import org.apache.cloudstack.storage.image.store.ImageDataStoreInfo;
+
 public class TemplateObject implements TemplateInfo {
 
+	@Override
+	public ImageDataStoreInfo getImageDataStore() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cad75e72/engine/storage/src/org/apache/cloudstack/storage/image/motion/DefaultImageMotionProvider.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/motion/DefaultImageMotionProvider.java
b/engine/storage/src/org/apache/cloudstack/storage/image/motion/DefaultImageMotionProvider.java
new file mode 100644
index 0000000..f645233
--- /dev/null
+++ b/engine/storage/src/org/apache/cloudstack/storage/image/motion/DefaultImageMotionProvider.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.storage.image.motion;
+
+public class DefaultImageMotionProvider implements ImageMotionProvider {
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cad75e72/engine/storage/src/org/apache/cloudstack/storage/image/motion/ImageMotionProvider.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/motion/ImageMotionProvider.java
b/engine/storage/src/org/apache/cloudstack/storage/image/motion/ImageMotionProvider.java
new file mode 100644
index 0000000..342ebe6
--- /dev/null
+++ b/engine/storage/src/org/apache/cloudstack/storage/image/motion/ImageMotionProvider.java
@@ -0,0 +1,26 @@
+/*
+ * 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.storage.image.motion;
+
+import org.apache.cloudstack.engine.cloud.entity.api.TemplateEntity;
+import org.apache.cloudstack.storage.datastore.PrimaryDataStore;
+
+public interface ImageMotionProvider {
+   public boolean canHandle(TemplateEntity template, PrimaryDataStore dataStoe);        
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
        
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         

+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cad75e72/engine/storage/src/org/apache/cloudstack/storage/image/motion/ImageMotionService.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/motion/ImageMotionService.java
b/engine/storage/src/org/apache/cloudstack/storage/image/motion/ImageMotionService.java
new file mode 100644
index 0000000..a98be67
--- /dev/null
+++ b/engine/storage/src/org/apache/cloudstack/storage/image/motion/ImageMotionService.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.storage.image.motion;
+
+import org.apache.cloudstack.engine.cloud.entity.api.TemplateEntity;
+import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
+
+public interface ImageMotionService {
+	boolean copyTemplate(TemplateEntity template, PrimaryDataStoreInfo dataStore);
+	boolean copyIso(String isoUri, String destIsoUri);
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cad75e72/engine/storage/src/org/apache/cloudstack/storage/image/motion/ImageMotionServiceImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/motion/ImageMotionServiceImpl.java
b/engine/storage/src/org/apache/cloudstack/storage/image/motion/ImageMotionServiceImpl.java
new file mode 100644
index 0000000..e5b7b25
--- /dev/null
+++ b/engine/storage/src/org/apache/cloudstack/storage/image/motion/ImageMotionServiceImpl.java
@@ -0,0 +1,38 @@
+/*
+ * 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.storage.image.motion;
+
+import org.apache.cloudstack.engine.cloud.entity.api.TemplateEntity;
+import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
+import org.apache.cloudstack.storage.datastore.PrimaryDataStore;
+
+public class ImageMotionServiceImpl implements ImageMotionService {
+	@Override
+	public boolean copyIso(String isoUri, String destIsoUri) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean copyTemplate(TemplateEntity template, PrimaryDataStore dataStore) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+}


Mime
View raw message