You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2012/11/28 04:17:38 UTC

[3/6] seperate code into different modules: storage, storage/volume, storage/image, storage/snapshot, storage/backup, storage/integration-test

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultPrimaryDataStoreLifeCycleImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultPrimaryDataStoreLifeCycleImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultPrimaryDataStoreLifeCycleImpl.java
deleted file mode 100644
index c4c7216..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/lifecycle/DefaultPrimaryDataStoreLifeCycleImpl.java
+++ /dev/null
@@ -1,130 +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.datastore.lifecycle;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Map;
-
-import javax.inject.Inject;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
-import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
-import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreProviderDao;
-import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreVO;
-import org.apache.cloudstack.storage.datastore.provider.PrimaryDataStoreProvider;
-import org.springframework.stereotype.Component;
-
-public class DefaultPrimaryDataStoreLifeCycleImpl implements PrimaryDataStoreLifeCycle {
-    private final PrimaryDataStoreProvider provider;
-    protected PrimaryDataStoreDao dataStoreDao;
-    public DefaultPrimaryDataStoreLifeCycleImpl(PrimaryDataStoreProvider provider, PrimaryDataStoreDao dataStoreDao) {
-        this.provider = provider;
-        this.dataStoreDao = dataStoreDao;
-    }
-    
-    protected class DataStoreUrlParser {
-        private String schema;
-        private String host;
-        private String path;
-        private int port;
-        
-        public DataStoreUrlParser(String url) {
-            try {
-                URI uri = new URI(url);
-                schema = uri.getScheme();
-                host = uri.getHost();
-                path = uri.getPath();
-                port = (uri.getPort() == -1) ? 0 : uri.getPort();
-            } catch (URISyntaxException e) {
-               
-            }
-        }
-        
-        public String getSchema() {
-            return this.schema;
-        }
-        
-        public String getHost() {
-            return this.host;
-        }
-        
-        public String getPath() {
-            return this.path;
-        }
-        
-        public int getPort() {
-            return this.port;
-        }
-    }
-    
-    @Override
-    public PrimaryDataStoreInfo registerDataStore(Map<String, String> dsInfos) {
-        DataStoreUrlParser parser = new DataStoreUrlParser(dsInfos.get("url"));
-        PrimaryDataStoreVO dataStore = new PrimaryDataStoreVO();
-        dataStore.setName(dsInfos.get("name"));
-        dataStore.setPoolType(parser.getSchema());
-        dataStore.setPort(parser.port);
-        dataStore.setDataCenterId(Integer.parseInt(dsInfos.get("dcId")));
-        dataStore.setHostAddress(parser.getHost());
-        dataStore.setPath(parser.getPath());
-        dataStore.setStorageProviderId(this.provider.getId());
-        dataStore.setClusterId(Long.parseLong(dsInfos.get("clusterId")));
-        dataStore = dataStoreDao.persist(dataStore);
-        //TODO: add extension point for each data store
-        return this.provider.getDataStore(dataStore.getId());
-    }
-
-    @Override
-    public boolean attach(long scope) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean dettach(long dataStoreId) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean unmanaged(long dataStoreId) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean maintain(long dataStoreId) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean cancelMaintain(long dataStoreId) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean deleteDataStore(long dataStoreId) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/datastore/lifecycle/PrimaryDataStoreLifeCycle.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/lifecycle/PrimaryDataStoreLifeCycle.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/lifecycle/PrimaryDataStoreLifeCycle.java
deleted file mode 100644
index 570a622..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/lifecycle/PrimaryDataStoreLifeCycle.java
+++ /dev/null
@@ -1,39 +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.datastore.lifecycle;
-
-import java.util.Map;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
-
-public interface PrimaryDataStoreLifeCycle {
-    public PrimaryDataStoreInfo registerDataStore(Map<String, String> dsInfos);
-
-    public boolean attach(long scope);
-
-    public boolean dettach(long dataStoreId);
-
-    public boolean unmanaged(long dataStoreId);
-
-    public boolean maintain(long dataStoreId);
-
-    public boolean cancelMaintain(long dataStoreId);
-
-    public boolean deleteDataStore(long dataStoreId);
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/datastore/manager/DefaultPrimaryDataStoreManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/manager/DefaultPrimaryDataStoreManagerImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/manager/DefaultPrimaryDataStoreManagerImpl.java
deleted file mode 100644
index 91528ba..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/manager/DefaultPrimaryDataStoreManagerImpl.java
+++ /dev/null
@@ -1,56 +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.datastore.manager;
-
-import javax.inject.Inject;
-
-import org.apache.cloudstack.storage.datastore.PrimaryDataStore;
-import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreVO;
-import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
-import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreProviderDao;
-import org.apache.cloudstack.storage.datastore.lifecycle.PrimaryDataStoreLifeCycle;
-import org.apache.cloudstack.storage.datastore.provider.PrimaryDataStoreProvider;
-import org.apache.cloudstack.storage.datastore.provider.PrimaryDataStoreProviderManager;
-import org.springframework.stereotype.Component;
-
-@Component
-public class DefaultPrimaryDataStoreManagerImpl implements PrimaryDataStoreManager {
-    @Inject
-    PrimaryDataStoreProviderDao dataStoreProviderDao;
-    @Inject
-    PrimaryDataStoreProviderManager providerManager;
-    @Inject
-    PrimaryDataStoreDao dataStoreDao;
-
-    @Override
-    public PrimaryDataStore getPrimaryDataStore(long dataStoreId) {
-        PrimaryDataStoreVO dataStoreVO = dataStoreDao.findById(dataStoreId);
-        Long providerId = dataStoreVO.getStorageProviderId();
-        PrimaryDataStoreProvider provider = providerManager.getDataStoreProvider(providerId);
-        PrimaryDataStore dataStore = provider.getDataStore(dataStoreId);
-        return dataStore;
-    }
-
-    @Override
-    public PrimaryDataStoreLifeCycle getPrimaryDataStoreLifeCycle(long dataStoreId) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/datastore/manager/PrimaryDataStoreManager.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/manager/PrimaryDataStoreManager.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/manager/PrimaryDataStoreManager.java
deleted file mode 100644
index 7dd0276..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/manager/PrimaryDataStoreManager.java
+++ /dev/null
@@ -1,28 +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.datastore.manager;
-
-import org.apache.cloudstack.storage.datastore.PrimaryDataStore;
-import org.apache.cloudstack.storage.datastore.lifecycle.PrimaryDataStoreLifeCycle;
-
-public interface PrimaryDataStoreManager {
-    public PrimaryDataStore getPrimaryDataStore(long dataStoreId);
-
-    public PrimaryDataStoreLifeCycle getPrimaryDataStoreLifeCycle(long dataStoreId);
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DefaultPrimaryDatastoreProviderImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DefaultPrimaryDatastoreProviderImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DefaultPrimaryDatastoreProviderImpl.java
deleted file mode 100644
index bd7c878..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DefaultPrimaryDatastoreProviderImpl.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package org.apache.cloudstack.storage.datastore.provider;
-
-import java.util.Map;
-
-import javax.inject.Inject;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
-import org.apache.cloudstack.storage.datastore.DefaultPrimaryDataStoreImpl;
-import org.apache.cloudstack.storage.datastore.PrimaryDataStore;
-import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreProviderVO;
-import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreVO;
-import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
-import org.apache.cloudstack.storage.datastore.driver.DefaultPrimaryDataStoreDriverImpl;
-import org.apache.cloudstack.storage.datastore.driver.PrimaryDataStoreDriver;
-import org.apache.cloudstack.storage.datastore.lifecycle.DefaultPrimaryDataStoreLifeCycleImpl;
-import org.apache.cloudstack.storage.datastore.lifecycle.PrimaryDataStoreLifeCycle;
-import org.springframework.stereotype.Component;
-
-import com.cloud.utils.component.ComponentInject;
-
-@Component
-public class DefaultPrimaryDatastoreProviderImpl implements PrimaryDataStoreProvider {
-    private final String providerName = "default primary data store provider";
-    protected PrimaryDataStoreDriver driver;
-    private PrimaryDataStoreProviderVO provider;
-    private final PrimaryDataStoreDao dataStoreDao;
-    protected PrimaryDataStoreLifeCycle dataStoreLifeCycle;
-
-    @Inject
-    public DefaultPrimaryDatastoreProviderImpl(PrimaryDataStoreDao dataStoreDao) {
-        this.driver = new DefaultPrimaryDataStoreDriverImpl();
-        this.dataStoreDao = dataStoreDao;
-        this.dataStoreLifeCycle = new DefaultPrimaryDataStoreLifeCycleImpl(this, dataStoreDao);
-    }
-
-    @Override
-    public PrimaryDataStore getDataStore(long dataStoreId) {
-        PrimaryDataStoreVO dsv = dataStoreDao.findById(dataStoreId);
-        if (dsv == null) {
-            return null;
-        }
-
-        PrimaryDataStore pds = new DefaultPrimaryDataStoreImpl(driver, dsv, null);
-        pds = ComponentInject.inject(pds);
-        return pds;
-    }
-
-    @Override
-    public PrimaryDataStoreInfo getDataStoreInfo(long dataStoreId) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public PrimaryDataStoreLifeCycle getDataStoreLifeCycle() {
-        return dataStoreLifeCycle;
-    }
-
-    @Override
-    public long getId() {
-        return this.provider.getId();
-    }
-
-    @Override
-    public boolean register(PrimaryDataStoreProviderVO provider, Map<String, Object> params) {
-        this.provider = provider;
-        return true;
-    }
-
-    @Override
-    public boolean init(PrimaryDataStoreProviderVO provider) {
-        this.provider = provider;
-        return true;
-    }
-
-    @Override
-    public String getName() {
-        return providerName;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/PrimaryDataStoreProvider.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/PrimaryDataStoreProvider.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/PrimaryDataStoreProvider.java
deleted file mode 100644
index b4a82a8..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/PrimaryDataStoreProvider.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.apache.cloudstack.storage.datastore.provider;
-
-import java.util.Map;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
-import org.apache.cloudstack.storage.datastore.PrimaryDataStore;
-import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreProviderVO;
-import org.apache.cloudstack.storage.datastore.lifecycle.PrimaryDataStoreLifeCycle;
-
-public interface PrimaryDataStoreProvider {
-    public PrimaryDataStore getDataStore(long dataStoreId);
-    public PrimaryDataStoreLifeCycle getDataStoreLifeCycle();
-    public PrimaryDataStoreInfo getDataStoreInfo(long dataStoreId);
-    public long getId();
-    public String getName();
-    public boolean register(PrimaryDataStoreProviderVO provider, Map<String, Object> params);
-    public boolean init(PrimaryDataStoreProviderVO provider);
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/PrimaryDataStoreProviderManager.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/PrimaryDataStoreProviderManager.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/PrimaryDataStoreProviderManager.java
deleted file mode 100644
index 5ede09c..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/PrimaryDataStoreProviderManager.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.apache.cloudstack.storage.datastore.provider;
-
-import java.util.List;
-
-import com.cloud.utils.component.Manager;
-
-public interface PrimaryDataStoreProviderManager extends Manager {
-    public PrimaryDataStoreProvider getDataStoreProvider(Long providerId);
-    public PrimaryDataStoreProvider getDataStoreProvider(String name);
-    public List<PrimaryDataStoreProvider> getDataStoreProviders();
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/PrimaryDataStoreProviderManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/PrimaryDataStoreProviderManagerImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/PrimaryDataStoreProviderManagerImpl.java
deleted file mode 100644
index c0ad052..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/PrimaryDataStoreProviderManagerImpl.java
+++ /dev/null
@@ -1,103 +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.datastore.provider;
-
-import java.util.List;
-import java.util.Map;
-
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-
-import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreProviderDao;
-import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreProviderVO;
-import org.springframework.stereotype.Component;
-
-@Component
-public class PrimaryDataStoreProviderManagerImpl implements PrimaryDataStoreProviderManager {
-    @Inject
-    List<PrimaryDataStoreProvider> providers;
-    @Inject
-    PrimaryDataStoreProviderDao providerDao;
-    
-    @Override
-    public PrimaryDataStoreProvider getDataStoreProvider(Long providerId) {
-        for (PrimaryDataStoreProvider provider : providers) {
-            if (provider.getId() == providerId) {
-                return provider;
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-        List<PrimaryDataStoreProviderVO> providerVos = providerDao.listAll();
-        for (PrimaryDataStoreProvider provider : providers) {
-            boolean existingProvider = false;
-            for (PrimaryDataStoreProviderVO providerVo : providerVos) {
-                if (providerVo.getName().equalsIgnoreCase(provider.getName())) {
-                    existingProvider = true;
-                    break;
-                }
-            }
-            if (!existingProvider) {
-                PrimaryDataStoreProviderVO dataStoreProvider = new PrimaryDataStoreProviderVO();
-                dataStoreProvider.setName(provider.getName());
-                dataStoreProvider = providerDao.persist(dataStoreProvider);
-                provider.register(dataStoreProvider, params);
-            }
-            PrimaryDataStoreProviderVO providervo = providerDao.findByName(provider.getName());
-            provider.init(providervo);
-        }
-        return true;
-    }
-
-    @Override
-    public boolean start() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean stop() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public String getName() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public PrimaryDataStoreProvider getDataStoreProvider(String name) {
-        for (PrimaryDataStoreProvider provider : providers) {
-            if (provider.getName().equalsIgnoreCase(name)) {
-                return provider;
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public List<PrimaryDataStoreProvider> getDataStoreProviders() {
-        return providers;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/datastore/type/DataStoreType.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/type/DataStoreType.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/type/DataStoreType.java
deleted file mode 100644
index 8f3fe8c..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/type/DataStoreType.java
+++ /dev/null
@@ -1,23 +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.datastore.type;
-
-public interface DataStoreType {
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/datastore/type/ISCSI.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/type/ISCSI.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/type/ISCSI.java
deleted file mode 100644
index 9b80bcc..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/type/ISCSI.java
+++ /dev/null
@@ -1,32 +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.datastore.type;
-
-import org.apache.cloudstack.storage.BaseType;
-import org.springframework.stereotype.Component;
-
-@Component
-public class ISCSI extends BaseType implements DataStoreType {
-    private final String type = "iscsi";
-
-    @Override
-    public String toString() {
-        return type;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/datastore/type/NetworkFileSystem.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/type/NetworkFileSystem.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/type/NetworkFileSystem.java
deleted file mode 100644
index f880154..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/type/NetworkFileSystem.java
+++ /dev/null
@@ -1,32 +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.datastore.type;
-
-import org.apache.cloudstack.storage.BaseType;
-import org.springframework.stereotype.Component;
-
-@Component
-public class NetworkFileSystem extends BaseType implements DataStoreType {
-    private final String type = "nfs";
-
-    @Override
-    public String toString() {
-        return type;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/datastore/type/SharedMount.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/type/SharedMount.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/type/SharedMount.java
deleted file mode 100644
index addf901..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/type/SharedMount.java
+++ /dev/null
@@ -1,30 +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.datastore.type;
-
-import org.apache.cloudstack.storage.BaseType;
-
-public class SharedMount extends BaseType implements DataStoreType {
-    private final String type = "SharedMountPoint";
-
-    @Override
-    public String toString() {
-        return type;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/image/ImageOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/ImageOrchestrator.java b/engine/storage/src/org/apache/cloudstack/storage/image/ImageOrchestrator.java
deleted file mode 100644
index e4141f3..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/ImageOrchestrator.java
+++ /dev/null
@@ -1,29 +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 ImageOrchestrator {
-    void registerTemplate(long templateId);
-
-    void registerSnapshot(long snapshotId);
-
-    void registerVolume(long volumeId);
-
-    void registerIso(long isoId);
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/image/ImageService.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/ImageService.java b/engine/storage/src/org/apache/cloudstack/storage/image/ImageService.java
deleted file mode 100644
index d657715..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/ImageService.java
+++ /dev/null
@@ -1,42 +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;
-
-import org.apache.cloudstack.engine.cloud.entity.api.TemplateEntity;
-import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
-
-public interface ImageService {
-    TemplateEntity registerTemplate(long templateId, long imageStoreId);
-
-    boolean deleteTemplate(long templateId);
-
-    long registerIso(String isoUrl, long accountId);
-
-    boolean deleteIso(long isoId);
-
-    boolean grantTemplateAccess(TemplateInfo template, EndPoint endpointId);
-
-    boolean revokeTemplateAccess(long templateId, long endpointId);
-
-    String grantIsoAccess(long isoId, long endpointId);
-
-    boolean revokeIsoAccess(long isoId, long endpointId);
-
-    TemplateEntity getTemplateEntity(long templateId);
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/image/ImageServiceImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/ImageServiceImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/ImageServiceImpl.java
deleted file mode 100644
index 38f669b..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/ImageServiceImpl.java
+++ /dev/null
@@ -1,91 +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;
-
-import javax.inject.Inject;
-
-import org.apache.cloudstack.engine.cloud.entity.api.TemplateEntity;
-import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
-import org.apache.cloudstack.storage.image.downloader.ImageDownloader;
-import org.apache.cloudstack.storage.image.manager.ImageDataStoreManager;
-import org.apache.cloudstack.storage.image.provider.ImageDataStoreProviderManager;
-import org.apache.cloudstack.storage.image.store.ImageDataStore;
-import org.springframework.stereotype.Component;
-
-@Component
-public class ImageServiceImpl implements ImageService {
-    @Inject
-    ImageDataStoreProviderManager imageStoreProviderMgr;
-
-    @Override
-    public TemplateEntity registerTemplate(long templateId, long imageStoreId) {
-        ImageDataStore ids = imageStoreProviderMgr.getDataStore(imageStoreId);
-        TemplateObject to = ids.registerTemplate(templateId);
-        return new TemplateEntityImpl(to);
-    }
-
-    @Override
-    public boolean deleteTemplate(long templateId) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public long registerIso(String isoUrl, long accountId) {
-        // TODO Auto-generated method stub
-        return 0;
-    }
-
-    @Override
-    public boolean deleteIso(long isoId) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean revokeTemplateAccess(long templateId, long endpointId) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public String grantIsoAccess(long isoId, long endpointId) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public boolean revokeIsoAccess(long isoId, long endpointId) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public TemplateEntity getTemplateEntity(long templateId) {
-        ImageDataStore dataStore = imageStoreProviderMgr.getDataStoreFromTemplateId(templateId);
-        TemplateObject to = dataStore.getTemplate(templateId);
-        return new TemplateEntityImpl(to);
-    }
-
-    @Override
-    public boolean grantTemplateAccess(TemplateInfo template, EndPoint endpointId) {
-        // TODO Auto-generated method stub
-        return true;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/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
deleted file mode 100644
index 5d65a3a..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/TemplateObject.java
+++ /dev/null
@@ -1,61 +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;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.disktype.VolumeDiskType;
-import org.apache.cloudstack.engine.subsystem.api.storage.disktype.VolumeDiskTypeHelper;
-import org.apache.cloudstack.storage.image.db.ImageDataVO;
-import org.apache.cloudstack.storage.image.store.ImageDataStoreInfo;
-
-public class TemplateObject implements TemplateInfo {
-    private ImageDataVO imageVO;
-    private ImageDataStoreInfo dataStore;
-
-    public TemplateObject(ImageDataVO template, ImageDataStoreInfo dataStore) {
-        this.imageVO = template;
-        this.dataStore = dataStore;
-    }
-
-    @Override
-    public ImageDataStoreInfo getImageDataStore() {
-        return this.dataStore;
-    }
-
-    @Override
-    public long getId() {
-        return this.imageVO.getId();
-    }
-
-    @Override
-    public VolumeDiskType getDiskType() {
-        return VolumeDiskTypeHelper.getDiskType(imageVO.getFormat());
-    }
-
-    @Override
-    public String getPath() {
-        //TODO: add installation path if it's downloaded to cache storage already
-        return this.imageVO.getUrl();
-    }
-
-    @Override
-    public String getUuid() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/image/downloader/ImageDownloader.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/downloader/ImageDownloader.java b/engine/storage/src/org/apache/cloudstack/storage/image/downloader/ImageDownloader.java
deleted file mode 100644
index adb247a..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/downloader/ImageDownloader.java
+++ /dev/null
@@ -1,25 +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.downloader;
-
-import org.apache.cloudstack.storage.image.TemplateInfo;
-
-public interface ImageDownloader {
-    public void downloadImage(TemplateInfo template);
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/image/driver/ImageDataStoreDriver.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/driver/ImageDataStoreDriver.java b/engine/storage/src/org/apache/cloudstack/storage/image/driver/ImageDataStoreDriver.java
deleted file mode 100644
index 42e52e5..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/driver/ImageDataStoreDriver.java
+++ /dev/null
@@ -1,31 +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.driver;
-
-import org.apache.cloudstack.storage.image.TemplateInfo;
-
-public interface ImageDataStoreDriver {
-    boolean registerTemplate(TemplateInfo template);
-
-    String grantAccess(long templateId, long endPointId);
-
-    boolean revokeAccess(long templateId, long endPointId);
-
-    boolean deleteTemplate(TemplateInfo template);
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/image/driver/ImageDataStoreDriverImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/driver/ImageDataStoreDriverImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/driver/ImageDataStoreDriverImpl.java
deleted file mode 100644
index e395cf1..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/driver/ImageDataStoreDriverImpl.java
+++ /dev/null
@@ -1,52 +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.driver;
-
-import org.apache.cloudstack.storage.image.TemplateInfo;
-
-public class ImageDataStoreDriverImpl implements ImageDataStoreDriver {
-
-    public ImageDataStoreDriverImpl() {
-    }
-
-    @Override
-    public boolean registerTemplate(TemplateInfo template) {
-        // TODO: check the availability of template
-        return true;
-    }
-
-    @Override
-    public String grantAccess(long templateId, long endPointId) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public boolean revokeAccess(long templateId, long endPointId) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean deleteTemplate(TemplateInfo template) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/image/manager/ImageDataStoreManager.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/manager/ImageDataStoreManager.java b/engine/storage/src/org/apache/cloudstack/storage/image/manager/ImageDataStoreManager.java
deleted file mode 100644
index e1dce50..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/manager/ImageDataStoreManager.java
+++ /dev/null
@@ -1,25 +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.manager;
-
-import org.apache.cloudstack.storage.image.store.ImageDataStore;
-
-public interface ImageDataStoreManager {
-    ImageDataStore getImageDataStore(long dataStoreId);
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/image/manager/ImageDataStoreManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/manager/ImageDataStoreManagerImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/manager/ImageDataStoreManagerImpl.java
deleted file mode 100644
index bf43356..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/manager/ImageDataStoreManagerImpl.java
+++ /dev/null
@@ -1,42 +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.manager;
-
-import javax.inject.Inject;
-
-import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreVO;
-import org.apache.cloudstack.storage.image.db.ImageDataStoreDao;
-import org.apache.cloudstack.storage.image.db.ImageDataDao;
-import org.apache.cloudstack.storage.image.db.ImageDataStoreVO;
-import org.apache.cloudstack.storage.image.store.ImageDataStore;
-
-public class ImageDataStoreManagerImpl implements ImageDataStoreManager {
-    @Inject
-    ImageDataStoreDao dataStoreDao;
-    @Inject
-    ImageDataDao imageDataDao;
-
-    @Override
-    public ImageDataStore getImageDataStore(long dataStoreId) {
-        ImageDataStoreVO dataStore = dataStoreDao.findById(dataStoreId);
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/image/motion/DefaultImageMotionStrategy.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/motion/DefaultImageMotionStrategy.java b/engine/storage/src/org/apache/cloudstack/storage/image/motion/DefaultImageMotionStrategy.java
deleted file mode 100644
index 625cdc9..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/motion/DefaultImageMotionStrategy.java
+++ /dev/null
@@ -1,51 +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.motion;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
-import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
-import org.apache.cloudstack.storage.command.CopyTemplateToPrimaryStorage;
-import org.apache.cloudstack.storage.to.ImageOnPrimayDataStoreTO;
-import org.apache.cloudstack.storage.volume.TemplateOnPrimaryDataStoreInfo;
-import org.springframework.stereotype.Component;
-
-@Component
-public class DefaultImageMotionStrategy implements ImageMotionStrategy {
-
-    @Override
-    public boolean canHandle(TemplateOnPrimaryDataStoreInfo templateStore) {
-        // TODO Auto-generated method stub
-        return true;
-    }
-
-    @Override
-    public EndPoint getEndPoint(TemplateOnPrimaryDataStoreInfo templateStore) {
-        PrimaryDataStoreInfo pdi = templateStore.getPrimaryDataStore();
-        return pdi.getEndPoints().get(0);
-    }
-
-    @Override
-    public boolean copyTemplate(TemplateOnPrimaryDataStoreInfo templateStore, EndPoint ep) {
-        ImageOnPrimayDataStoreTO imageTo = new ImageOnPrimayDataStoreTO(templateStore);
-        CopyTemplateToPrimaryStorage copyCommand = new CopyTemplateToPrimaryStorage(imageTo);
-        ep.sendMessage(copyCommand);
-        return true;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/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
deleted file mode 100644
index 3cf5efc..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/motion/ImageMotionServiceImpl.java
+++ /dev/null
@@ -1,74 +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.motion;
-
-import java.util.List;
-
-import javax.inject.Inject;
-
-import org.apache.cloudstack.engine.cloud.entity.api.TemplateEntity;
-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.storage.datastore.PrimaryDataStore;
-import org.apache.cloudstack.storage.image.ImageService;
-import org.apache.cloudstack.storage.image.TemplateInfo;
-import org.apache.cloudstack.storage.volume.TemplateOnPrimaryDataStoreInfo;
-import org.apache.cloudstack.storage.volume.VolumeService;
-import org.springframework.stereotype.Component;
-
-import com.cloud.utils.exception.CloudRuntimeException;
-
-@Component
-public class ImageMotionServiceImpl implements ImageMotionService {
-    @Inject
-    List<ImageMotionStrategy> motionStrategies;
-    @Inject
-    VolumeService volumeService;
-    @Inject
-    ImageService imageService;
-
-    @Override
-    public boolean copyIso(String isoUri, String destIsoUri) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean copyTemplate(TemplateOnPrimaryDataStoreInfo templateStore) {
-        ImageMotionStrategy ims = null;
-        for (ImageMotionStrategy strategy : motionStrategies) {
-            if (strategy.canHandle(templateStore)) {
-                ims = strategy;
-                break;
-            }
-        }
-
-        if (ims == null) {
-            throw new CloudRuntimeException("Can't find proper image motion strategy");
-        }
-
-        EndPoint ep = ims.getEndPoint(templateStore);
-
-        volumeService.grantAccess(templateStore, ep);
-        TemplateInfo template = templateStore.getTemplate();
-        imageService.grantTemplateAccess(template, ep);
-        return ims.copyTemplate(templateStore, ep);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/image/motion/ImageMotionStrategy.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/motion/ImageMotionStrategy.java b/engine/storage/src/org/apache/cloudstack/storage/image/motion/ImageMotionStrategy.java
deleted file mode 100644
index e1df9e2..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/motion/ImageMotionStrategy.java
+++ /dev/null
@@ -1,30 +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.motion;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
-import org.apache.cloudstack.storage.volume.TemplateOnPrimaryDataStoreInfo;
-
-public interface ImageMotionStrategy {
-    public boolean canHandle(TemplateOnPrimaryDataStoreInfo templateStore);
-
-    public EndPoint getEndPoint(TemplateOnPrimaryDataStoreInfo templateStore);
-
-    public boolean copyTemplate(TemplateOnPrimaryDataStoreInfo templateStore, EndPoint ep);
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/image/provider/DefaultImageDataStoreProvider.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/provider/DefaultImageDataStoreProvider.java b/engine/storage/src/org/apache/cloudstack/storage/image/provider/DefaultImageDataStoreProvider.java
deleted file mode 100644
index 585c54b..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/provider/DefaultImageDataStoreProvider.java
+++ /dev/null
@@ -1,82 +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.provider;
-
-import java.util.Map;
-
-import javax.inject.Inject;
-
-import org.apache.cloudstack.storage.image.db.ImageDataStoreDao;
-import org.apache.cloudstack.storage.image.db.ImageDataStoreProviderDao;
-import org.apache.cloudstack.storage.image.db.ImageDataStoreProviderVO;
-import org.apache.cloudstack.storage.image.db.ImageDataStoreVO;
-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.springframework.stereotype.Component;
-
-import com.cloud.utils.component.ComponentInject;
-
-@Component
-public class DefaultImageDataStoreProvider implements ImageDataStoreProvider {
-    private final String providerName = "DefaultProvider";
-    @Inject
-    ImageDataStoreProviderDao providerDao;
-    @Inject
-    ImageDataStoreDao imageStoreDao;
-    ImageDataStoreProviderVO provider;
-
-    @Override
-    public ImageDataStore getImageDataStore(long imageStoreId) {
-        ImageDataStoreVO idsv = imageStoreDao.findById(imageStoreId);
-        ImageDataStoreDriver driver = new ImageDataStoreDriverImpl();
-        ImageDataStore ids = new ImageDataStoreImpl(idsv, driver, false, null);
-        ids = ComponentInject.inject(ids);
-        return ids;
-    }
-
-    @Override
-    public String getName() {
-        return providerName;
-    }
-
-    @Override
-    public boolean register(long providerId) {
-        return true;
-    }
-
-    @Override
-    public boolean init() {
-        provider = providerDao.findByName(providerName);
-        return true;
-    }
-
-    @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());
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/image/provider/ImageDataStoreProvider.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/provider/ImageDataStoreProvider.java b/engine/storage/src/org/apache/cloudstack/storage/image/provider/ImageDataStoreProvider.java
deleted file mode 100644
index 76ab340..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/provider/ImageDataStoreProvider.java
+++ /dev/null
@@ -1,33 +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.provider;
-
-import org.apache.cloudstack.storage.image.store.ImageDataStore;
-import org.apache.cloudstack.storage.image.store.lifecycle.ImageDataStoreLifeCycle;
-
-public interface ImageDataStoreProvider extends ImageDataStoreLifeCycle {
-    ImageDataStore getImageDataStore(long imageStoreId);
-    boolean register(long providerId);
-    public String getName();
-    /**
-     * @param providerId
-     * @return
-     */
-    boolean init();
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/image/provider/ImageDataStoreProviderManager.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/provider/ImageDataStoreProviderManager.java b/engine/storage/src/org/apache/cloudstack/storage/image/provider/ImageDataStoreProviderManager.java
deleted file mode 100644
index f03a0e1..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/provider/ImageDataStoreProviderManager.java
+++ /dev/null
@@ -1,39 +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.provider;
-
-import java.util.List;
-
-import org.apache.cloudstack.storage.image.TemplateObject;
-import org.apache.cloudstack.storage.image.store.ImageDataStore;
-
-import com.cloud.utils.component.Manager;
-
-public interface ImageDataStoreProviderManager extends Manager {
-    public ImageDataStoreProvider getProvider(long providerId);
-    public List<ImageDataStoreProvider> listProvider();
-    public ImageDataStore getDataStore(Long dataStoreId);
-
-    public ImageDataStore getDataStoreFromTemplateId(long templateId);
-    /**
-     * @param name
-     * @return
-     */
-    ImageDataStoreProvider getProvider(String name);
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/image/provider/ImageDataStoreProviderManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/provider/ImageDataStoreProviderManagerImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/provider/ImageDataStoreProviderManagerImpl.java
deleted file mode 100644
index 32f800c..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/provider/ImageDataStoreProviderManagerImpl.java
+++ /dev/null
@@ -1,135 +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.provider;
-
-import java.util.List;
-import java.util.Map;
-
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-
-import org.apache.cloudstack.storage.image.db.ImageDataDao;
-import org.apache.cloudstack.storage.image.db.ImageDataStoreDao;
-import org.apache.cloudstack.storage.image.db.ImageDataStoreProviderDao;
-import org.apache.cloudstack.storage.image.db.ImageDataStoreProviderVO;
-import org.apache.cloudstack.storage.image.db.ImageDataStoreVO;
-import org.apache.cloudstack.storage.image.db.ImageDataVO;
-import org.apache.cloudstack.storage.image.store.ImageDataStore;
-import org.springframework.stereotype.Component;
-
-@Component
-public class ImageDataStoreProviderManagerImpl implements ImageDataStoreProviderManager {
-    @Inject
-    ImageDataStoreProviderDao providerDao;
-    @Inject
-    ImageDataStoreDao dataStoreDao;
-    @Inject
-    ImageDataDao imageDataDao;
-    @Inject
-    List<ImageDataStoreProvider> providers;
-
-    @Override
-    public ImageDataStoreProvider getProvider(long providerId) {
-
-        return null;
-    }
-
-    @Override
-    public ImageDataStoreProvider getProvider(String name) {
-        for (ImageDataStoreProvider provider : providers) {
-            if (provider.getName().equalsIgnoreCase(name)) {
-                return provider;
-            }
-        }
-        return null;
-    }
-
-    @Override
-    public ImageDataStore getDataStore(Long dataStoreId) {
-        if (dataStoreId == null) {
-            return null;
-        }
-
-        ImageDataStoreVO idsv = dataStoreDao.findById(dataStoreId);
-        if (idsv == null) {
-            return null;
-        }
-        
-        long providerId = idsv.getProvider();
-        ImageDataStoreProviderVO idspv = providerDao.findById(providerId);
-        ImageDataStoreProvider provider = getProvider(idspv.getName());
-        return provider.getImageDataStore(dataStoreId);
-    }
-
-    @Override
-    public ImageDataStore getDataStoreFromTemplateId(long templateId) {
-        ImageDataVO iddv = imageDataDao.findById(templateId);
-        return getDataStore(iddv.getImageDataStoreId());
-    }
-
-    @Override
-    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-        List<ImageDataStoreProviderVO> existingProviders = providerDao.listAll();
-        //TODO: hold global lock
-        boolean foundExistingProvider = false;
-        for (ImageDataStoreProvider provider : providers) {
-            foundExistingProvider = false;
-           for (ImageDataStoreProviderVO existingProvider : existingProviders) {
-               if (provider.getName().equalsIgnoreCase(existingProvider.getName())) {
-                   foundExistingProvider = true;
-                   break;
-               }
-           }
-           
-           if (!foundExistingProvider) {
-               //add a new provider into db
-               ImageDataStoreProviderVO nProvider = new ImageDataStoreProviderVO();
-               nProvider.setName(provider.getName());
-               nProvider = providerDao.persist(nProvider);
-               provider.register(nProvider.getId());
-           }
-           provider.init();
-        }
-       
-        return true;
-    }
-
-    @Override
-    public boolean start() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean stop() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public String getName() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public List<ImageDataStoreProvider> listProvider() {
-        return providers;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/image/store/ImageDataStore.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/store/ImageDataStore.java b/engine/storage/src/org/apache/cloudstack/storage/image/store/ImageDataStore.java
deleted file mode 100644
index 6e97c83..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/store/ImageDataStore.java
+++ /dev/null
@@ -1,39 +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.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);
-
-    String grantAccess(long templateId, long endPointId);
-
-    boolean revokeAccess(long templateId, long endPointId);
-
-    boolean deleteTemplate(long templateId);
-
-    boolean needDownloadToCacheStorage();
-
-    ImageDownloader getImageDownloader();
-    
-    TemplateObject getTemplate(long templateId);
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/image/store/ImageDataStoreImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/store/ImageDataStoreImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/store/ImageDataStoreImpl.java
deleted file mode 100644
index 5ba91f7..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/store/ImageDataStoreImpl.java
+++ /dev/null
@@ -1,104 +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.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) {
-        this.driver = driver;
-        this.needDownloadToCacheStorage = needDownloadToCacheStorage;
-        this.downloader = downloader;
-        this.imageDataStoreVO = dataStoreVO;
-    }
-
-    /*
-     * @Override public TemplateInfo registerTemplate(long templateId) {
-     * ImageDataVO idv = imageDao.findById(templateId); TemplateInfo template =
-     * new TemplateInfo(this, idv); if (driver.registerTemplate(template)) {
-     * template.setImageDataStoreId(imageDataStoreVO.getId()); return template;
-     * } else { return null; } }
-     */
-
-    @Override
-    public String grantAccess(long templateId, long endPointId) {
-        ImageDataVO idv = imageDao.findById(templateId);
-        return idv.getUrl();
-    }
-
-    @Override
-    public boolean revokeAccess(long templateId, long endPointId) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean deleteTemplate(long templateId) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public boolean needDownloadToCacheStorage() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public ImageDownloader getImageDownloader() {
-        return this.downloader;
-    }
-
-    @Override
-    public long getImageDataStoreId() {
-        return imageDataStoreVO.getId();
-    }
-
-    @Override
-    public TemplateObject registerTemplate(long templateId) {
-        ImageDataVO image = imageDao.findById(templateId);
-        image.setImageDataStoreId(this.getImageDataStoreId());
-        imageDao.update(templateId, image);
-        return getTemplate(templateId);
-    }
-
-    @Override
-    public TemplateObject getTemplate(long templateId) {
-        ImageDataVO image = imageDao.findById(templateId);
-        TemplateObject to = new TemplateObject(image, this);
-        return to;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/image/store/lifecycle/ImageDataStoreLifeCycle.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/store/lifecycle/ImageDataStoreLifeCycle.java b/engine/storage/src/org/apache/cloudstack/storage/image/store/lifecycle/ImageDataStoreLifeCycle.java
deleted file mode 100644
index a96983c..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/store/lifecycle/ImageDataStoreLifeCycle.java
+++ /dev/null
@@ -1,27 +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.store.lifecycle;
-
-import java.util.Map;
-
-import org.apache.cloudstack.storage.image.store.ImageDataStore;
-
-public interface ImageDataStoreLifeCycle {
-    public ImageDataStore registerDataStore(String name, Map<String, String> params);
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/volume/TemplateOnPrimaryDataStoreObject.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/volume/TemplateOnPrimaryDataStoreObject.java b/engine/storage/src/org/apache/cloudstack/storage/volume/TemplateOnPrimaryDataStoreObject.java
deleted file mode 100644
index b3326e1..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/volume/TemplateOnPrimaryDataStoreObject.java
+++ /dev/null
@@ -1,67 +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.volume;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
-import org.apache.cloudstack.storage.image.TemplateInfo;
-import org.apache.cloudstack.storage.volume.db.TemplatePrimaryDataStoreDao;
-import org.apache.cloudstack.storage.volume.db.TemplatePrimaryDataStoreVO;
-
-import com.cloud.storage.VMTemplateStorageResourceAssoc.Status;
-
-public class TemplateOnPrimaryDataStoreObject implements TemplateOnPrimaryDataStoreInfo {
-    protected PrimaryDataStoreInfo dataStore;
-    protected TemplateInfo template;
-    protected TemplatePrimaryDataStoreVO vo;
-    TemplatePrimaryDataStoreDao templateStoreDao;
-
-    public TemplateOnPrimaryDataStoreObject(PrimaryDataStoreInfo primaryDataStore, TemplateInfo template, TemplatePrimaryDataStoreVO vo,
-    		TemplatePrimaryDataStoreDao templateStoreDao) {
-        this.dataStore = primaryDataStore;
-        this.template = template;
-        this.vo = vo;
-        this.templateStoreDao = templateStoreDao;
-    }
-
-    @Override
-    public String getPath() {
-        return vo.getInstallPath();
-    }
-
-    @Override
-    public void setPath(String path) {
-        this.vo.setInstallPath(path);
-    }
-
-    @Override
-    public PrimaryDataStoreInfo getPrimaryDataStore() {
-        return this.dataStore;
-    }
-
-    @Override
-    public TemplateInfo getTemplate() {
-        return this.template;
-    }
-
-    public void updateStatus(Status status) {
-        vo.setDownloadState(status);
-        templateStoreDao.update(vo.getId(), vo);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/volume/TemplatePrimaryDataStoreManager.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/volume/TemplatePrimaryDataStoreManager.java b/engine/storage/src/org/apache/cloudstack/storage/volume/TemplatePrimaryDataStoreManager.java
deleted file mode 100644
index eb0b670..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/volume/TemplatePrimaryDataStoreManager.java
+++ /dev/null
@@ -1,28 +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.volume;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
-import org.apache.cloudstack.storage.image.TemplateInfo;
-
-public interface TemplatePrimaryDataStoreManager {
-    public TemplateOnPrimaryDataStoreInfo createTemplateOnPrimaryDataStore(TemplateInfo template, PrimaryDataStoreInfo dataStore);
-
-    public TemplateOnPrimaryDataStoreInfo findTemplateOnPrimaryDataStore(TemplateInfo template, PrimaryDataStoreInfo dataStore);
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/volume/TemplatePrimaryDataStoreManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/volume/TemplatePrimaryDataStoreManagerImpl.java b/engine/storage/src/org/apache/cloudstack/storage/volume/TemplatePrimaryDataStoreManagerImpl.java
deleted file mode 100644
index 19704be..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/volume/TemplatePrimaryDataStoreManagerImpl.java
+++ /dev/null
@@ -1,62 +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.volume;
-
-import javax.inject.Inject;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo;
-import org.apache.cloudstack.storage.image.TemplateInfo;
-import org.apache.cloudstack.storage.volume.db.TemplatePrimaryDataStoreDao;
-import org.apache.cloudstack.storage.volume.db.TemplatePrimaryDataStoreVO;
-import org.springframework.stereotype.Component;
-
-import com.cloud.storage.VMTemplateStorageResourceAssoc;
-import com.cloud.utils.db.SearchCriteria2;
-import com.cloud.utils.db.SearchCriteriaService;
-import com.cloud.utils.db.SearchCriteria.Op;
-
-@Component
-public class TemplatePrimaryDataStoreManagerImpl implements TemplatePrimaryDataStoreManager {
-    @Inject
-    TemplatePrimaryDataStoreDao templateStoreDao;
-
-    @Override
-    public TemplateOnPrimaryDataStoreObject createTemplateOnPrimaryDataStore(TemplateInfo template, PrimaryDataStoreInfo dataStore) {
-
-        TemplatePrimaryDataStoreVO templateStoreVO = new TemplatePrimaryDataStoreVO(dataStore.getId(), template.getId());
-        templateStoreVO = templateStoreDao.persist(templateStoreVO);
-        TemplateOnPrimaryDataStoreObject templateStoreObject = new TemplateOnPrimaryDataStoreObject(dataStore, template, templateStoreVO, templateStoreDao);
-        return templateStoreObject;
-    }
-
-    @Override
-    public TemplateOnPrimaryDataStoreObject findTemplateOnPrimaryDataStore(TemplateInfo template, PrimaryDataStoreInfo dataStore) {
-        SearchCriteriaService<TemplatePrimaryDataStoreVO, TemplatePrimaryDataStoreVO> sc = SearchCriteria2.create(TemplatePrimaryDataStoreVO.class);
-        sc.addAnd(sc.getEntity().getTemplateId(), Op.EQ, template.getId());
-        sc.addAnd(sc.getEntity().getPoolId(), Op.EQ, dataStore.getId());
-        sc.addAnd(sc.getEntity().getDownloadState(), Op.EQ, VMTemplateStorageResourceAssoc.Status.DOWNLOADED);
-        TemplatePrimaryDataStoreVO templateStoreVO = sc.find();
-        if (templateStoreVO == null) {
-        	return null;
-        }
-        
-        TemplateOnPrimaryDataStoreObject templateStoreObject = new TemplateOnPrimaryDataStoreObject(dataStore, template, templateStoreVO, templateStoreDao);
-        return templateStoreObject;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/225ad3c2/engine/storage/src/org/apache/cloudstack/storage/volume/VolumeManager.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/volume/VolumeManager.java b/engine/storage/src/org/apache/cloudstack/storage/volume/VolumeManager.java
deleted file mode 100644
index f27753d..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/volume/VolumeManager.java
+++ /dev/null
@@ -1,45 +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.volume;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.VolumeProfile;
-import org.apache.cloudstack.storage.volume.db.VolumeVO;
-
-import com.cloud.storage.Volume;
-import com.cloud.storage.Volume.Event;
-import com.cloud.storage.Volume.State;
-import com.cloud.utils.fsm.NoTransitionException;
-import com.cloud.utils.fsm.StateMachine2;
-
-public interface VolumeManager {
-    VolumeVO allocateDuplicateVolume(VolumeVO oldVol);
-
-    VolumeVO processEvent(Volume vol, Volume.Event event) throws NoTransitionException;
-
-    VolumeProfile getProfile(long volumeId);
-
-    VolumeVO getVolume(long volumeId);
-
-    VolumeVO updateVolume(VolumeVO volume);
-
-    /**
-     * @return
-     */
-    StateMachine2<State, Event, VolumeVO> getStateMachine();
-}