cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [57/57] [abbrv] git commit: updated refs/heads/object_store to a872d6d
Date Sat, 06 Apr 2013 00:35:30 GMT
Renamed internal classes to use "imageStorexxx" instead of previous
"imageDataStorexxx". Add new addImageStoreCmd to use 3 image store
provider plugins.

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

Branch: refs/heads/object_store
Commit: a872d6d3063fb1775221b98a1d7c0eb3f1691084
Parents: 7699485
Author: Min Chen <min.chen@citrix.com>
Authored: Fri Apr 5 17:33:35 2013 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Fri Apr 5 17:33:35 2013 -0700

----------------------------------------------------------------------
 api/src/com/cloud/resource/ResourceService.java    |    5 +-
 api/src/com/cloud/storage/ImageStore.java          |   55 +
 api/src/com/cloud/storage/ObjectStore.java         |   51 -
 .../apache/cloudstack/api/ResponseGenerator.java   |    2 +-
 .../command/admin/host/AddSecondaryStorageCmd.java |   23 +-
 .../command/admin/storage/AddImageStoreCmd.java    |  120 ++
 .../api/response/ImageStoreDetailResponse.java     |   86 +
 .../api/response/ImageStoreResponse.java           |  162 ++
 .../api/response/ObjectStoreDetailResponse.java    |   86 -
 .../api/response/ObjectStoreResponse.java          |  172 --
 client/tomcatconf/applicationContext.xml.in        |    3 +
 client/tomcatconf/commands.properties.in           |    3 +
 .../subsystem/api/storage/DataStoreLifeCycle.java  |    2 +-
 .../api/storage/ImageDataStoreProvider.java        |   24 -
 .../subsystem/api/storage/ImageStoreProvider.java  |   24 +
 .../datastore/db/ImageDataStoreDetailVO.java       |   81 -
 .../datastore/db/ImageDataStoreDetailsDao.java     |   28 -
 .../manager/ImageDataStoreProviderManagerImpl.java |   94 -
 .../manager/ImageStoreProviderManagerImpl.java     |   94 +
 .../storage/image/store/ImageDataStoreImpl.java    |  174 --
 .../storage/image/store/ImageStoreImpl.java        |  175 ++
 .../store/lifecycle/ImageDataStoreLifeCycle.java   |   24 -
 .../image/store/lifecycle/ImageStoreLifeCycle.java |   24 +
 .../cloudstack/storage/test/DirectAgentTest.java   |    4 +-
 .../storage/datastore/DataStoreManagerImpl.java    |    8 +-
 .../provider/DataStoreProviderManagerImpl.java     |   14 +-
 .../storage/image/ImageDataStoreDriver.java        |   24 -
 .../cloudstack/storage/image/ImageStoreDriver.java |   24 +
 .../storage/image/TemplateEntityImpl.java          |    8 +-
 .../storage/image/datastore/ImageDataStore.java    |   37 -
 .../image/datastore/ImageDataStoreHelper.java      |   61 -
 .../image/datastore/ImageDataStoreInfo.java        |   26 -
 .../datastore/ImageDataStoreProviderManager.java   |   31 -
 .../storage/image/datastore/ImageStoreEntity.java  |   37 +
 .../storage/image/datastore/ImageStoreHelper.java  |   99 +
 .../storage/image/datastore/ImageStoreInfo.java    |   26 +
 .../image/datastore/ImageStoreProviderManager.java |   31 +
 .../storage/image/db/ImageDaoStoreDaoImpl.java     |   38 -
 .../storage/image/db/ImageDataStoreDao.java        |   25 -
 .../image/db/ImageDataStoreProviderDao.java        |   25 -
 .../image/db/ImageDataStoreProviderDaoImpl.java    |   40 -
 .../storage/image/db/ImageDataStoreProviderVO.java |   49 -
 .../storage/image/db/ImageDataStoreVO.java         |  137 --
 .../cloudstack/storage/image/db/ImageStoreDao.java |   25 +
 .../storage/image/db/ImageStoreDaoImpl.java        |   38 +
 .../storage/image/db/ImageStoreDetailVO.java       |   83 +
 .../storage/image/db/ImageStoreDetailsDao.java     |   28 +
 .../storage/image/db/ImageStoreDetailsDaoImpl.java |   73 +
 .../cloudstack/storage/image/db/ImageStoreVO.java  |  163 ++
 .../cloudstack/storage/to/ImageDataStoreTO.java    |   36 -
 .../apache/cloudstack/storage/to/ImageStoreTO.java |   36 +
 .../apache/cloudstack/storage/to/TemplateTO.java   |    8 +-
 plugins/pom.xml                                    |    1 +
 .../driver/CloudStackImageDataStoreDriverImpl.java |  250 ---
 .../driver/CloudStackImageStoreDriverImpl.java     |  250 +++
 .../CloudStackImageDataStoreLifeCycle.java         |  178 --
 .../CloudStackImageStoreLifeCycleImpl.java         |  179 ++
 .../provider/CloudStackImageDataStoreProvider.java |  101 -
 .../provider/CloudStackImageStoreProviderImpl.java |   88 +
 .../datastore/driver/S3ImageStoreDriverImpl.java   |  250 +++
 .../lifecycle/S3ImageStoreLifeCycleImpl.java       |  177 ++
 .../provider/S3ImageStoreProviderImpl.java         |   90 +
 .../driver/SampleImageDataStoreDriverImpl.java     |  126 --
 .../driver/SampleImageStoreDriverImpl.java         |  126 ++
 .../lifecycle/SampleImageDataStoreLifeCycle.java   |  108 --
 .../lifecycle/SampleImageStoreLifeCycleImpl.java   |  108 ++
 .../provider/SampleImageDataStoreProvider.java     |   82 -
 .../provider/SampleImageStoreProviderImpl.java     |   82 +
 plugins/storage/image/swift/pom.xml                |   56 +
 .../driver/SwiftImageStoreDriverImpl.java          |  250 +++
 .../lifecycle/SwiftImageStoreLifeCycleImpl.java    |  161 ++
 .../provider/SwiftImageStoreProviderImpl.java      |   92 +
 server/src/com/cloud/api/ApiDBUtils.java           |   23 +-
 server/src/com/cloud/api/ApiResponseHelper.java    |   12 +-
 .../com/cloud/api/query/ViewResponseHelper.java    |   14 +-
 .../cloud/api/query/dao/ImageDataStoreJoinDao.java |   36 -
 .../api/query/dao/ImageDataStoreJoinDaoImpl.java   |  164 --
 .../com/cloud/api/query/dao/ImageStoreJoinDao.java |   36 +
 .../cloud/api/query/dao/ImageStoreJoinDaoImpl.java |  163 ++
 .../cloud/api/query/vo/ImageDataStoreJoinVO.java   |  201 --
 .../com/cloud/api/query/vo/ImageStoreJoinVO.java   |  193 ++
 .../com/cloud/api/query/vo/StoragePoolJoinVO.java  |    5 +-
 .../com/cloud/resource/ResourceManagerImpl.java    | 1473 ++++++---------
 .../cloud/storage/dao/ImageDataStoreDaoImpl.java   |   75 -
 server/src/com/cloud/storage/s3/S3Manager.java     |    3 +
 server/src/com/cloud/storage/s3/S3ManagerImpl.java |   26 +-
 .../cloud/resource/MockResourceManagerImpl.java    |    4 +-
 setup/db/db/schema-410to420.sql                    |   47 +-
 88 files changed, 4382 insertions(+), 3594 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/api/src/com/cloud/resource/ResourceService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/resource/ResourceService.java b/api/src/com/cloud/resource/ResourceService.java
index dbed36e..d8c09d9 100755
--- a/api/src/com/cloud/resource/ResourceService.java
+++ b/api/src/com/cloud/resource/ResourceService.java
@@ -27,6 +27,7 @@ import org.apache.cloudstack.api.command.admin.host.PrepareForMaintenanceCmd;
 import org.apache.cloudstack.api.command.admin.host.ReconnectHostCmd;
 import org.apache.cloudstack.api.command.admin.host.UpdateHostCmd;
 import org.apache.cloudstack.api.command.admin.host.UpdateHostPasswordCmd;
+import org.apache.cloudstack.api.command.admin.storage.AddImageStoreCmd;
 import org.apache.cloudstack.api.command.admin.storage.AddS3Cmd;
 import org.apache.cloudstack.api.command.admin.storage.ListS3sCmd;
 import org.apache.cloudstack.api.command.admin.swift.AddSwiftCmd;
@@ -38,7 +39,7 @@ import com.cloud.exception.ResourceInUseException;
 import com.cloud.host.Host;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.org.Cluster;
-import com.cloud.storage.ObjectStore;
+import com.cloud.storage.ImageStore;
 import com.cloud.storage.S3;
 import com.cloud.storage.Swift;
 import com.cloud.utils.Pair;
@@ -102,7 +103,7 @@ public interface ResourceService {
 
     S3 discoverS3(AddS3Cmd cmd) throws DiscoveryException;
 
-    ObjectStore discoverObjectStore(AddSecondaryStorageCmd cmd) throws IllegalArgumentException, DiscoveryException, InvalidParameterValueException;
+    ImageStore discoverImageStore(AddImageStoreCmd cmd) throws IllegalArgumentException, DiscoveryException, InvalidParameterValueException;
 
 
     List<HypervisorType> getSupportedHypervisorTypes(long zoneId, boolean forVirtualRouter, Long podId);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/api/src/com/cloud/storage/ImageStore.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/ImageStore.java b/api/src/com/cloud/storage/ImageStore.java
new file mode 100644
index 0000000..54d22d1
--- /dev/null
+++ b/api/src/com/cloud/storage/ImageStore.java
@@ -0,0 +1,55 @@
+// 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 com.cloud.storage;
+
+import org.apache.cloudstack.api.Identity;
+import org.apache.cloudstack.api.InternalIdentity;
+
+public interface ImageStore extends Identity, InternalIdentity {
+
+    public enum State {
+        Disabled, Enabled, Deactivated;
+    }
+
+
+    /**
+     * @return name of the object store.
+     */
+    String getName();
+
+    /**
+     * @return availability zone.
+     */
+    Long getDataCenterId();
+
+    /**
+     * @return image store state.
+     */
+    State getState();
+
+	/**
+	 * @return object store provider name
+	 */
+	String getProviderName();
+
+
+	/**
+	 *
+	 * @return data store protocol
+	 */
+	String getProtocol();
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/api/src/com/cloud/storage/ObjectStore.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/ObjectStore.java b/api/src/com/cloud/storage/ObjectStore.java
deleted file mode 100644
index 636537f..0000000
--- a/api/src/com/cloud/storage/ObjectStore.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 com.cloud.storage;
-
-import org.apache.cloudstack.api.Identity;
-import org.apache.cloudstack.api.InternalIdentity;
-
-public interface ObjectStore extends Identity, InternalIdentity {
-
-    /**
-     * @return name of the object store.
-     */
-    String getName();
-
-    /**
-     * @return availability zone.
-     */
-    Long getDataCenterId();
-
-    /**
-     * @return region id.
-     * @return
-     */
-    Long getRegionId();
-
-	/**
-	 * @return object store provider name
-	 */
-	String getProviderName();
-
-
-	/**
-	 *
-	 * @return data store protocol
-	 */
-	String getProtocol();
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/api/src/org/apache/cloudstack/api/ResponseGenerator.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/ResponseGenerator.java b/api/src/org/apache/cloudstack/api/ResponseGenerator.java
index b85f2c5..3d381b0 100644
--- a/api/src/org/apache/cloudstack/api/ResponseGenerator.java
+++ b/api/src/org/apache/cloudstack/api/ResponseGenerator.java
@@ -326,7 +326,7 @@ public interface ResponseGenerator {
 
     RegionResponse createRegionResponse(Region region);
 
-    ObjectStoreResponse createObjectStoreResponse(ObjectStore os);
+    ImageStoreResponse createImageStoreResponse(ImageStore os);
 
     /**
      * @param resourceTag

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/api/src/org/apache/cloudstack/api/command/admin/host/AddSecondaryStorageCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/host/AddSecondaryStorageCmd.java b/api/src/org/apache/cloudstack/api/command/admin/host/AddSecondaryStorageCmd.java
index 663750e..94aaa5f 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/host/AddSecondaryStorageCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/host/AddSecondaryStorageCmd.java
@@ -25,16 +25,13 @@ import org.apache.cloudstack.api.ApiErrorCode;
 import org.apache.cloudstack.api.BaseCmd;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.ServerApiException;
-import org.apache.cloudstack.api.BaseCmd.CommandType;
 import org.apache.cloudstack.api.response.HostResponse;
-import org.apache.cloudstack.api.response.ObjectStoreResponse;
 import org.apache.cloudstack.api.response.RegionResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
 import org.apache.log4j.Logger;
 
 import com.cloud.exception.DiscoveryException;
 import com.cloud.host.Host;
-import com.cloud.storage.ObjectStore;
 import com.cloud.user.Account;
 
 @APICommand(name = "addSecondaryStorage", description="Adds secondary storage.", responseObject=HostResponse.class)
@@ -113,14 +110,17 @@ public class AddSecondaryStorageCmd extends BaseCmd {
 
     @Override
     public void execute(){
-        try{
-            ObjectStore result = _resourceService.discoverObjectStore(this);
-            ObjectStoreResponse storeResponse = null;
-            if (result != null ) {
-                    storeResponse = _responseGenerator.createObjectStoreResponse(result);
-                    storeResponse.setResponseName(getCommandName());
-                    storeResponse.setObjectName("secondarystorage");
-                    this.setResponseObject(storeResponse);
+        try {
+            List<? extends Host> result = _resourceService.discoverHosts(this);
+            HostResponse hostResponse = null;
+            if (result != null && result.size() > 0) {
+                for (Host host : result) {
+                    // There should only be one secondary storage host per add
+                    hostResponse = _responseGenerator.createHostResponse(host);
+                    hostResponse.setResponseName(getCommandName());
+                    hostResponse.setObjectName("secondarystorage");
+                    this.setResponseObject(hostResponse);
+                }
             } else {
                 throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to add secondary storage");
             }
@@ -128,5 +128,6 @@ public class AddSecondaryStorageCmd extends BaseCmd {
             s_logger.warn("Exception: ", ex);
             throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, ex.getMessage());
         }
+
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/api/src/org/apache/cloudstack/api/command/admin/storage/AddImageStoreCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/AddImageStoreCmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/AddImageStoreCmd.java
new file mode 100644
index 0000000..40ae6b2
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/AddImageStoreCmd.java
@@ -0,0 +1,120 @@
+// 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.api.command.admin.storage;
+
+import java.util.Map;
+
+import org.apache.cloudstack.api.APICommand;
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.ApiErrorCode;
+import org.apache.cloudstack.api.BaseCmd;
+import org.apache.cloudstack.api.Parameter;
+import org.apache.cloudstack.api.ServerApiException;
+import org.apache.cloudstack.api.response.ImageStoreResponse;
+import org.apache.cloudstack.api.response.ZoneResponse;
+import org.apache.log4j.Logger;
+
+import com.cloud.exception.DiscoveryException;
+import com.cloud.storage.ImageStore;
+import com.cloud.user.Account;
+
+@APICommand(name = "addImageStore", description="Adds backup image store.", responseObject=ImageStoreResponse.class)
+public class AddImageStoreCmd extends BaseCmd {
+    public static final Logger s_logger = Logger.getLogger(AddImageStoreCmd.class.getName());
+    private static final String s_name = "addimagestoreresponse";
+
+    /////////////////////////////////////////////////////
+    //////////////// API parameters /////////////////////
+    /////////////////////////////////////////////////////
+
+    @Parameter(name=ApiConstants.URL, type=CommandType.STRING, required=true, description="the URL for the image store")
+    private String url;
+
+    @Parameter(name=ApiConstants.ZONE_ID, type=CommandType.UUID, entityType=ZoneResponse.class,
+            description="the Zone ID for the image store")
+    private Long zoneId;
+
+
+    @Parameter(name=ApiConstants.DETAILS, type=CommandType.MAP, description="the details for the image store")
+    private Map<String, String> details;
+
+    @Parameter(name=ApiConstants.SCOPE, type=CommandType.STRING,
+            required=false, description="the scope of the image store: zone or region")
+    private String scope;
+
+    @Parameter(name=ApiConstants.PROVIDER, type=CommandType.STRING,
+            required=false, description="the image store provider name")
+    private String providerName;
+
+    /////////////////////////////////////////////////////
+    /////////////////// Accessors ///////////////////////
+    /////////////////////////////////////////////////////
+
+    public String getUrl() {
+        return url;
+    }
+
+    public Long getZoneId() {
+        return zoneId;
+    }
+
+     public Map<String, String> getDetails() {
+        return details;
+    }
+
+    public String getScope() {
+        return this.scope;
+     }
+
+    public String getProviderName() {
+        return this.providerName;
+    }
+
+
+    /////////////////////////////////////////////////////
+    /////////////// API Implementation///////////////////
+    /////////////////////////////////////////////////////
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+
+    @Override
+    public long getEntityOwnerId() {
+        return Account.ACCOUNT_ID_SYSTEM;
+    }
+
+    @Override
+    public void execute(){
+        try{
+            ImageStore result = _resourceService.discoverImageStore(this);
+            ImageStoreResponse storeResponse = null;
+            if (result != null ) {
+                    storeResponse = _responseGenerator.createImageStoreResponse(result);
+                    storeResponse.setResponseName(getCommandName());
+                    storeResponse.setObjectName("secondarystorage");
+                    this.setResponseObject(storeResponse);
+            } else {
+                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to add secondary storage");
+            }
+        } catch (DiscoveryException ex) {
+            s_logger.warn("Exception: ", ex);
+            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, ex.getMessage());
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/api/src/org/apache/cloudstack/api/response/ImageStoreDetailResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ImageStoreDetailResponse.java b/api/src/org/apache/cloudstack/api/response/ImageStoreDetailResponse.java
new file mode 100644
index 0000000..6f90f0f
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/response/ImageStoreDetailResponse.java
@@ -0,0 +1,86 @@
+// 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.api.response;
+
+import org.apache.cloudstack.api.BaseResponse;
+
+import com.cloud.serializer.Param;
+import com.google.gson.annotations.SerializedName;
+
+public class ImageStoreDetailResponse extends BaseResponse {
+    @SerializedName("name") @Param(description="detail property name of the image store")
+    private String name;
+
+    @SerializedName("value") @Param(description="detail property value of the image store")
+    private String value;
+
+    public ImageStoreDetailResponse(){
+        super();
+    }
+
+    public ImageStoreDetailResponse(String name, String val){
+        super();
+        this.name = name;
+        this.value = val;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        String oid = this.getName();
+        result = prime * result + ((oid== null) ? 0 : oid.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        ImageStoreDetailResponse other = (ImageStoreDetailResponse) obj;
+        String oid = this.getName();
+        if (oid == null) {
+            if (other.getName() != null)
+                return false;
+        } else if (!oid.equals(other.getName()))
+            return false;
+        else if ( this.getValue().equals(other.getValue()))
+            return false;
+        return true;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/api/src/org/apache/cloudstack/api/response/ImageStoreResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ImageStoreResponse.java b/api/src/org/apache/cloudstack/api/response/ImageStoreResponse.java
new file mode 100644
index 0000000..21dc635
--- /dev/null
+++ b/api/src/org/apache/cloudstack/api/response/ImageStoreResponse.java
@@ -0,0 +1,162 @@
+// 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.api.response;
+
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import org.apache.cloudstack.api.ApiConstants;
+import org.apache.cloudstack.api.BaseResponse;
+import org.apache.cloudstack.api.EntityReference;
+
+import com.cloud.serializer.Param;
+import com.cloud.storage.ImageStore;
+import com.cloud.storage.ScopeType;
+import com.google.gson.annotations.SerializedName;
+
+@EntityReference(value=ImageStore.class)
+public class ImageStoreResponse extends BaseResponse {
+    @SerializedName("id") @Param(description="the ID of the image store")
+    private String id;
+
+    @SerializedName("zoneid") @Param(description="the Zone ID of the image store")
+    private String zoneId;
+
+    @SerializedName(ApiConstants.ZONE_NAME) @Param(description="the Zone name of the image store")
+    private String zoneName;
+
+    @SerializedName("state") @Param(description="the state of the image store")
+    private ImageStore.State state;
+
+
+    @SerializedName("name") @Param(description="the name of the image store")
+    private String name;
+
+    @SerializedName("url") @Param(description="the url of the image store")
+    private String url;
+
+    @SerializedName("protocol") @Param(description="the protocol of the image store")
+    private String protocol;
+
+    @SerializedName("providername") @Param(description="the provider name of the image store")
+    private String providerName;
+
+    @SerializedName("scope") @Param(description="the scope of the image store")
+    private ScopeType scope;
+
+    @SerializedName("details") @Param(description="the details of the image store")
+    private Set<ImageStoreDetailResponse> details;
+
+
+    public ImageStoreResponse(){
+        this.details = new LinkedHashSet<ImageStoreDetailResponse>();
+    }
+
+    @Override
+    public String getObjectId() {
+        return this.getId();
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getZoneId() {
+        return zoneId;
+    }
+
+    public void setZoneId(String zoneId) {
+        this.zoneId = zoneId;
+    }
+
+    public String getZoneName() {
+        return zoneName;
+    }
+
+    public void setZoneName(String zoneName) {
+        this.zoneName = zoneName;
+    }
+
+
+    public ImageStore.State getState() {
+        return state;
+    }
+
+    public void setState(ImageStore.State state) {
+        this.state = state;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public String getProviderName() {
+        return providerName;
+    }
+
+    public void setProviderName(String providerName) {
+        this.providerName = providerName;
+    }
+
+    public ScopeType getScope() {
+        return scope;
+    }
+
+    public void setScope(ScopeType type) {
+        this.scope = type;
+    }
+
+
+    public String getProtocol() {
+        return protocol;
+    }
+
+    public void setProtocol(String protocol) {
+        this.protocol = protocol;
+    }
+
+    public Set<ImageStoreDetailResponse> getDetails() {
+        return details;
+    }
+
+    public void setDetails(Set<ImageStoreDetailResponse> details) {
+        this.details = details;
+    }
+
+    public void addDetail(ImageStoreDetailResponse detail){
+        this.details.add(detail);
+    }
+
+
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/api/src/org/apache/cloudstack/api/response/ObjectStoreDetailResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ObjectStoreDetailResponse.java b/api/src/org/apache/cloudstack/api/response/ObjectStoreDetailResponse.java
deleted file mode 100644
index 74a42f2..0000000
--- a/api/src/org/apache/cloudstack/api/response/ObjectStoreDetailResponse.java
+++ /dev/null
@@ -1,86 +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.api.response;
-
-import org.apache.cloudstack.api.BaseResponse;
-
-import com.cloud.serializer.Param;
-import com.google.gson.annotations.SerializedName;
-
-public class ObjectStoreDetailResponse extends BaseResponse {
-    @SerializedName("name") @Param(description="detail property name of the object store")
-    private String name;
-
-    @SerializedName("value") @Param(description="detail property value of the object store")
-    private String value;
-
-    public ObjectStoreDetailResponse(){
-        super();
-    }
-
-    public ObjectStoreDetailResponse(String name, String val){
-        super();
-        this.name = name;
-        this.value = val;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        String oid = this.getName();
-        result = prime * result + ((oid== null) ? 0 : oid.hashCode());
-        return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj)
-            return true;
-        if (obj == null)
-            return false;
-        if (getClass() != obj.getClass())
-            return false;
-        ObjectStoreDetailResponse other = (ObjectStoreDetailResponse) obj;
-        String oid = this.getName();
-        if (oid == null) {
-            if (other.getName() != null)
-                return false;
-        } else if (!oid.equals(other.getName()))
-            return false;
-        else if ( this.getValue().equals(other.getValue()))
-            return false;
-        return true;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/api/src/org/apache/cloudstack/api/response/ObjectStoreResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ObjectStoreResponse.java b/api/src/org/apache/cloudstack/api/response/ObjectStoreResponse.java
deleted file mode 100644
index 595ae97..0000000
--- a/api/src/org/apache/cloudstack/api/response/ObjectStoreResponse.java
+++ /dev/null
@@ -1,172 +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.api.response;
-
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-import org.apache.cloudstack.api.ApiConstants;
-import org.apache.cloudstack.api.BaseResponse;
-import org.apache.cloudstack.api.EntityReference;
-
-import com.cloud.serializer.Param;
-import com.cloud.storage.ObjectStore;
-import com.cloud.storage.ScopeType;
-import com.google.gson.annotations.SerializedName;
-
-@EntityReference(value=ObjectStore.class)
-public class ObjectStoreResponse extends BaseResponse {
-    @SerializedName("id") @Param(description="the ID of the object store")
-    private String id;
-
-    @SerializedName("zoneid") @Param(description="the Zone ID of the object store")
-    private String zoneId;
-
-    @SerializedName(ApiConstants.ZONE_NAME) @Param(description="the Zone name of the object store")
-    private String zoneName;
-
-    @SerializedName("regionid") @Param(description="the Region ID of the object store")
-    private Long regionId;
-
-    @SerializedName("regionname") @Param(description="the Region name of the object store")
-    private String regionName;
-
-    @SerializedName("name") @Param(description="the name of the object store")
-    private String name;
-
-    @SerializedName("url") @Param(description="the url of the object store")
-    private String url;
-
-    @SerializedName("protocol") @Param(description="the protocol of the object store")
-    private String protocol;
-
-    @SerializedName("providername") @Param(description="the provider name of the object store")
-    private String providerName;
-
-    @SerializedName("scope") @Param(description="the scope of the object store")
-    private ScopeType scope;
-
-    @SerializedName("details") @Param(description="the details of the object store")
-    private Set<ObjectStoreDetailResponse> details;
-
-
-    public ObjectStoreResponse(){
-        this.details = new LinkedHashSet<ObjectStoreDetailResponse>();
-    }
-
-    @Override
-    public String getObjectId() {
-        return this.getId();
-    }
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public String getZoneId() {
-        return zoneId;
-    }
-
-    public void setZoneId(String zoneId) {
-        this.zoneId = zoneId;
-    }
-
-    public String getZoneName() {
-        return zoneName;
-    }
-
-    public void setZoneName(String zoneName) {
-        this.zoneName = zoneName;
-    }
-
-
-    public Long getRegionId() {
-        return regionId;
-    }
-
-    public void setRegionId(Long regionId) {
-        this.regionId = regionId;
-    }
-
-    public String getRegionName() {
-        return regionName;
-    }
-
-    public void setRegionName(String regionName) {
-        this.regionName = regionName;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getUrl() {
-        return url;
-    }
-
-    public void setUrl(String url) {
-        this.url = url;
-    }
-
-    public String getProviderName() {
-        return providerName;
-    }
-
-    public void setProviderName(String providerName) {
-        this.providerName = providerName;
-    }
-
-    public ScopeType getScope() {
-        return scope;
-    }
-
-    public void setScope(ScopeType type) {
-        this.scope = type;
-    }
-
-
-    public String getProtocol() {
-        return protocol;
-    }
-
-    public void setProtocol(String protocol) {
-        this.protocol = protocol;
-    }
-
-    public Set<ObjectStoreDetailResponse> getDetails() {
-        return details;
-    }
-
-    public void setDetails(Set<ObjectStoreDetailResponse> details) {
-        this.details = details;
-    }
-
-    public void addDetail(ObjectStoreDetailResponse detail){
-        this.details.add(detail);
-    }
-
-
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/client/tomcatconf/applicationContext.xml.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in
index 7b752f0..7bf45a2 100644
--- a/client/tomcatconf/applicationContext.xml.in
+++ b/client/tomcatconf/applicationContext.xml.in
@@ -786,6 +786,9 @@
   <bean id="vMSnapshotManagerImpl" class="com.cloud.vm.snapshot.VMSnapshotManagerImpl" />
   <bean id="volumeManagerImpl" class="com.cloud.storage.VolumeManagerImpl" />
   <bean id="ClassicalPrimaryDataStoreProvider" class="org.apache.cloudstack.storage.datastore.provider.CloudStackPrimaryDataStoreProviderImpl" />
+  <bean id="cloudStackImageStoreProviderImpl" class="org.apache.cloudstack.storage.datastore.provider.CloudStackImageStoreProviderImpl" />
+  <bean id="s3ImageStoreProviderImpl" class="org.apache.cloudstack.storage.datastore.provider.S3ImageStoreProviderImpl" />
+  <bean id="swiftImageStoreProviderImpl" class="org.apache.cloudstack.storage.datastore.provider.SwiftImageStoreProviderImpl" />  
 
 
 <!--=======================================================================================================-->

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in
index 163c2ce..ad17c15 100644
--- a/client/tomcatconf/commands.properties.in
+++ b/client/tomcatconf/commands.properties.in
@@ -241,6 +241,9 @@ listSwifts=1
 addS3=1
 listS3s=1
 
+#### image store commands
+addImageStore=1
+
 #### host commands
 addHost=3
 addCluster=1

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreLifeCycle.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreLifeCycle.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreLifeCycle.java
index 280e02e..2440bfd 100644
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreLifeCycle.java
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/DataStoreLifeCycle.java
@@ -29,7 +29,7 @@ public interface DataStoreLifeCycle {
     public boolean attachCluster(DataStore store, ClusterScope scope);
     public boolean attachHost(DataStore store, HostScope scope, StoragePoolInfo existingInfo);
     boolean attachZone(DataStore dataStore, ZoneScope scope);
-    
+
     public boolean dettach();
 
     public boolean unmanaged();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ImageDataStoreProvider.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ImageDataStoreProvider.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ImageDataStoreProvider.java
deleted file mode 100644
index 1fb987e..0000000
--- a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ImageDataStoreProvider.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cloudstack.engine.subsystem.api.storage;
-
-
-public interface ImageDataStoreProvider extends DataStoreProvider {
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ImageStoreProvider.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ImageStoreProvider.java b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ImageStoreProvider.java
new file mode 100644
index 0000000..9a1f69f
--- /dev/null
+++ b/engine/api/src/org/apache/cloudstack/engine/subsystem/api/storage/ImageStoreProvider.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.engine.subsystem.api.storage;
+
+
+public interface ImageStoreProvider extends DataStoreProvider {
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageDataStoreDetailVO.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageDataStoreDetailVO.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageDataStoreDetailVO.java
deleted file mode 100644
index c980cf1..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageDataStoreDetailVO.java
+++ /dev/null
@@ -1,81 +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.db;
-
-import org.apache.cloudstack.api.InternalIdentity;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-
-@Entity
-@Table(name="image_data_store_details")
-public class ImageDataStoreDetailVO implements InternalIdentity {
-    @Id
-    @GeneratedValue(strategy=GenerationType.IDENTITY)
-    @Column(name="id")
-    long id;
-
-    @Column(name="store_id")
-    long storeId;
-
-    @Column(name="name")
-    String name;
-
-    @Column(name="value")
-    String value;
-
-    public ImageDataStoreDetailVO(long storeId, String name, String value) {
-        this.storeId = storeId;
-        this.name = name;
-        this.value = value;
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public long getStoreId() {
-        return storeId;
-    }
-
-    public void setStoreId(long storeId) {
-        this.storeId = storeId;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    public void setValue(String value) {
-        this.value = value;
-    }
-
-    protected ImageDataStoreDetailVO() {
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageDataStoreDetailsDao.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageDataStoreDetailsDao.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageDataStoreDetailsDao.java
deleted file mode 100644
index 781efcf..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageDataStoreDetailsDao.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.db;
-
-import java.util.Map;
-
-
-import com.cloud.utils.db.GenericDao;
-
-public interface ImageDataStoreDetailsDao extends GenericDao<ImageDataStoreDetailVO, Long> {
-
-    void update(long storeId, Map<String, String> details);
-    Map<String, String> getDetails(long storeId);
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/engine/storage/image/src/org/apache/cloudstack/storage/image/manager/ImageDataStoreProviderManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/manager/ImageDataStoreProviderManagerImpl.java b/engine/storage/image/src/org/apache/cloudstack/storage/image/manager/ImageDataStoreProviderManagerImpl.java
deleted file mode 100644
index 4430267..0000000
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/manager/ImageDataStoreProviderManagerImpl.java
+++ /dev/null
@@ -1,94 +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 java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.annotation.PostConstruct;
-import javax.inject.Inject;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProviderManager;
-import org.apache.cloudstack.engine.subsystem.api.storage.ImageDataStoreProvider;
-import org.apache.cloudstack.storage.image.ImageDataStoreDriver;
-import org.apache.cloudstack.storage.image.datastore.ImageDataStore;
-import org.apache.cloudstack.storage.image.datastore.ImageDataStoreProviderManager;
-import org.apache.cloudstack.storage.image.db.ImageDataStoreDao;
-import org.apache.cloudstack.storage.image.db.ImageDataStoreVO;
-import org.apache.cloudstack.storage.image.store.ImageDataStoreImpl;
-import org.springframework.stereotype.Component;
-
-import com.cloud.storage.dao.VMTemplateDao;
-
-@Component
-public class ImageDataStoreProviderManagerImpl implements ImageDataStoreProviderManager {
-    @Inject
-    ImageDataStoreDao dataStoreDao;
-    @Inject
-    VMTemplateDao imageDataDao;
-    @Inject
-    DataStoreProviderManager providerManager;
-    Map<String, ImageDataStoreDriver> driverMaps;
-
-    @PostConstruct
-    public void config() {
-        driverMaps = new HashMap<String, ImageDataStoreDriver>();
-    }
-    
-    @Override
-    public ImageDataStore getImageDataStore(long dataStoreId) {
-        ImageDataStoreVO dataStore = dataStoreDao.findById(dataStoreId);
-        String providerName = dataStore.getProviderName();
-        ImageDataStoreProvider provider = (ImageDataStoreProvider)providerManager.getDataStoreProvider(providerName);
-        ImageDataStore imgStore = ImageDataStoreImpl.getDataStore(dataStore, 
-                driverMaps.get(provider.getName()), provider
-                );
-        // TODO Auto-generated method stub
-        return imgStore;
-    }
-
-    @Override
-    public boolean registerDriver(String providerName, ImageDataStoreDriver driver) {
-        if (driverMaps.containsKey(providerName)) {
-            return false;
-        }
-        driverMaps.put(providerName, driver);
-        return true;
-    }
-
-    @Override
-    public ImageDataStore getImageDataStore(String uuid) {
-        ImageDataStoreVO dataStore = dataStoreDao.findByUuid(uuid);
-        return getImageDataStore(dataStore.getId());
-    }
-
-    @Override
-    public List<DataStore> getList() {
-        List<ImageDataStoreVO> stores = dataStoreDao.listAll();
-        List<DataStore> imageStores = new ArrayList<DataStore>();
-        for (ImageDataStoreVO store : stores) {
-            imageStores.add(getImageDataStore(store.getId()));
-        }
-        return imageStores;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/engine/storage/image/src/org/apache/cloudstack/storage/image/manager/ImageStoreProviderManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/manager/ImageStoreProviderManagerImpl.java b/engine/storage/image/src/org/apache/cloudstack/storage/image/manager/ImageStoreProviderManagerImpl.java
new file mode 100644
index 0000000..7ea68dc
--- /dev/null
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/manager/ImageStoreProviderManagerImpl.java
@@ -0,0 +1,94 @@
+/*
+ * 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 java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
+import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
+import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProviderManager;
+import org.apache.cloudstack.engine.subsystem.api.storage.ImageStoreProvider;
+import org.apache.cloudstack.storage.image.ImageStoreDriver;
+import org.apache.cloudstack.storage.image.datastore.ImageStoreEntity;
+import org.apache.cloudstack.storage.image.datastore.ImageStoreProviderManager;
+import org.apache.cloudstack.storage.image.db.ImageStoreDao;
+import org.apache.cloudstack.storage.image.db.ImageStoreVO;
+import org.apache.cloudstack.storage.image.store.ImageStoreImpl;
+import org.springframework.stereotype.Component;
+
+import com.cloud.storage.dao.VMTemplateDao;
+
+@Component
+public class ImageStoreProviderManagerImpl implements ImageStoreProviderManager {
+    @Inject
+    ImageStoreDao dataStoreDao;
+    @Inject
+    VMTemplateDao imageDataDao;
+    @Inject
+    DataStoreProviderManager providerManager;
+    Map<String, ImageStoreDriver> driverMaps;
+
+    @PostConstruct
+    public void config() {
+        driverMaps = new HashMap<String, ImageStoreDriver>();
+    }
+    
+    @Override
+    public ImageStoreEntity getImageStore(long dataStoreId) {
+        ImageStoreVO dataStore = dataStoreDao.findById(dataStoreId);
+        String providerName = dataStore.getProviderName();
+        ImageStoreProvider provider = (ImageStoreProvider)providerManager.getDataStoreProvider(providerName);
+        ImageStoreEntity imgStore = ImageStoreImpl.getDataStore(dataStore, 
+                driverMaps.get(provider.getName()), provider
+                );
+        // TODO Auto-generated method stub
+        return imgStore;
+    }
+
+    @Override
+    public boolean registerDriver(String providerName, ImageStoreDriver driver) {
+        if (driverMaps.containsKey(providerName)) {
+            return false;
+        }
+        driverMaps.put(providerName, driver);
+        return true;
+    }
+
+    @Override
+    public ImageStoreEntity getImageStore(String uuid) {
+        ImageStoreVO dataStore = dataStoreDao.findByUuid(uuid);
+        return getImageStore(dataStore.getId());
+    }
+
+    @Override
+    public List<DataStore> getList() {
+        List<ImageStoreVO> stores = dataStoreDao.listAll();
+        List<DataStore> imageStores = new ArrayList<DataStore>();
+        for (ImageStoreVO store : stores) {
+            imageStores.add(getImageStore(store.getId()));
+        }
+        return imageStores;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/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
deleted file mode 100644
index 4a6016c..0000000
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageDataStoreImpl.java
+++ /dev/null
@@ -1,174 +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 java.util.Set;
-
-import javax.inject.Inject;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole;
-import org.apache.cloudstack.engine.subsystem.api.storage.ImageDataStoreProvider;
-import org.apache.cloudstack.engine.subsystem.api.storage.Scope;
-import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo;
-import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
-import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
-import org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope;
-import org.apache.cloudstack.storage.datastore.ObjectInDataStoreManager;
-import org.apache.cloudstack.storage.image.ImageDataStoreDriver;
-import org.apache.cloudstack.storage.image.datastore.ImageDataStore;
-import org.apache.cloudstack.storage.image.db.ImageDataStoreVO;
-
-import com.cloud.storage.dao.VMTemplateDao;
-import com.cloud.utils.component.ComponentContext;
-import com.cloud.utils.storage.encoding.EncodingType;
-
-
-public class ImageDataStoreImpl implements ImageDataStore {
-    @Inject
-    VMTemplateDao imageDao;
-    @Inject
-    private ObjectInDataStoreManager objectInStoreMgr;
-    protected ImageDataStoreDriver driver;
-    protected ImageDataStoreVO imageDataStoreVO;
-    protected ImageDataStoreProvider provider;
-    boolean needDownloadToCacheStorage = false;
-
-    public ImageDataStoreImpl() {
-
-    }
-
-    protected void configure(ImageDataStoreVO dataStoreVO, ImageDataStoreDriver imageDataStoreDriver,
-            ImageDataStoreProvider provider) {
-        this.driver = imageDataStoreDriver;
-        this.imageDataStoreVO = dataStoreVO;
-        this.provider = provider;
-    }
-
-    public static ImageDataStore getDataStore(ImageDataStoreVO dataStoreVO, ImageDataStoreDriver imageDataStoreDriver,
-            ImageDataStoreProvider provider) {
-        ImageDataStoreImpl instance = (ImageDataStoreImpl)ComponentContext.inject(ImageDataStoreImpl.class);
-        instance.configure(dataStoreVO, imageDataStoreDriver, provider);
-        return instance;
-    }
-
-    @Override
-    public Set<TemplateInfo> listTemplates() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public DataStoreDriver getDriver() {
-        // TODO Auto-generated method stub
-        return this.driver;
-    }
-
-    @Override
-    public DataStoreRole getRole() {
-        // TODO Auto-generated method stub
-        return DataStoreRole.Image;
-    }
-    @Override
-    public long getId() {
-        // TODO Auto-generated method stub
-        return this.imageDataStoreVO.getId();
-    }
-
-    @Override
-    public String getUri() {
-        return this.imageDataStoreVO.getProtocol() + "://" + "?" + EncodingType.ROLE + "=" + this.getRole();
-    }
-
-    @Override
-    public Scope getScope() {
-        return new ZoneScope(imageDataStoreVO.getDataCenterId());
-    }
-
-    @Override
-    public TemplateInfo getTemplate(long templateId) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public VolumeInfo getVolume(long volumeId) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public SnapshotInfo getSnapshot(long snapshotId) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public boolean exists(DataObject object) {
-        return (objectInStoreMgr.findObject(object,
-                this) != null) ? true : false;
-    }
-
-    @Override
-    public String getUuid() {
-        return this.imageDataStoreVO.getUuid();
-    }
-
-    @Override
-    public DataObject create(DataObject obj) {
-        DataObject object = objectInStoreMgr.create(obj, this);
-        return object;
-    }
-
-    @Override
-    public boolean delete(DataObject obj) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    @Override
-    public String getName() {
-        return imageDataStoreVO.getName();
-    }
-
-    @Override
-    public Long getDataCenterId() {
-        return imageDataStoreVO.getDataCenterId();
-    }
-
-    @Override
-    public Long getRegionId() {
-        return imageDataStoreVO.getRegionId();
-    }
-
-    @Override
-    public String getProviderName() {
-        return imageDataStoreVO.getProviderName();
-    }
-
-    @Override
-    public String getProtocol() {
-        return imageDataStoreVO.getProtocol();
-    }
-
-
-
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageStoreImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageStoreImpl.java b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageStoreImpl.java
new file mode 100644
index 0000000..60c71f0
--- /dev/null
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/ImageStoreImpl.java
@@ -0,0 +1,175 @@
+/*
+ * 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 java.util.Set;
+
+import javax.inject.Inject;
+
+import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
+import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
+import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole;
+import org.apache.cloudstack.engine.subsystem.api.storage.ImageStoreProvider;
+import org.apache.cloudstack.engine.subsystem.api.storage.Scope;
+import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo;
+import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
+import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
+import org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope;
+import org.apache.cloudstack.storage.datastore.ObjectInDataStoreManager;
+import org.apache.cloudstack.storage.image.ImageStoreDriver;
+import org.apache.cloudstack.storage.image.datastore.ImageStoreEntity;
+import org.apache.cloudstack.storage.image.db.ImageStoreVO;
+
+import com.cloud.storage.ImageStore;
+import com.cloud.storage.dao.VMTemplateDao;
+import com.cloud.utils.component.ComponentContext;
+import com.cloud.utils.storage.encoding.EncodingType;
+
+
+public class ImageStoreImpl implements ImageStoreEntity {
+    @Inject
+    VMTemplateDao imageDao;
+    @Inject
+    private ObjectInDataStoreManager objectInStoreMgr;
+    protected ImageStoreDriver driver;
+    protected ImageStoreVO imageDataStoreVO;
+    protected ImageStoreProvider provider;
+    boolean needDownloadToCacheStorage = false;
+
+    public ImageStoreImpl() {
+
+    }
+
+    protected void configure(ImageStoreVO dataStoreVO, ImageStoreDriver imageDataStoreDriver,
+            ImageStoreProvider provider) {
+        this.driver = imageDataStoreDriver;
+        this.imageDataStoreVO = dataStoreVO;
+        this.provider = provider;
+    }
+
+    public static ImageStoreEntity getDataStore(ImageStoreVO dataStoreVO, ImageStoreDriver imageDataStoreDriver,
+            ImageStoreProvider provider) {
+        ImageStoreImpl instance = (ImageStoreImpl)ComponentContext.inject(ImageStoreImpl.class);
+        instance.configure(dataStoreVO, imageDataStoreDriver, provider);
+        return instance;
+    }
+
+    @Override
+    public Set<TemplateInfo> listTemplates() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public DataStoreDriver getDriver() {
+        // TODO Auto-generated method stub
+        return this.driver;
+    }
+
+    @Override
+    public DataStoreRole getRole() {
+        // TODO Auto-generated method stub
+        return DataStoreRole.Image;
+    }
+    @Override
+    public long getId() {
+        // TODO Auto-generated method stub
+        return this.imageDataStoreVO.getId();
+    }
+
+    @Override
+    public String getUri() {
+        return this.imageDataStoreVO.getProtocol() + "://" + "?" + EncodingType.ROLE + "=" + this.getRole();
+    }
+
+    @Override
+    public Scope getScope() {
+        return new ZoneScope(imageDataStoreVO.getDataCenterId());
+    }
+
+    @Override
+    public TemplateInfo getTemplate(long templateId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public VolumeInfo getVolume(long volumeId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public SnapshotInfo getSnapshot(long snapshotId) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public boolean exists(DataObject object) {
+        return (objectInStoreMgr.findObject(object,
+                this) != null) ? true : false;
+    }
+
+    @Override
+    public String getUuid() {
+        return this.imageDataStoreVO.getUuid();
+    }
+
+    @Override
+    public DataObject create(DataObject obj) {
+        DataObject object = objectInStoreMgr.create(obj, this);
+        return object;
+    }
+
+    @Override
+    public boolean delete(DataObject obj) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public String getName() {
+        return imageDataStoreVO.getName();
+    }
+
+    @Override
+    public Long getDataCenterId() {
+        return imageDataStoreVO.getDataCenterId();
+    }
+
+    @Override
+    public ImageStore.State getState() {
+        return imageDataStoreVO.getState();
+    }
+
+    @Override
+    public String getProviderName() {
+        return imageDataStoreVO.getProviderName();
+    }
+
+    @Override
+    public String getProtocol() {
+        return imageDataStoreVO.getProtocol();
+    }
+
+
+
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/engine/storage/image/src/org/apache/cloudstack/storage/image/store/lifecycle/ImageDataStoreLifeCycle.java
----------------------------------------------------------------------
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/lifecycle/ImageDataStoreLifeCycle.java b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/lifecycle/ImageDataStoreLifeCycle.java
deleted file mode 100644
index a368239..0000000
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/lifecycle/ImageDataStoreLifeCycle.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cloudstack.storage.image.store.lifecycle;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreLifeCycle;
-
-public interface ImageDataStoreLifeCycle extends DataStoreLifeCycle {
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/engine/storage/image/src/org/apache/cloudstack/storage/image/store/lifecycle/ImageStoreLifeCycle.java
----------------------------------------------------------------------
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/lifecycle/ImageStoreLifeCycle.java b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/lifecycle/ImageStoreLifeCycle.java
new file mode 100644
index 0000000..121f8c5
--- /dev/null
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/lifecycle/ImageStoreLifeCycle.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.storage.image.store.lifecycle;
+
+import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreLifeCycle;
+
+public interface ImageStoreLifeCycle extends DataStoreLifeCycle {
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentTest.java
----------------------------------------------------------------------
diff --git a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentTest.java b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentTest.java
index 2d6b94f..71f1beb 100644
--- a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentTest.java
+++ b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentTest.java
@@ -22,7 +22,7 @@ import java.util.UUID;
 
 import javax.inject.Inject;
 
-import org.apache.cloudstack.storage.to.ImageDataStoreTO;
+import org.apache.cloudstack.storage.to.ImageStoreTO;
 import org.apache.cloudstack.storage.to.ImageOnPrimayDataStoreTO;
 import org.apache.cloudstack.storage.to.PrimaryDataStoreTO;
 import org.apache.cloudstack.storage.to.TemplateTO;
@@ -131,7 +131,7 @@ public class DirectAgentTest extends CloudStackTestNGBase {
         Mockito.when(primaryStore.getUuid()).thenReturn(this.getLocalStorageUuid());
         Mockito.when(image.getPrimaryDataStore()).thenReturn(primaryStore);
         
-        ImageDataStoreTO imageStore = Mockito.mock(ImageDataStoreTO.class);
+        ImageStoreTO imageStore = Mockito.mock(ImageStoreTO.class);
         Mockito.when(imageStore.getType()).thenReturn("http");
         
         TemplateTO template = Mockito.mock(TemplateTO.class);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreManagerImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreManagerImpl.java
index 80e48a2..8c22767 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreManagerImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/DataStoreManagerImpl.java
@@ -27,7 +27,7 @@ import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreRole;
 import org.apache.cloudstack.engine.subsystem.api.storage.Scope;
-import org.apache.cloudstack.storage.image.datastore.ImageDataStoreProviderManager;
+import org.apache.cloudstack.storage.image.datastore.ImageStoreProviderManager;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.exception.CloudRuntimeException;
@@ -37,14 +37,14 @@ public class DataStoreManagerImpl implements DataStoreManager {
     @Inject
     PrimaryDataStoreProviderManager primaryStorMgr;
     @Inject
-    ImageDataStoreProviderManager imageDataStoreMgr;
+    ImageStoreProviderManager imageDataStoreMgr;
 
     @Override
     public DataStore getDataStore(long storeId, DataStoreRole role) {
         if (role == DataStoreRole.Primary) {
             return primaryStorMgr.getPrimaryDataStore(storeId);
         } else if (role == DataStoreRole.Image) {
-            return imageDataStoreMgr.getImageDataStore(storeId);
+            return imageDataStoreMgr.getImageStore(storeId);
         }
         throw new CloudRuntimeException("un recognized type" + role);
     }
@@ -58,7 +58,7 @@ public class DataStoreManagerImpl implements DataStoreManager {
         if (role == DataStoreRole.Primary) {
             return primaryStorMgr.getPrimaryDataStore(uuid);
         } else if (role == DataStoreRole.Image) {
-            return imageDataStoreMgr.getImageDataStore(uuid);
+            return imageDataStoreMgr.getImageStore(uuid);
         }
         throw new CloudRuntimeException("un recognized type" + role);
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java
index aa1ace2..1bfc5ff 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java
@@ -31,13 +31,13 @@ import org.apache.cloudstack.api.response.StorageProviderResponse;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProvider.DataStoreProviderType;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProviderManager;
-import org.apache.cloudstack.engine.subsystem.api.storage.ImageDataStoreProvider;
+import org.apache.cloudstack.engine.subsystem.api.storage.ImageStoreProvider;
 import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver;
 import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreProvider;
-import org.apache.cloudstack.storage.image.ImageDataStoreDriver;
+import org.apache.cloudstack.storage.image.ImageStoreDriver;
 import org.apache.cloudstack.storage.datastore.PrimaryDataStoreProviderManager;
 import org.apache.cloudstack.storage.datastore.db.DataStoreProviderDao;
-import org.apache.cloudstack.storage.image.datastore.ImageDataStoreProviderManager;
+import org.apache.cloudstack.storage.image.datastore.ImageStoreProviderManager;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
@@ -56,7 +56,7 @@ public class DataStoreProviderManagerImpl extends ManagerBase implements DataSto
     @Inject
     PrimaryDataStoreProviderManager primaryDataStoreProviderMgr;
     @Inject
-    ImageDataStoreProviderManager imageDataStoreProviderMgr;
+    ImageStoreProviderManager imageDataStoreProviderMgr;
     @Override
     public DataStoreProvider getDataStoreProvider(String name) {
         return providerMap.get(name);
@@ -84,7 +84,7 @@ public class DataStoreProviderManagerImpl extends ManagerBase implements DataSto
     public List<StorageProviderResponse> getImageDataStoreProviders() {
         List<StorageProviderResponse> providers = new ArrayList<StorageProviderResponse>();
         for (DataStoreProvider provider : providerMap.values()) {
-            if (provider instanceof ImageDataStoreProvider) {
+            if (provider instanceof ImageStoreProvider) {
                 StorageProviderResponse response = new StorageProviderResponse();
                 response.setName(provider.getName());
                 response.setType(DataStoreProvider.DataStoreProviderType.IMAGE.toString());
@@ -123,7 +123,7 @@ public class DataStoreProviderManagerImpl extends ManagerBase implements DataSto
                     primaryDataStoreProviderMgr.registerHostListener(provider.getName(), provider.getHostListener());
                 }
                 else if  (types.contains(DataStoreProviderType.IMAGE)) {
-                    imageDataStoreProviderMgr.registerDriver(provider.getName(), (ImageDataStoreDriver)provider.getDataStoreDriver());
+                    imageDataStoreProviderMgr.registerDriver(provider.getName(), (ImageStoreDriver)provider.getDataStoreDriver());
                 }
             } catch(Exception e) {
                 s_logger.debug("configure provider failed", e);
@@ -142,7 +142,7 @@ public class DataStoreProviderManagerImpl extends ManagerBase implements DataSto
 
     @Override
     public DataStoreProvider getDefaultImageDataStoreProvider() {
-        return this.getDataStoreProvider("cloudstack image data store provider");
+        return this.getDataStoreProvider("cloudstack image store provider");
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/engine/storage/src/org/apache/cloudstack/storage/image/ImageDataStoreDriver.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/ImageDataStoreDriver.java b/engine/storage/src/org/apache/cloudstack/storage/image/ImageDataStoreDriver.java
deleted file mode 100644
index d352d97..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/ImageDataStoreDriver.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cloudstack.storage.image;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
-
-public interface ImageDataStoreDriver extends DataStoreDriver {
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/engine/storage/src/org/apache/cloudstack/storage/image/ImageStoreDriver.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/ImageStoreDriver.java b/engine/storage/src/org/apache/cloudstack/storage/image/ImageStoreDriver.java
new file mode 100644
index 0000000..712e186
--- /dev/null
+++ b/engine/storage/src/org/apache/cloudstack/storage/image/ImageStoreDriver.java
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cloudstack.storage.image;
+
+import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver;
+
+public interface ImageStoreDriver extends DataStoreDriver {
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/engine/storage/src/org/apache/cloudstack/storage/image/TemplateEntityImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/TemplateEntityImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/TemplateEntityImpl.java
index 4d162bb..51c8c43 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/image/TemplateEntityImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/image/TemplateEntityImpl.java
@@ -25,7 +25,7 @@ import java.util.Map;
 
 import org.apache.cloudstack.engine.cloud.entity.api.TemplateEntity;
 import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
-import org.apache.cloudstack.storage.image.datastore.ImageDataStoreInfo;
+import org.apache.cloudstack.storage.image.datastore.ImageStoreInfo;
 
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.storage.Storage.ImageFormat;
@@ -38,12 +38,12 @@ public class TemplateEntityImpl implements TemplateEntity {
         this.templateInfo = templateInfo;
     }
 
-    public ImageDataStoreInfo getImageDataStore() {
-        return (ImageDataStoreInfo)templateInfo.getDataStore();
+    public ImageStoreInfo getImageDataStore() {
+        return (ImageStoreInfo)templateInfo.getDataStore();
     }
 
     public long getImageDataStoreId() {
-        return getImageDataStore().getImageDataStoreId();
+        return getImageDataStore().getImageStoreId();
     }
 
     public TemplateInfo getTemplateInfo() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/engine/storage/src/org/apache/cloudstack/storage/image/datastore/ImageDataStore.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/datastore/ImageDataStore.java b/engine/storage/src/org/apache/cloudstack/storage/image/datastore/ImageDataStore.java
deleted file mode 100644
index a9b7e9b..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/datastore/ImageDataStore.java
+++ /dev/null
@@ -1,37 +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.datastore;
-
-import java.util.Set;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo;
-import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
-import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo;
-
-import com.cloud.storage.ObjectStore;
-
-public interface ImageDataStore extends DataStore, ObjectStore {
-    TemplateInfo getTemplate(long templateId);
-    VolumeInfo getVolume(long volumeId);
-    SnapshotInfo getSnapshot(long snapshotId);
-    boolean exists(DataObject object);
-    Set<TemplateInfo> listTemplates();
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a872d6d3/engine/storage/src/org/apache/cloudstack/storage/image/datastore/ImageDataStoreHelper.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/datastore/ImageDataStoreHelper.java b/engine/storage/src/org/apache/cloudstack/storage/image/datastore/ImageDataStoreHelper.java
deleted file mode 100644
index e31a644..0000000
--- a/engine/storage/src/org/apache/cloudstack/storage/image/datastore/ImageDataStoreHelper.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.datastore;
-
-import java.util.Map;
-
-import javax.inject.Inject;
-
-import org.apache.cloudstack.storage.image.db.ImageDataStoreDao;
-import org.apache.cloudstack.storage.image.db.ImageDataStoreVO;
-import org.springframework.stereotype.Component;
-
-import com.cloud.storage.ScopeType;
-import com.cloud.utils.exception.CloudRuntimeException;
-
-@Component
-public class ImageDataStoreHelper {
-    @Inject
-    ImageDataStoreDao imageStoreDao;
-    public ImageDataStoreVO createImageDataStore(Map<String, Object> params) {
-        ImageDataStoreVO store = imageStoreDao.findByName((String)params.get("name"));
-        if (store != null) {
-            return store;
-        }
-        store = new ImageDataStoreVO();
-        store.setName((String)params.get("name"));
-        store.setProtocol((String)params.get("protocol"));
-        store.setProviderName((String)params.get("providerName"));
-        store.setScope((ScopeType)params.get("scope"));
-        store.setUuid((String)params.get("uuid"));
-        store.setUrl((String)params.get("url"));
-        store = imageStoreDao.persist(store);
-        return store;
-    }
-
-    public boolean deleteImageDataStore(long id) {
-        ImageDataStoreVO store = imageStoreDao.findById(id);
-        if (store == null) {
-            throw new CloudRuntimeException("can't find image store:" + id);
-        }
-
-        imageStoreDao.remove(id);
-        return true;
-    }
-}


Mime
View raw message