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 backup/snapshot project
Date Mon, 03 Dec 2012 21:40:04 GMT
Updated Branches:
  refs/heads/javelin ac5622cc2 -> 54f9a5de6


add backup/snapshot project


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

Branch: refs/heads/javelin
Commit: 54f9a5de65a2218f6d6b310d1bbf02c774d24c29
Parents: ac5622c
Author: Edison Su <edison.su@citrix.com>
Authored: Mon Dec 3 13:39:44 2012 -0800
Committer: Edison Su <edison.su@citrix.com>
Committed: Mon Dec 3 13:39:44 2012 -0800

----------------------------------------------------------------------
 .../cloudstack/storage/backup/BackupService.java   |    7 +-
 .../provider/DefaultImageDataStoreProvider.java    |   15 +-
 .../image/provider/ImageDataStoreProvider.java     |    3 +-
 .../storage/image/store/ImageDataStore.java        |    4 -
 .../storage/image/store/ImageDataStoreImpl.java    |   12 +-
 .../lifecycle/DefaultImageDataStoreLifeCycle.java  |   38 +++
 .../cloudstack/storage/test/volumeServiceTest.java |    4 +-
 .../storage/snapshot/SnapshotServiceImpl.java      |   33 +++
 .../snapshot/strategy/HypervisorBasedSnapshot.java |   28 +++
 .../snapshot/strategy/StorageBasedSnapshot.java    |   26 ++
 .../storage/backup/SnapshotOnBackupStoreInfo.java  |    8 +
 .../storage/backup/datastore/BackupStoreInfo.java  |    8 +
 .../storage/snapshot/SnapshotEntityImpl.java       |  182 +++++++++++++++
 .../cloudstack/storage/snapshot/SnapshotInfo.java  |   10 +
 .../storage/snapshot/SnapshotService.java          |   10 +
 .../storage/snapshot/SnapshotStrategy.java         |    7 +
 16 files changed, 365 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/54f9a5de/engine/storage/backup/src/org/apache/cloudstack/storage/backup/BackupService.java
----------------------------------------------------------------------
diff --git a/engine/storage/backup/src/org/apache/cloudstack/storage/backup/BackupService.java
b/engine/storage/backup/src/org/apache/cloudstack/storage/backup/BackupService.java
index ebb4c9f..e4cb0c7 100644
--- a/engine/storage/backup/src/org/apache/cloudstack/storage/backup/BackupService.java
+++ b/engine/storage/backup/src/org/apache/cloudstack/storage/backup/BackupService.java
@@ -18,8 +18,9 @@
  */
 package org.apache.cloudstack.storage.backup;
 
-public interface BackupService {
-    String grantAccessSnapshot(long snapshotId, long endpointId);
+import org.apache.cloudstack.storage.snapshot.SnapshotInfo;
 
-    boolean revokeAccessSnapshot(long snapshotId, long endpointId);
+public interface BackupService {
+	public boolean backupSnapshot(SnapshotInfo snapshot, long backupStoreId);
+	public SnapshotOnBackupStoreInfo getSnapshot(long snapshotId);
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/54f9a5de/engine/storage/image/src/org/apache/cloudstack/storage/image/provider/DefaultImageDataStoreProvider.java
----------------------------------------------------------------------
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/provider/DefaultImageDataStoreProvider.java
b/engine/storage/image/src/org/apache/cloudstack/storage/image/provider/DefaultImageDataStoreProvider.java
index 585c54b..f87299d 100644
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/provider/DefaultImageDataStoreProvider.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/provider/DefaultImageDataStoreProvider.java
@@ -30,6 +30,8 @@ import org.apache.cloudstack.storage.image.driver.ImageDataStoreDriver;
 import org.apache.cloudstack.storage.image.driver.ImageDataStoreDriverImpl;
 import org.apache.cloudstack.storage.image.store.ImageDataStore;
 import org.apache.cloudstack.storage.image.store.ImageDataStoreImpl;
+import org.apache.cloudstack.storage.image.store.lifecycle.DefaultImageDataStoreLifeCycle;
+import org.apache.cloudstack.storage.image.store.lifecycle.ImageDataStoreLifeCycle;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.component.ComponentInject;
@@ -47,7 +49,7 @@ public class DefaultImageDataStoreProvider implements ImageDataStoreProvider
{
     public ImageDataStore getImageDataStore(long imageStoreId) {
         ImageDataStoreVO idsv = imageStoreDao.findById(imageStoreId);
         ImageDataStoreDriver driver = new ImageDataStoreDriverImpl();
-        ImageDataStore ids = new ImageDataStoreImpl(idsv, driver, false, null);
+        ImageDataStore ids = new ImageDataStoreImpl(idsv, driver, false);
         ids = ComponentInject.inject(ids);
         return ids;
     }
@@ -69,14 +71,7 @@ public class DefaultImageDataStoreProvider implements ImageDataStoreProvider
{
     }
 
     @Override
-    public ImageDataStore registerDataStore(String name, Map<String, String> params)
{
-        ImageDataStoreVO dataStore = imageStoreDao.findByName(name);
-        if (dataStore == null) {
-            dataStore = new ImageDataStoreVO();
-            dataStore.setName(name);
-            dataStore.setProvider(provider.getId());
-            dataStore = imageStoreDao.persist(dataStore);
-        }
-        return getImageDataStore(dataStore.getId());
+    public ImageDataStoreLifeCycle getLifeCycle() {
+    	return new DefaultImageDataStoreLifeCycle(this, provider, imageStoreDao);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/54f9a5de/engine/storage/image/src/org/apache/cloudstack/storage/image/provider/ImageDataStoreProvider.java
----------------------------------------------------------------------
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/provider/ImageDataStoreProvider.java
b/engine/storage/image/src/org/apache/cloudstack/storage/image/provider/ImageDataStoreProvider.java
index 76ab340..710153a 100644
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/provider/ImageDataStoreProvider.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/provider/ImageDataStoreProvider.java
@@ -21,10 +21,11 @@ package org.apache.cloudstack.storage.image.provider;
 import org.apache.cloudstack.storage.image.store.ImageDataStore;
 import org.apache.cloudstack.storage.image.store.lifecycle.ImageDataStoreLifeCycle;
 
-public interface ImageDataStoreProvider extends ImageDataStoreLifeCycle {
+public interface ImageDataStoreProvider {
     ImageDataStore getImageDataStore(long imageStoreId);
     boolean register(long providerId);
     public String getName();
+    ImageDataStoreLifeCycle getLifeCycle();
     /**
      * @param providerId
      * @return

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/54f9a5de/engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageDataStore.java
----------------------------------------------------------------------
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageDataStore.java
b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageDataStore.java
index 6e97c83..4a9240e 100644
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageDataStore.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageDataStore.java
@@ -18,9 +18,7 @@
  */
 package org.apache.cloudstack.storage.image.store;
 
-import org.apache.cloudstack.storage.image.TemplateInfo;
 import org.apache.cloudstack.storage.image.TemplateObject;
-import org.apache.cloudstack.storage.image.downloader.ImageDownloader;
 
 public interface ImageDataStore extends ImageDataStoreInfo {
     TemplateObject registerTemplate(long templateId);
@@ -32,8 +30,6 @@ public interface ImageDataStore extends ImageDataStoreInfo {
     boolean deleteTemplate(long templateId);
 
     boolean needDownloadToCacheStorage();
-
-    ImageDownloader getImageDownloader();
     
     TemplateObject getTemplate(long templateId);
 }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/54f9a5de/engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageDataStoreImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageDataStoreImpl.java
b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageDataStoreImpl.java
index 5ba91f7..6eef23d 100644
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageDataStoreImpl.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageDataStoreImpl.java
@@ -20,27 +20,22 @@ package org.apache.cloudstack.storage.image.store;
 
 import javax.inject.Inject;
 
-import org.apache.cloudstack.storage.image.TemplateInfo;
 import org.apache.cloudstack.storage.image.TemplateObject;
 import org.apache.cloudstack.storage.image.db.ImageDataDao;
-import org.apache.cloudstack.storage.image.db.ImageDataStoreDao;
 import org.apache.cloudstack.storage.image.db.ImageDataStoreVO;
 import org.apache.cloudstack.storage.image.db.ImageDataVO;
-import org.apache.cloudstack.storage.image.downloader.ImageDownloader;
 import org.apache.cloudstack.storage.image.driver.ImageDataStoreDriver;
 
 public class ImageDataStoreImpl implements ImageDataStore {
     @Inject
     ImageDataDao imageDao;
     ImageDataStoreDriver driver;
-    ImageDownloader downloader;
     ImageDataStoreVO imageDataStoreVO;
     boolean needDownloadToCacheStorage = false;
 
-    public ImageDataStoreImpl(ImageDataStoreVO dataStoreVO, ImageDataStoreDriver driver,
boolean needDownloadToCacheStorage, ImageDownloader downloader) {
+    public ImageDataStoreImpl(ImageDataStoreVO dataStoreVO, ImageDataStoreDriver driver,
boolean needDownloadToCacheStorage) {
         this.driver = driver;
         this.needDownloadToCacheStorage = needDownloadToCacheStorage;
-        this.downloader = downloader;
         this.imageDataStoreVO = dataStoreVO;
     }
 
@@ -77,11 +72,6 @@ public class ImageDataStoreImpl implements ImageDataStore {
     }
 
     @Override
-    public ImageDownloader getImageDownloader() {
-        return this.downloader;
-    }
-
-    @Override
     public long getImageDataStoreId() {
         return imageDataStoreVO.getId();
     }

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/54f9a5de/engine/storage/image/src/org/apache/cloudstack/storage/image/store/lifecycle/DefaultImageDataStoreLifeCycle.java
----------------------------------------------------------------------
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/lifecycle/DefaultImageDataStoreLifeCycle.java
b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/lifecycle/DefaultImageDataStoreLifeCycle.java
new file mode 100644
index 0000000..071e175
--- /dev/null
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/lifecycle/DefaultImageDataStoreLifeCycle.java
@@ -0,0 +1,38 @@
+package org.apache.cloudstack.storage.image.store.lifecycle;
+
+import java.util.Map;
+
+import javax.inject.Inject;
+
+import org.apache.cloudstack.storage.image.db.ImageDataStoreDao;
+import org.apache.cloudstack.storage.image.db.ImageDataStoreProviderVO;
+import org.apache.cloudstack.storage.image.db.ImageDataStoreVO;
+import org.apache.cloudstack.storage.image.provider.ImageDataStoreProvider;
+import org.apache.cloudstack.storage.image.store.ImageDataStore;
+
+public class DefaultImageDataStoreLifeCycle implements ImageDataStoreLifeCycle {
+	protected ImageDataStoreProvider provider;
+	protected ImageDataStoreProviderVO providerVO;
+	protected ImageDataStoreDao imageStoreDao;
+	@Override
+	public ImageDataStore registerDataStore(String name,
+			Map<String, String> params) {
+		ImageDataStoreVO dataStore = imageStoreDao.findByName(name);
+		if (dataStore == null) {
+			dataStore = new ImageDataStoreVO();
+			dataStore.setName(name);
+			dataStore.setProvider(providerVO.getId());
+			dataStore = imageStoreDao.persist(dataStore);
+		}
+		return provider.getImageDataStore(dataStore.getId());
+	}
+	
+	public DefaultImageDataStoreLifeCycle(ImageDataStoreProvider provider,
+			ImageDataStoreProviderVO providerVO,
+			ImageDataStoreDao dao) {
+		this.provider = provider;
+		this.providerVO = providerVO;
+		this.imageStoreDao = dao;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/54f9a5de/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/volumeServiceTest.java
----------------------------------------------------------------------
diff --git a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/volumeServiceTest.java
b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/volumeServiceTest.java
index b11e6cd..b2f079e 100644
--- a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/volumeServiceTest.java
+++ b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/volumeServiceTest.java
@@ -62,6 +62,7 @@ import org.apache.cloudstack.storage.image.format.Unknown;
 import org.apache.cloudstack.storage.image.provider.ImageDataStoreProvider;
 import org.apache.cloudstack.storage.image.provider.ImageDataStoreProviderManager;
 import org.apache.cloudstack.storage.image.store.ImageDataStore;
+import org.apache.cloudstack.storage.image.store.lifecycle.ImageDataStoreLifeCycle;
 import org.apache.cloudstack.storage.volume.VolumeService;
 import org.apache.cloudstack.storage.volume.db.VolumeDao;
 import org.apache.cloudstack.storage.volume.db.VolumeVO;
@@ -211,7 +212,8 @@ public class volumeServiceTest {
 			imageProviderMgr.configure("image Provider", new HashMap<String, Object>());
 			ImageDataVO image = createImageData();
 			ImageDataStoreProvider defaultProvider = imageProviderMgr.getProvider("DefaultProvider");
-			ImageDataStore store = defaultProvider.registerDataStore("defaultHttpStore", new HashMap<String,
String>());
+			ImageDataStoreLifeCycle lifeCycle = defaultProvider.getLifeCycle();
+			ImageDataStore store = lifeCycle.registerDataStore("defaultHttpStore", new HashMap<String,
String>());
 			imageService.registerTemplate(image.getId(), store.getImageDataStoreId());
 			TemplateEntity te = imageService.getTemplateEntity(image.getId());
 			return te;

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/54f9a5de/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
new file mode 100644
index 0000000..971e9a5
--- /dev/null
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
@@ -0,0 +1,33 @@
+package org.apache.cloudstack.storage.snapshot;
+
+import org.apache.cloudstack.engine.cloud.entity.api.SnapshotEntity;
+import org.springframework.stereotype.Component;
+
+@Component
+public class SnapshotServiceImpl implements SnapshotService {
+
+	@Override
+	public SnapshotEntity getSnapshotEntity(long snapshotId) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean takeSnapshot(SnapshotInfo snapshot) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean revertSnapshot(SnapshotInfo snapshot) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean deleteSnapshot(SnapshotInfo snapshot) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/54f9a5de/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/HypervisorBasedSnapshot.java
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/HypervisorBasedSnapshot.java
b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/HypervisorBasedSnapshot.java
new file mode 100644
index 0000000..7df413f
--- /dev/null
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/HypervisorBasedSnapshot.java
@@ -0,0 +1,28 @@
+package org.apache.cloudstack.storage.snapshot.strategy;
+
+import org.apache.cloudstack.storage.snapshot.SnapshotInfo;
+import org.apache.cloudstack.storage.snapshot.SnapshotStrategy;
+import org.springframework.stereotype.Component;
+
+@Component
+public class HypervisorBasedSnapshot implements SnapshotStrategy {
+
+	@Override
+	public boolean takeSnapshot(SnapshotInfo snapshot) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean revertSnapshot(SnapshotInfo snapshot) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean deleteSnapshot(SnapshotInfo snapshot) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/54f9a5de/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/StorageBasedSnapshot.java
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/StorageBasedSnapshot.java
b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/StorageBasedSnapshot.java
new file mode 100644
index 0000000..42807d6
--- /dev/null
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/strategy/StorageBasedSnapshot.java
@@ -0,0 +1,26 @@
+package org.apache.cloudstack.storage.snapshot.strategy;
+
+import org.apache.cloudstack.storage.snapshot.SnapshotInfo;
+import org.apache.cloudstack.storage.snapshot.SnapshotStrategy;
+
+public class StorageBasedSnapshot implements SnapshotStrategy {
+
+	@Override
+	public boolean takeSnapshot(SnapshotInfo snapshot) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean revertSnapshot(SnapshotInfo snapshot) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public boolean deleteSnapshot(SnapshotInfo snapshot) {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/54f9a5de/engine/storage/src/org/apache/cloudstack/storage/backup/SnapshotOnBackupStoreInfo.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/backup/SnapshotOnBackupStoreInfo.java
b/engine/storage/src/org/apache/cloudstack/storage/backup/SnapshotOnBackupStoreInfo.java
new file mode 100644
index 0000000..d01f2b4
--- /dev/null
+++ b/engine/storage/src/org/apache/cloudstack/storage/backup/SnapshotOnBackupStoreInfo.java
@@ -0,0 +1,8 @@
+package org.apache.cloudstack.storage.backup;
+
+import org.apache.cloudstack.storage.backup.datastore.BackupStoreInfo;
+
+public interface SnapshotOnBackupStoreInfo {
+	public String getName();
+	public BackupStoreInfo getBackupStore();
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/54f9a5de/engine/storage/src/org/apache/cloudstack/storage/backup/datastore/BackupStoreInfo.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/backup/datastore/BackupStoreInfo.java
b/engine/storage/src/org/apache/cloudstack/storage/backup/datastore/BackupStoreInfo.java
new file mode 100644
index 0000000..2c126cf
--- /dev/null
+++ b/engine/storage/src/org/apache/cloudstack/storage/backup/datastore/BackupStoreInfo.java
@@ -0,0 +1,8 @@
+package org.apache.cloudstack.storage.backup.datastore;
+
+import org.apache.cloudstack.storage.backup.SnapshotOnBackupStoreInfo;
+
+public interface BackupStoreInfo {
+	public SnapshotOnBackupStoreInfo getSnapshot(long snapshotId);
+	public boolean deleteSnapshot(SnapshotOnBackupStoreInfo snapshot);
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/54f9a5de/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotEntityImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotEntityImpl.java
b/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotEntityImpl.java
new file mode 100644
index 0000000..768f8ec
--- /dev/null
+++ b/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotEntityImpl.java
@@ -0,0 +1,182 @@
+package org.apache.cloudstack.storage.snapshot;
+
+import java.lang.reflect.Method;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.cloudstack.engine.cloud.entity.api.SnapshotEntity;
+
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
+
+public class SnapshotEntityImpl implements SnapshotEntity {
+
+	@Override
+	public String getUuid() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public long getId() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public String getCurrentState() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public String getDesiredState() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Date getCreatedTime() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Date getLastUpdatedTime() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public String getOwner() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Map<String, String> getDetails(String source) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public List<String> getDetailSources() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void addDetail(String source, String name, String value) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void delDetail(String source, String name, String value) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void updateDetail(String source, String name, String value) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public List<Method> getApplicableActions() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public long getAccountId() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public long getVolumeId() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public String getPath() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public String getName() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Date getCreated() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Type getType() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public Status getStatus() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public HypervisorType getHypervisorType() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public boolean isRecursive() {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	@Override
+	public short getsnapshotType() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public long getDomainId() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public String reserveForBackup(int expiration) {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public void backup(String reservationToken) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void restore(String vm) {
+		// TODO Auto-generated method stub
+
+	}
+
+	@Override
+	public void destroy() {
+		// TODO Auto-generated method stub
+
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/54f9a5de/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotInfo.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotInfo.java b/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotInfo.java
new file mode 100644
index 0000000..478fe3d
--- /dev/null
+++ b/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotInfo.java
@@ -0,0 +1,10 @@
+package org.apache.cloudstack.storage.snapshot;
+
+import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
+
+public interface SnapshotInfo {
+	public String getName();
+	public SnapshotInfo getParent();
+	public SnapshotInfo getChild();
+	public VolumeInfo getBaseVolume();
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/54f9a5de/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotService.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotService.java
b/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotService.java
new file mode 100644
index 0000000..bc56e62
--- /dev/null
+++ b/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotService.java
@@ -0,0 +1,10 @@
+package org.apache.cloudstack.storage.snapshot;
+
+import org.apache.cloudstack.engine.cloud.entity.api.SnapshotEntity;
+
+public interface SnapshotService {
+	public SnapshotEntity getSnapshotEntity(long snapshotId);
+	public boolean takeSnapshot(SnapshotInfo snapshot);
+	public boolean revertSnapshot(SnapshotInfo snapshot);
+	public boolean deleteSnapshot(SnapshotInfo snapshot);
+}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/54f9a5de/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotStrategy.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotStrategy.java
b/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotStrategy.java
new file mode 100644
index 0000000..980b2dd
--- /dev/null
+++ b/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotStrategy.java
@@ -0,0 +1,7 @@
+package org.apache.cloudstack.storage.snapshot;
+
+public interface SnapshotStrategy {
+	public boolean takeSnapshot(SnapshotInfo snapshot);
+	public boolean revertSnapshot(SnapshotInfo snapshot);
+	public boolean deleteSnapshot(SnapshotInfo snapshot); 
+}


Mime
View raw message