cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [1/2] git commit: updated refs/heads/object_store to 3897590
Date Tue, 09 Apr 2013 23:36:26 GMT
Updated Branches:
  refs/heads/object_store 2a177de2b -> 3897590bb


Remove State from image_store db table, and removed enableImageStore
api.

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

Branch: refs/heads/object_store
Commit: b2d5535bbaa68fea3ecd76846a33ff660a4889d7
Parents: 2a177de
Author: Min Chen <min.chen@citrix.com>
Authored: Tue Apr 9 15:38:33 2013 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Tue Apr 9 15:38:33 2013 -0700

----------------------------------------------------------------------
 api/src/com/cloud/storage/ImageStore.java          |    8 --
 api/src/com/cloud/storage/StorageService.java      |    2 -
 .../command/admin/host/AddSecondaryStorageCmd.java |   30 -----
 .../command/admin/storage/AddImageStoreCmd.java    |    2 +-
 .../command/admin/storage/DeleteImageStoreCmd.java |    2 +-
 .../command/admin/storage/EnableImageStoreCmd.java |   89 ---------------
 .../command/admin/storage/ListImageStoresCmd.java  |    9 +--
 .../api/response/ImageStoreResponse.java           |   13 --
 .../storage/datastore/db/ImageStoreDao.java        |    1 -
 .../storage/datastore/db/ImageStoreVO.java         |   12 --
 .../storage/image/store/ImageStoreImpl.java        |    5 -
 .../storage/image/datastore/ImageStoreHelper.java  |    2 -
 .../storage/image/db/ImageStoreDaoImpl.java        |   14 ---
 .../src/com/cloud/api/query/QueryManagerImpl.java  |   13 --
 .../cloud/api/query/dao/ImageStoreJoinDaoImpl.java |    1 -
 .../com/cloud/api/query/vo/ImageStoreJoinVO.java   |   12 --
 .../src/com/cloud/storage/StorageManagerImpl.java  |   36 ------
 setup/db/db/schema-410to420.sql                    |    2 -
 18 files changed, 3 insertions(+), 250 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2d5535b/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
index 54d22d1..d2a72a2 100644
--- a/api/src/com/cloud/storage/ImageStore.java
+++ b/api/src/com/cloud/storage/ImageStore.java
@@ -21,10 +21,6 @@ import org.apache.cloudstack.api.InternalIdentity;
 
 public interface ImageStore extends Identity, InternalIdentity {
 
-    public enum State {
-        Disabled, Enabled, Deactivated;
-    }
-
 
     /**
      * @return name of the object store.
@@ -36,10 +32,6 @@ public interface ImageStore extends Identity, InternalIdentity {
      */
     Long getDataCenterId();
 
-    /**
-     * @return image store state.
-     */
-    State getState();
 
 	/**
 	 * @return object store provider name

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2d5535b/api/src/com/cloud/storage/StorageService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/storage/StorageService.java b/api/src/com/cloud/storage/StorageService.java
index 665abcb..ee1a956 100644
--- a/api/src/com/cloud/storage/StorageService.java
+++ b/api/src/com/cloud/storage/StorageService.java
@@ -23,7 +23,6 @@ import org.apache.cloudstack.api.command.admin.storage.CancelPrimaryStorageMaint
 import org.apache.cloudstack.api.command.admin.storage.CreateStoragePoolCmd;
 import org.apache.cloudstack.api.command.admin.storage.DeleteImageStoreCmd;
 import org.apache.cloudstack.api.command.admin.storage.DeletePoolCmd;
-import org.apache.cloudstack.api.command.admin.storage.EnableImageStoreCmd;
 import org.apache.cloudstack.api.command.admin.storage.UpdateStoragePoolCmd;
 
 import com.cloud.exception.DiscoveryException;
@@ -92,5 +91,4 @@ public interface StorageService{
 
     ImageStore discoverImageStore(AddImageStoreCmd cmd) throws IllegalArgumentException,
DiscoveryException, InvalidParameterValueException;
 
-    ImageStore enableImageStore(EnableImageStoreCmd cmd);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2d5535b/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 94aaa5f..3f24370 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
@@ -50,20 +50,6 @@ public class AddSecondaryStorageCmd extends BaseCmd {
             description="the Zone ID for the secondary storage")
     private Long zoneId;
 
-    @Parameter(name=ApiConstants.REGION_ID, type=CommandType.UUID, entityType=RegionResponse.class,
-            description="the Region ID for the secondary storage")
-    private Long regionId;
-
-    @Parameter(name=ApiConstants.DETAILS, type=CommandType.MAP, description="the details
for the secondary storage data store")
-    private Map details;
-
-    @Parameter(name=ApiConstants.SCOPE, type=CommandType.STRING,
-            required=false, description="the scope of the secondary storage data store: zone
or region or global")
-    private String scope;
-
-    @Parameter(name=ApiConstants.PROVIDER, type=CommandType.STRING,
-            required=false, description="the secondary storage store provider name")
-    private String imageProviderName;
 
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////
@@ -77,22 +63,6 @@ public class AddSecondaryStorageCmd extends BaseCmd {
         return zoneId;
     }
 
-    public Long getRegionId() {
-        return regionId;
-    }
-
-    public Map getDetails() {
-        return details;
-    }
-
-    public String getScope() {
-        return this.scope;
-     }
-
-    public String getImageProviderName() {
-        return this.imageProviderName;
-    }
-
 
     /////////////////////////////////////////////////////
     /////////////// API Implementation///////////////////

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2d5535b/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
index 511283f..c5a8c4a 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/AddImageStoreCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/AddImageStoreCmd.java
@@ -32,7 +32,7 @@ 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)
+@APICommand(name = "addImageStore", description="Adds backup image store.", responseObject=ImageStoreResponse.class,
since = "4.2.0")
 public class AddImageStoreCmd extends BaseCmd {
     public static final Logger s_logger = Logger.getLogger(AddImageStoreCmd.class.getName());
     private static final String s_name = "addimagestoreresponse";

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2d5535b/api/src/org/apache/cloudstack/api/command/admin/storage/DeleteImageStoreCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/DeleteImageStoreCmd.java
b/api/src/org/apache/cloudstack/api/command/admin/storage/DeleteImageStoreCmd.java
index 34a4ae0..20ddc8b 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/DeleteImageStoreCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/DeleteImageStoreCmd.java
@@ -29,7 +29,7 @@ import org.apache.log4j.Logger;
 
 import com.cloud.user.Account;
 
-@APICommand(name = "deleteImageStore", description = "Deletes an image store .", responseObject
= SuccessResponse.class)
+@APICommand(name = "deleteImageStore", description = "Deletes an image store .", responseObject
= SuccessResponse.class, since = "4.2.0")
 public class DeleteImageStoreCmd extends BaseCmd {
     public static final Logger s_logger = Logger.getLogger(DeleteImageStoreCmd.class.getName());
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2d5535b/api/src/org/apache/cloudstack/api/command/admin/storage/EnableImageStoreCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/EnableImageStoreCmd.java
b/api/src/org/apache/cloudstack/api/command/admin/storage/EnableImageStoreCmd.java
deleted file mode 100644
index 7586fa9..0000000
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/EnableImageStoreCmd.java
+++ /dev/null
@@ -1,89 +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.command.admin.storage;
-
-import javax.inject.Inject;
-
-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.AccountResponse;
-import org.apache.cloudstack.api.response.DomainResponse;
-import org.apache.cloudstack.api.response.ImageStoreResponse;
-import org.apache.cloudstack.region.RegionService;
-import org.apache.log4j.Logger;
-
-import com.cloud.storage.ImageStore;
-import com.cloud.user.Account;
-
-@APICommand(name = "enableImageStore", description="Enable an image store", responseObject=ImageStoreResponse.class)
-public class EnableImageStoreCmd extends BaseCmd {
-    public static final Logger s_logger = Logger.getLogger(EnableImageStoreCmd.class.getName());
-    private static final String s_name = "enableimagestoreresponse";
-
-    /////////////////////////////////////////////////////
-    //////////////// API parameters /////////////////////
-    /////////////////////////////////////////////////////
-    @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=ImageStoreResponse.class,
-            description="Image Store id")
-    private Long id;
-
-    @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="Enables specified
image store.")
-    private String storeName;
-
-
-    /////////////////////////////////////////////////////
-    /////////////////// Accessors ///////////////////////
-    /////////////////////////////////////////////////////
-
-    public Long getId() {
-        return id;
-    }
-
-    public String getStoreName() {
-        return storeName;
-    }
-
-    /////////////////////////////////////////////////////
-    /////////////// API Implementation///////////////////
-    /////////////////////////////////////////////////////
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
-
-    @Override
-    public long getEntityOwnerId() {
-        return Account.ACCOUNT_ID_SYSTEM;
-    }
-
-    @Override
-    public void execute(){
-        ImageStore result = _storageService.enableImageStore(this);
-        if (result != null){
-            ImageStoreResponse response = _responseGenerator.createImageStoreResponse(result);
-            response.setResponseName(getCommandName());
-            this.setResponseObject(response);
-        } else {
-            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to enable image
store");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2d5535b/api/src/org/apache/cloudstack/api/command/admin/storage/ListImageStoresCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/ListImageStoresCmd.java
b/api/src/org/apache/cloudstack/api/command/admin/storage/ListImageStoresCmd.java
index 4dbe900..499cc04 100644
--- a/api/src/org/apache/cloudstack/api/command/admin/storage/ListImageStoresCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/admin/storage/ListImageStoresCmd.java
@@ -30,7 +30,7 @@ import org.apache.log4j.Logger;
 
 import com.cloud.async.AsyncJob;
 
-@APICommand(name = "listImageStores", description="Lists image stores.", responseObject=ImageStoreResponse.class)
+@APICommand(name = "listImageStores", description="Lists image stores.", responseObject=ImageStoreResponse.class,
since = "4.2.0")
 public class ListImageStoresCmd extends BaseListCmd {
     public static final Logger s_logger = Logger.getLogger(ListImageStoresCmd.class.getName());
 
@@ -43,9 +43,6 @@ public class ListImageStoresCmd extends BaseListCmd {
     @Parameter(name=ApiConstants.NAME, type=CommandType.STRING, description="the name of
the image store")
     private String storeName;
 
-    @Parameter(name=ApiConstants.STATE, type=CommandType.STRING, description="the image store
state")
-    private String state;
-
     @Parameter(name=ApiConstants.PROTOCOL, type=CommandType.STRING, description="the image
store protocol")
     private String protocol;
 
@@ -74,10 +71,6 @@ public class ListImageStoresCmd extends BaseListCmd {
         return storeName;
     }
 
-    public String getState() {
-        return state;
-    }
-
     public String getProtocol() {
         return protocol;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2d5535b/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
index 21dc635..04a375f 100644
--- a/api/src/org/apache/cloudstack/api/response/ImageStoreResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ImageStoreResponse.java
@@ -39,10 +39,6 @@ public class ImageStoreResponse extends BaseResponse {
     @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;
 
@@ -95,15 +91,6 @@ public class ImageStoreResponse extends BaseResponse {
         this.zoneName = zoneName;
     }
 
-
-    public ImageStore.State getState() {
-        return state;
-    }
-
-    public void setState(ImageStore.State state) {
-        this.state = state;
-    }
-
     public String getName() {
         return name;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2d5535b/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreDao.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreDao.java
b/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreDao.java
index 1c30766..595e498 100644
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreDao.java
+++ b/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreDao.java
@@ -23,5 +23,4 @@ import com.cloud.utils.db.GenericDao;
 public interface ImageStoreDao extends GenericDao<ImageStoreVO, Long> {
     public ImageStoreVO findByName(String name);
 
-    public ImageStoreVO findEnabledStore();
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2d5535b/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreVO.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreVO.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreVO.java
index 62c1be0..7f95036 100644
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreVO.java
+++ b/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreVO.java
@@ -60,10 +60,6 @@ public class ImageStoreVO implements ImageStore {
     @Column(name = "data_center_id")
     private long dcId;
 
-    @Column(name = "state")
-    @Enumerated(value = EnumType.STRING)
-    private State state;
-
     @Column(name = "scope")
     @Enumerated(value = EnumType.STRING)
     private ScopeType scope;
@@ -150,14 +146,6 @@ public class ImageStoreVO implements ImageStore {
         this.removed = removed;
     }
 
-    public State getState() {
-        return state;
-    }
-
-    public void setState(State state) {
-        this.state = state;
-    }
-
 
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2d5535b/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
index 17f2b89..90290d8 100644
--- 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
@@ -36,7 +36,6 @@ import org.apache.cloudstack.storage.datastore.db.ImageStoreVO;
 import org.apache.cloudstack.storage.image.ImageStoreDriver;
 import org.apache.cloudstack.storage.image.datastore.ImageStoreEntity;
 
-import com.cloud.storage.ImageStore;
 import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.utils.component.ComponentContext;
 import com.cloud.utils.storage.encoding.EncodingType;
@@ -154,10 +153,6 @@ public class ImageStoreImpl implements ImageStoreEntity {
         return imageDataStoreVO.getDataCenterId();
     }
 
-    @Override
-    public ImageStore.State getState() {
-        return imageDataStoreVO.getState();
-    }
 
     @Override
     public String getProviderName() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2d5535b/engine/storage/src/org/apache/cloudstack/storage/image/datastore/ImageStoreHelper.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/datastore/ImageStoreHelper.java
b/engine/storage/src/org/apache/cloudstack/storage/image/datastore/ImageStoreHelper.java
index eb26404..33fda48 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/image/datastore/ImageStoreHelper.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/image/datastore/ImageStoreHelper.java
@@ -52,7 +52,6 @@ public class ImageStoreHelper {
         store.setScope((ScopeType)params.get("scope"));
         store.setUuid((String)params.get("uuid"));
         store.setUrl((String)params.get("url"));
-        store.setState(ImageStore.State.Disabled);
         store = imageStoreDao.persist(store);
         return store;
     }
@@ -69,7 +68,6 @@ public class ImageStoreHelper {
         store.setScope((ScopeType)params.get("scope"));
         store.setUuid((String)params.get("uuid"));
         store.setUrl((String)params.get("url"));
-        store.setState(ImageStore.State.Disabled);
         store = imageStoreDao.persist(store);
 
         // persist details

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2d5535b/engine/storage/src/org/apache/cloudstack/storage/image/db/ImageStoreDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/db/ImageStoreDaoImpl.java
b/engine/storage/src/org/apache/cloudstack/storage/image/db/ImageStoreDaoImpl.java
index 8aa5079..605ac5b 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/image/db/ImageStoreDaoImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/image/db/ImageStoreDaoImpl.java
@@ -43,7 +43,6 @@ public class ImageStoreDaoImpl extends GenericDaoBase<ImageStoreVO, Long>
implem
 
     private static final Logger s_logger = Logger.getLogger(ImageStoreDaoImpl.class);
     private SearchBuilder<ImageStoreVO> nameSearch;
-    private SearchBuilder<ImageStoreVO> enableSearch;
 
 
     @Override
@@ -54,11 +53,6 @@ public class ImageStoreDaoImpl extends GenericDaoBase<ImageStoreVO,
Long> implem
         nameSearch.and("name", nameSearch.entity().getName(), SearchCriteria.Op.EQ);
         nameSearch.done();
 
-
-        enableSearch = createSearchBuilder();
-        enableSearch.and("state", enableSearch.entity().getState(), SearchCriteria.Op.EQ);
-        enableSearch.done();
-
         return true;
     }
 
@@ -69,13 +63,5 @@ public class ImageStoreDaoImpl extends GenericDaoBase<ImageStoreVO,
Long> implem
         return findOneBy(sc);
     }
 
-    @Override
-    public ImageStoreVO findEnabledStore() {
-        SearchCriteria<ImageStoreVO> sc = nameSearch.create();
-        sc.setParameters("state", ImageStore.State.Enabled); // only one image store is enabled
at one time.
-        return findOneBy(sc);
-    }
-
-
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2d5535b/server/src/com/cloud/api/query/QueryManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java
index daf49cb..4b4c86e 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -1931,15 +1931,6 @@ public class QueryManagerImpl extends ManagerBase implements QueryService
{
         Object name = cmd.getStoreName();
         String provider = cmd.getProvider();
         String protocol = cmd.getProtocol();
-        ImageStore.State state = null;
-        String stateStr = cmd.getState();
-        if (stateStr != null) {
-            try {
-                state = Enum.valueOf(ImageStore.State.class, stateStr.toUpperCase());
-            } catch (Exception e) {
-                throw new InvalidParameterValueException("invalid state" + stateStr);
-            }
-        }
         Object keyword = cmd.getKeyword();
         Long startIndex = cmd.getStartIndex();
         Long pageSize = cmd.getPageSizeVal();
@@ -1953,7 +1944,6 @@ public class QueryManagerImpl extends ManagerBase implements QueryService
{
         sb.and("name", sb.entity().getName(), SearchCriteria.Op.EQ);
         sb.and("dataCenterId", sb.entity().getZoneId(), SearchCriteria.Op.EQ);
         sb.and("protocol", sb.entity().getProtocol(), SearchCriteria.Op.EQ);
-        sb.and("state", sb.entity().getState(), SearchCriteria.Op.EQ);
         sb.and("provider", sb.entity().getProviderName(), SearchCriteria.Op.EQ);
 
 
@@ -1982,9 +1972,6 @@ public class QueryManagerImpl extends ManagerBase implements QueryService
{
         if (provider != null) {
             sc.setParameters("provider", provider);
         }
-        if (state != null) {
-            sc.setParameters("state", state);
-        }
         if (protocol != null) {
             sc.setParameters("protocol", protocol);
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2d5535b/server/src/com/cloud/api/query/dao/ImageStoreJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/ImageStoreJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/ImageStoreJoinDaoImpl.java
index b2fa0c2..72446f4 100644
--- a/server/src/com/cloud/api/query/dao/ImageStoreJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/ImageStoreJoinDaoImpl.java
@@ -76,7 +76,6 @@ public class ImageStoreJoinDaoImpl extends GenericDaoBase<ImageStoreJoinVO,
Long
         osResponse.setScope(ids.getScope());
         osResponse.setZoneId(ids.getZoneUuid());
         osResponse.setZoneName(ids.getZoneName());
-        osResponse.setState(ids.getState());
 
         String detailName = ids.getDetailName();
         if ( detailName != null && detailName.length() > 0 ){

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2d5535b/server/src/com/cloud/api/query/vo/ImageStoreJoinVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/vo/ImageStoreJoinVO.java b/server/src/com/cloud/api/query/vo/ImageStoreJoinVO.java
index 62c4a8f..ce56860 100644
--- a/server/src/com/cloud/api/query/vo/ImageStoreJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/ImageStoreJoinVO.java
@@ -68,9 +68,6 @@ public class ImageStoreJoinVO extends BaseViewVO implements InternalIdentity,
Id
     @Column(name="data_center_name")
     private String zoneName;
 
-    @Column(name="state")
-    private ImageStore.State state;
-
     @Column(name="detail_name")
     private String detailName;
 
@@ -159,15 +156,6 @@ public class ImageStoreJoinVO extends BaseViewVO implements InternalIdentity,
Id
         this.scope = scope;
     }
 
-
-    public ImageStore.State getState() {
-        return state;
-    }
-
-    public void setState(ImageStore.State state) {
-        this.state = state;
-    }
-
     public void setName(String name) {
         this.name = name;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2d5535b/server/src/com/cloud/storage/StorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java
index 162df1a..ca4c636 100755
--- a/server/src/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/com/cloud/storage/StorageManagerImpl.java
@@ -45,7 +45,6 @@ import org.apache.cloudstack.api.command.admin.storage.CancelPrimaryStorageMaint
 import org.apache.cloudstack.api.command.admin.storage.CreateStoragePoolCmd;
 import org.apache.cloudstack.api.command.admin.storage.DeleteImageStoreCmd;
 import org.apache.cloudstack.api.command.admin.storage.DeletePoolCmd;
-import org.apache.cloudstack.api.command.admin.storage.EnableImageStoreCmd;
 import org.apache.cloudstack.api.command.admin.storage.UpdateStoragePoolCmd;
 import org.apache.cloudstack.engine.subsystem.api.storage.ClusterScope;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
@@ -2013,40 +2012,5 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager,
C
         return true;
     }
 
-    @Override
-    public ImageStore enableImageStore(EnableImageStoreCmd cmd) {
-        Long storeId = cmd.getId();
-        String storeName = cmd.getStoreName();
-
-        ImageStore store = null;
-        if ( storeId != null ){
-            store = _imageStoreDao.findById(storeId);
-        } else if ( storeName != null ){
-            store = _imageStoreDao.findByName(storeName);
-        } else {
-            throw new InvalidParameterValueException("Either image store id or name has to
be specified!");
-        }
-
-        if (store == null) {
-            throw new InvalidParameterValueException("Unable to find image store by id: "
+ storeId + " OR by name: " + storeName);
-        }
-        // disable currently active store
-        ImageStoreVO activeStore = _imageStoreDao.findEnabledStore();
-        ImageStoreVO activeStoreForUpdate = _imageStoreDao.createForUpdate();
-        activeStoreForUpdate.setState(ImageStore.State.Disabled);
-        if ( !_imageStoreDao.update(activeStore.getId(), activeStoreForUpdate)){
-            throw new CloudRuntimeException("Failed to disable current active image store
" + activeStore.getName());
-        }
-
-        ImageStoreVO storeForUpdate = _imageStoreDao.createForUpdate();
-        storeForUpdate.setState(ImageStore.State.Enabled);
-        if (_imageStoreDao.update(store.getId(), storeForUpdate)){
-            return _imageStoreDao.findById(store.getId());
-        }
-        else{
-            throw new CloudRuntimeException("Failed to enable image store by id: " + storeId
+ " OR by name: " + storeName);
-        }
-    }
-
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b2d5535b/setup/db/db/schema-410to420.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql
index 38bad7a..e8739fc 100644
--- a/setup/db/db/schema-410to420.sql
+++ b/setup/db/db/schema-410to420.sql
@@ -77,7 +77,6 @@ CREATE TABLE `cloud`.`image_store` (
   `data_center_id` bigint unsigned  COMMENT 'datacenter id of data store',
   `scope` varchar(255) COMMENT 'scope of data store',
   `uuid` varchar(255) COMMENT 'uuid of data store',
-  `state` varchar(30) COMMENT 'state of data store',
   `created` datetime COMMENT 'date the image store first signed on',
   `removed` datetime COMMENT 'date removed if not null',  
   PRIMARY KEY(`id`)
@@ -103,7 +102,6 @@ CREATE VIEW `cloud`.`image_store_view` AS
         image_store.protocol,
         image_store.url,
         image_store.scope,
-        image_store.state,
         data_center.id data_center_id,
         data_center.uuid data_center_uuid,
         data_center.name data_center_name,


Mime
View raw message