cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahu...@apache.org
Subject [3/4] Removed schema from the dependency of many components
Date Mon, 29 Jul 2013 17:54:48 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/command/CreatePrimaryDataStoreCmd.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/command/CreatePrimaryDataStoreCmd.java b/engine/api/src/org/apache/cloudstack/storage/command/CreatePrimaryDataStoreCmd.java
deleted file mode 100644
index b536028..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/command/CreatePrimaryDataStoreCmd.java
+++ /dev/null
@@ -1,38 +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.command;
-
-import com.cloud.agent.api.Command;
-
-public final class CreatePrimaryDataStoreCmd extends Command implements StorageSubSystemCommand {
-    private final String dataStore;
-
-    public CreatePrimaryDataStoreCmd(String uri) {
-        super();
-        this.dataStore = uri;
-    }
-
-    public String getDataStore() {
-        return this.dataStore;
-    }
-
-    @Override
-    public boolean executeInSequence() {
-        return false;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/command/DeleteCommand.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/command/DeleteCommand.java b/engine/api/src/org/apache/cloudstack/storage/command/DeleteCommand.java
deleted file mode 100644
index 76696da..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/command/DeleteCommand.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cloudstack.storage.command;
-
-import com.cloud.agent.api.Command;
-import com.cloud.agent.api.to.DataTO;
-
-public final class DeleteCommand extends Command implements StorageSubSystemCommand {
-    private DataTO data;
-
-    public DeleteCommand(DataTO data) {
-        super();
-        this.data = data;
-    }
-
-    protected DeleteCommand() {
-        super();
-    }
-
-    @Override
-    public boolean executeInSequence() {
-        return false;
-    }
-
-    public DataTO getData() {
-        return this.data;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/command/DettachAnswer.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/command/DettachAnswer.java b/engine/api/src/org/apache/cloudstack/storage/command/DettachAnswer.java
deleted file mode 100644
index 62ce246..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/command/DettachAnswer.java
+++ /dev/null
@@ -1,47 +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.command;
-
-import com.cloud.agent.api.Answer;
-import com.cloud.agent.api.to.DiskTO;
-
-public final class DettachAnswer extends Answer {
-    private DiskTO disk;
-
-    public DettachAnswer() {
-        super(null);
-    }
-
-    public DettachAnswer(DiskTO disk) {
-        super(null);
-        this.setDisk(disk);
-    }
-
-    public DettachAnswer(String errMsg) {
-        super(null, false, errMsg);
-    }
-
-    public DiskTO getDisk() {
-        return disk;
-    }
-
-    public void setDisk(DiskTO disk) {
-        this.disk = disk;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/command/DettachCommand.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/command/DettachCommand.java b/engine/api/src/org/apache/cloudstack/storage/command/DettachCommand.java
deleted file mode 100644
index 61cb88b..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/command/DettachCommand.java
+++ /dev/null
@@ -1,90 +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.command;
-
-import com.cloud.agent.api.Command;
-import com.cloud.agent.api.to.DiskTO;
-
-public class DettachCommand extends Command implements StorageSubSystemCommand {
-    private DiskTO disk;
-    private String vmName;
-    private boolean _managed;
-    private String _iScsiName;
-    private String _storageHost;
-    private int _storagePort;
-
-    public DettachCommand(DiskTO disk, String vmName) {
-        super();
-        this.disk = disk;
-        this.vmName = vmName;
-    }
-
-    @Override
-    public boolean executeInSequence() {
-        return false;
-    }
-
-    public DiskTO getDisk() {
-        return disk;
-    }
-
-    public void setDisk(DiskTO disk) {
-        this.disk = disk;
-    }
-
-    public String getVmName() {
-        return vmName;
-    }
-
-    public void setVmName(String vmName) {
-        this.vmName = vmName;
-    }
-
-    public void setManaged(boolean managed) {
-        _managed = managed;
-    }
-
-    public boolean isManaged() {
-        return _managed;
-    }
-
-    public void set_iScsiName(String iScsiName) {
-        _iScsiName = iScsiName;
-    }
-
-    public String get_iScsiName() {
-        return _iScsiName;
-    }
-
-    public void setStorageHost(String storageHost) {
-        _storageHost = storageHost;
-    }
-
-    public String getStorageHost() {
-        return _storageHost;
-    }
-
-    public void setStoragePort(int storagePort) {
-        _storagePort = storagePort;
-    }
-
-    public int getStoragePort() {
-        return _storagePort;
-    }
-}

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

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/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
deleted file mode 100644
index 70e9bb3..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreDao.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.datastore.db;
-
-import java.util.List;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope;
-
-import com.cloud.utils.db.GenericDao;
-
-public interface ImageStoreDao extends GenericDao<ImageStoreVO, Long> {
-    ImageStoreVO findByName(String name);
-
-    List<ImageStoreVO> findByProvider(String provider);
-
-    List<ImageStoreVO> findByScope(ZoneScope scope);
-
-    List<ImageStoreVO> findImageCacheByScope(ZoneScope scope);
-
-    List<ImageStoreVO> listImageStores();
-}

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

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreDetailsDao.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreDetailsDao.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreDetailsDao.java
deleted file mode 100644
index 91fff28..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreDetailsDao.java
+++ /dev/null
@@ -1,30 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.storage.datastore.db;
-
-import java.util.Map;
-
-import com.cloud.utils.db.GenericDao;
-
-public interface ImageStoreDetailsDao extends GenericDao<ImageStoreDetailVO, Long> {
-
-    void update(long storeId, Map<String, String> details);
-
-    Map<String, String> getDetails(long storeId);
-
-    void deleteDetails(long storeId);
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/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
deleted file mode 100644
index 5ed48a3..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/ImageStoreVO.java
+++ /dev/null
@@ -1,193 +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.Date;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.TableGenerator;
-
-import com.cloud.storage.DataStoreRole;
-import com.cloud.storage.ImageStore;
-import com.cloud.storage.ScopeType;
-import com.cloud.utils.db.GenericDao;
-
-@Entity
-@Table(name = "image_store")
-public class ImageStoreVO implements ImageStore {
-    @Id
-    @TableGenerator(name = "image_store_sq", table = "sequence", pkColumnName = "name", valueColumnName = "value",
-            pkColumnValue = "image_store_seq", allocationSize = 1)
-    @Column(name = "id", nullable = false)
-    private long id;
-
-    @Column(name = "name", nullable = false)
-    private String name;
-
-    @Column(name = "uuid", nullable = false)
-    private String uuid;
-
-    @Column(name = "protocol", nullable = false)
-    private String protocol;
-
-    @Column(name = "url", nullable = false)
-    private String url;
-
-    @Column(name = "image_provider_name", nullable = false)
-    private String providerName;
-
-    @Column(name = "data_center_id")
-    private Long dcId;
-
-    @Column(name = "scope")
-    @Enumerated(value = EnumType.STRING)
-    private ScopeType scope;
-
-    @Column(name = GenericDao.CREATED_COLUMN)
-    private Date created;
-
-    @Column(name = GenericDao.REMOVED_COLUMN)
-    private Date removed;
-
-    @Column(name = "role")
-    @Enumerated(value = EnumType.STRING)
-    private DataStoreRole role;
-
-    @Column(name = "parent")
-    private String parent;
-
-    @Column(name = "total_size")
-    private Long totalSize;
-
-    @Column(name = "used_bytes")
-    private Long usedBytes;
-
-    public DataStoreRole getRole() {
-        return role;
-    }
-
-    public void setRole(DataStoreRole role) {
-        this.role = role;
-    }
-
-    public long getId() {
-        return this.id;
-    }
-
-    public String getName() {
-        return this.name;
-    }
-
-    public String getProviderName() {
-        return this.providerName;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public void setProviderName(String provider) {
-        this.providerName = provider;
-    }
-
-    public void setProtocol(String protocol) {
-        this.protocol = protocol;
-    }
-
-    public String getProtocol() {
-        return this.protocol;
-    }
-
-    public void setDataCenterId(Long dcId) {
-        this.dcId = dcId;
-    }
-
-    public Long getDataCenterId() {
-        return this.dcId;
-    }
-
-    public ScopeType getScope() {
-        return this.scope;
-    }
-
-    public void setScope(ScopeType scope) {
-        this.scope = scope;
-    }
-
-    public void setUuid(String uuid) {
-        this.uuid = uuid;
-    }
-
-    public String getUuid() {
-        return this.uuid;
-    }
-
-    public String getUrl() {
-        return url;
-    }
-
-    public void setUrl(String url) {
-        this.url = url;
-    }
-
-    public Date getCreated() {
-        return created;
-    }
-
-    public void setCreated(Date created) {
-        this.created = created;
-    }
-
-    public Date getRemoved() {
-        return removed;
-    }
-
-    public void setRemoved(Date removed) {
-        this.removed = removed;
-    }
-
-    public String getParent() {
-        return parent;
-    }
-
-    public void setParent(String parent) {
-        this.parent = parent;
-    }
-
-    public Long getTotalSize() {
-        return totalSize;
-    }
-
-    public void setTotalSize(Long totalSize) {
-        this.totalSize = totalSize;
-    }
-
-    public Long getUsedBytes() {
-        return usedBytes;
-    }
-
-    public void setUsedBytes(Long usedBytes) {
-        this.usedBytes = usedBytes;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDao.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDao.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDao.java
deleted file mode 100644
index 669dd25..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDao.java
+++ /dev/null
@@ -1,120 +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.List;
-import java.util.Map;
-
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.storage.ScopeType;
-import com.cloud.storage.StoragePoolStatus;
-import com.cloud.utils.db.GenericDao;
-
-/**
- * Data Access Object for storage_pool table
- */
-public interface PrimaryDataStoreDao extends GenericDao<StoragePoolVO, Long> {
-
-    /**
-     * @param datacenterId -- the id of the datacenter (availability zone)
-     */
-    List<StoragePoolVO> listByDataCenterId(long datacenterId);
-
-    /**
-     * @param datacenterId -- the id of the datacenter (availability zone)
-     */
-    List<StoragePoolVO> listBy(long datacenterId, Long podId, Long clusterId, ScopeType scope);
-
-    /**
-     * Set capacity of storage pool in bytes
-     * @param id pool id.
-     * @param capacity capacity in bytes
-     */
-    void updateCapacity(long id, long capacity);
-
-    /**
-     * Set available bytes of storage pool in bytes
-     *
-     * @param id
-     *            pool id.
-     * @param available
-     *            available capacity in bytes
-     */
-    void updateAvailable(long id, long available);
-
-    StoragePoolVO persist(StoragePoolVO pool, Map<String, String> details);
-
-    /**
-     * Find pool by name.
-     *
-     * @param name
-     *            name of pool.
-     * @return the single StoragePoolVO
-     */
-    List<StoragePoolVO> findPoolByName(String name);
-
-    /**
-     * Find pools by the pod that matches the details.
-     *
-     * @param podId
-     *            pod id to find the pools in.
-     * @param details
-     *            details to match. All must match for the pool to be returned.
-     * @return List of StoragePoolVO
-     */
-    List<StoragePoolVO> findPoolsByDetails(long dcId, long podId, Long clusterId, Map<String, String> details,
-                                           ScopeType scope);
-
-    List<StoragePoolVO> findPoolsByTags(long dcId, long podId, Long clusterId, String[] tags);
-
-    /**
-     * Find pool by UUID.
-     *
-     * @param uuid
-     *            uuid of pool.
-     * @return the single StoragePoolVO
-     */
-    StoragePoolVO findPoolByUUID(String uuid);
-
-    List<StoragePoolVO> listByStorageHost(String hostFqdnOrIp);
-
-    StoragePoolVO findPoolByHostPath(long dcId, Long podId, String host, String path, String uuid);
-
-    List<StoragePoolVO> listPoolByHostPath(String host, String path);
-
-    void updateDetails(long poolId, Map<String, String> details);
-
-    Map<String, String> getDetails(long poolId);
-
-    List<String> searchForStoragePoolDetails(long poolId, String value);
-
-    List<StoragePoolVO> findIfDuplicatePoolsExistByUUID(String uuid);
-
-    List<StoragePoolVO> listByStatus(StoragePoolStatus status);
-
-    long countPoolsByStatus(StoragePoolStatus... statuses);
-
-    List<StoragePoolVO> listByStatusInZone(long dcId, StoragePoolStatus status);
-
-    List<StoragePoolVO> listPoolsByCluster(long clusterId);
-
-    List<StoragePoolVO> findLocalStoragePoolsByTags(long dcId, long podId, Long clusterId, String[] tags);
-
-    List<StoragePoolVO> findZoneWideStoragePoolsByTags(long dcId, String[] tags);
-
-    List<StoragePoolVO> findZoneWideStoragePoolsByHypervisor(long dataCenterId, HypervisorType hypervisorType);
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
deleted file mode 100644
index 1032526..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
+++ /dev/null
@@ -1,432 +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.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.ejb.Local;
-import javax.inject.Inject;
-import javax.naming.ConfigurationException;
-
-import com.cloud.host.Status;
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.storage.ScopeType;
-import com.cloud.storage.StoragePoolStatus;
-import com.cloud.utils.db.DB;
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.GenericSearchBuilder;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-import com.cloud.utils.db.SearchCriteria.Func;
-import com.cloud.utils.db.SearchCriteria.Op;
-import com.cloud.utils.db.SearchCriteria2;
-import com.cloud.utils.db.SearchCriteriaService;
-import com.cloud.utils.db.Transaction;
-import com.cloud.utils.exception.CloudRuntimeException;
-
-@Local(value = { PrimaryDataStoreDao.class })
-@DB(txn = false)
-public class PrimaryDataStoreDaoImpl extends GenericDaoBase<StoragePoolVO, Long> implements PrimaryDataStoreDao {
-    protected final SearchBuilder<StoragePoolVO> AllFieldSearch;
-    protected final SearchBuilder<StoragePoolVO> DcPodSearch;
-    protected final SearchBuilder<StoragePoolVO> DcPodAnyClusterSearch;
-    protected final SearchBuilder<StoragePoolVO> DeleteLvmSearch;
-    protected final GenericSearchBuilder<StoragePoolVO, Long> StatusCountSearch;
-
-    @Inject
-    protected StoragePoolDetailsDao _detailsDao;
-
-    private final String DetailsSqlPrefix = "SELECT storage_pool.* from storage_pool LEFT JOIN storage_pool_details ON storage_pool.id = storage_pool_details.pool_id WHERE storage_pool.removed is null and storage_pool.status = 'Up' and storage_pool.data_center_id = ? and (storage_pool.pod_id = ? or storage_pool.pod_id is null) and storage_pool.scope = ? and (";
-    private final String DetailsSqlSuffix = ") GROUP BY storage_pool_details.pool_id HAVING COUNT(storage_pool_details.name) >= ?";
-    private final String ZoneWideDetailsSqlPrefix = "SELECT storage_pool.* from storage_pool LEFT JOIN storage_pool_details ON storage_pool.id = storage_pool_details.pool_id WHERE storage_pool.removed is null and storage_pool.status = 'Up' and storage_pool.data_center_id = ? and storage_pool.scope = ? and (";
-    private final String ZoneWideDetailsSqlSuffix = ") GROUP BY storage_pool_details.pool_id HAVING COUNT(storage_pool_details.name) >= ?";
-
-    private final String FindPoolTagDetails = "SELECT storage_pool_details.name FROM storage_pool_details WHERE pool_id = ? and value = ?";
-
-    public PrimaryDataStoreDaoImpl() {
-        AllFieldSearch = createSearchBuilder();
-        AllFieldSearch.and("name", AllFieldSearch.entity().getName(), SearchCriteria.Op.EQ);
-        AllFieldSearch.and("uuid", AllFieldSearch.entity().getUuid(), SearchCriteria.Op.EQ);
-        AllFieldSearch.and("datacenterId", AllFieldSearch.entity().getDataCenterId(), SearchCriteria.Op.EQ);
-        AllFieldSearch.and("hostAddress", AllFieldSearch.entity().getHostAddress(), SearchCriteria.Op.EQ);
-        AllFieldSearch.and("status", AllFieldSearch.entity().getStatus(), SearchCriteria.Op.EQ);
-        AllFieldSearch.and("path", AllFieldSearch.entity().getPath(), SearchCriteria.Op.EQ);
-        AllFieldSearch.and("podId", AllFieldSearch.entity().getPodId(), Op.EQ);
-        AllFieldSearch.and("clusterId", AllFieldSearch.entity().getClusterId(), Op.EQ);
-        AllFieldSearch.done();
-
-        DcPodSearch = createSearchBuilder();
-        DcPodSearch.and("datacenterId", DcPodSearch.entity().getDataCenterId(), SearchCriteria.Op.EQ);
-        DcPodSearch.and("status", DcPodSearch.entity().getStatus(), SearchCriteria.Op.EQ);
-        DcPodSearch.and("scope", DcPodSearch.entity().getScope(), SearchCriteria.Op.EQ);
-        DcPodSearch.and().op("nullpod", DcPodSearch.entity().getPodId(), SearchCriteria.Op.NULL);
-        DcPodSearch.or("podId", DcPodSearch.entity().getPodId(), SearchCriteria.Op.EQ);
-        DcPodSearch.cp();
-        DcPodSearch.and().op("nullcluster", DcPodSearch.entity().getClusterId(), SearchCriteria.Op.NULL);
-        DcPodSearch.or("cluster", DcPodSearch.entity().getClusterId(), SearchCriteria.Op.EQ);
-        DcPodSearch.cp();
-        DcPodSearch.done();
-
-        DcPodAnyClusterSearch = createSearchBuilder();
-        DcPodAnyClusterSearch.and("datacenterId", DcPodAnyClusterSearch.entity().getDataCenterId(),
-                SearchCriteria.Op.EQ);
-        DcPodAnyClusterSearch.and("status", DcPodAnyClusterSearch.entity().getStatus(), SearchCriteria.Op.EQ);
-        DcPodAnyClusterSearch.and("scope", DcPodAnyClusterSearch.entity().getScope(), SearchCriteria.Op.EQ);
-        DcPodAnyClusterSearch.and().op("nullpod", DcPodAnyClusterSearch.entity().getPodId(), SearchCriteria.Op.NULL);
-        DcPodAnyClusterSearch.or("podId", DcPodAnyClusterSearch.entity().getPodId(), SearchCriteria.Op.EQ);
-        DcPodAnyClusterSearch.cp();
-        DcPodAnyClusterSearch.done();
-
-        DeleteLvmSearch = createSearchBuilder();
-        DeleteLvmSearch.and("ids", DeleteLvmSearch.entity().getId(), SearchCriteria.Op.IN);
-        DeleteLvmSearch.and().op("LVM", DeleteLvmSearch.entity().getPoolType(), SearchCriteria.Op.EQ);
-        DeleteLvmSearch.or("Filesystem", DeleteLvmSearch.entity().getPoolType(), SearchCriteria.Op.EQ);
-        DeleteLvmSearch.cp();
-        DeleteLvmSearch.done();
-
-        StatusCountSearch = createSearchBuilder(Long.class);
-        StatusCountSearch.and("status", StatusCountSearch.entity().getStatus(), SearchCriteria.Op.IN);
-        StatusCountSearch.select(null, Func.COUNT, null);
-        StatusCountSearch.done();
-
-    }
-
-    @Override
-    public List<StoragePoolVO> findPoolByName(String name) {
-        SearchCriteria<StoragePoolVO> sc = AllFieldSearch.create();
-        sc.setParameters("name", name);
-        return listIncludingRemovedBy(sc);
-    }
-
-    @Override
-    public StoragePoolVO findPoolByUUID(String uuid) {
-        SearchCriteria<StoragePoolVO> sc = AllFieldSearch.create();
-        sc.setParameters("uuid", uuid);
-        return findOneIncludingRemovedBy(sc);
-    }
-
-    @Override
-    public List<StoragePoolVO> findIfDuplicatePoolsExistByUUID(String uuid) {
-        SearchCriteria<StoragePoolVO> sc = AllFieldSearch.create();
-        sc.setParameters("uuid", uuid);
-        return listBy(sc);
-    }
-
-    @Override
-    public List<StoragePoolVO> listByDataCenterId(long datacenterId) {
-        SearchCriteria<StoragePoolVO> sc = AllFieldSearch.create();
-        sc.setParameters("datacenterId", datacenterId);
-        return listBy(sc);
-    }
-
-    @Override
-    public void updateAvailable(long id, long available) {
-        StoragePoolVO pool = createForUpdate(id);
-        pool.setUsedBytes(available);
-        update(id, pool);
-    }
-
-    @Override
-    public void updateCapacity(long id, long capacity) {
-        StoragePoolVO pool = createForUpdate(id);
-        pool.setCapacityBytes(capacity);
-        update(id, pool);
-
-    }
-
-    @Override
-    public List<StoragePoolVO> listByStorageHost(String hostFqdnOrIp) {
-        SearchCriteria<StoragePoolVO> sc = AllFieldSearch.create();
-        sc.setParameters("hostAddress", hostFqdnOrIp);
-        return listIncludingRemovedBy(sc);
-    }
-
-    @Override
-    public List<StoragePoolVO> listByStatus(StoragePoolStatus status) {
-        SearchCriteria<StoragePoolVO> sc = AllFieldSearch.create();
-        sc.setParameters("status", status);
-        return listBy(sc);
-    }
-
-    @Override
-    public List<StoragePoolVO> listByStatusInZone(long dcId, StoragePoolStatus status) {
-        SearchCriteria<StoragePoolVO> sc = AllFieldSearch.create();
-        sc.setParameters("status", status);
-        sc.setParameters("datacenterId", dcId);
-        return listBy(sc);
-    }
-
-    @Override
-    public StoragePoolVO findPoolByHostPath(long datacenterId, Long podId, String host, String path, String uuid) {
-        SearchCriteria<StoragePoolVO> sc = AllFieldSearch.create();
-        sc.setParameters("hostAddress", host);
-        sc.setParameters("path", path);
-        sc.setParameters("datacenterId", datacenterId);
-        sc.setParameters("podId", podId);
-        sc.setParameters("uuid", uuid);
-
-        return findOneBy(sc);
-    }
-
-    @Override
-    public List<StoragePoolVO> listBy(long datacenterId, Long podId, Long clusterId, ScopeType scope) {
-        if (clusterId != null) {
-            SearchCriteria<StoragePoolVO> sc = DcPodSearch.create();
-            sc.setParameters("datacenterId", datacenterId);
-            sc.setParameters("podId", podId);
-            sc.setParameters("status", Status.Up);
-            sc.setParameters("scope", scope);
-
-            sc.setParameters("cluster", clusterId);
-            return listBy(sc);
-        } else {
-            SearchCriteria<StoragePoolVO> sc = DcPodAnyClusterSearch.create();
-            sc.setParameters("datacenterId", datacenterId);
-            sc.setParameters("podId", podId);
-            sc.setParameters("status", Status.Up);
-            sc.setParameters("scope", scope);
-            return listBy(sc);
-        }
-    }
-
-    @Override
-    public List<StoragePoolVO> listPoolByHostPath(String host, String path) {
-        SearchCriteria<StoragePoolVO> sc = AllFieldSearch.create();
-        sc.setParameters("hostAddress", host);
-        sc.setParameters("path", path);
-
-        return listBy(sc);
-    }
-
-    public StoragePoolVO listById(Integer id) {
-        SearchCriteria<StoragePoolVO> sc = AllFieldSearch.create();
-        sc.setParameters("id", id);
-
-        return findOneIncludingRemovedBy(sc);
-    }
-
-    @Override
-    @DB
-    public StoragePoolVO persist(StoragePoolVO pool, Map<String, String> details) {
-        Transaction txn = Transaction.currentTxn();
-        txn.start();
-        pool = super.persist(pool);
-        if (details != null) {
-            for (Map.Entry<String, String> detail : details.entrySet()) {
-                StoragePoolDetailVO vo = new StoragePoolDetailVO(pool.getId(), detail.getKey(), detail.getValue());
-                _detailsDao.persist(vo);
-            }
-        }
-        txn.commit();
-        return pool;
-    }
-
-    @DB
-    @Override
-    public List<StoragePoolVO> findPoolsByDetails(long dcId, long podId, Long clusterId, Map<String, String> details,
-                                                  ScopeType scope) {
-        StringBuilder sql = new StringBuilder(DetailsSqlPrefix);
-        if (clusterId != null) {
-            sql.append("storage_pool.cluster_id = ? OR storage_pool.cluster_id IS NULL) AND (");
-        }
-
-        for (Map.Entry<String, String> detail : details.entrySet()) {
-            sql.append("((storage_pool_details.name='").append(detail.getKey())
-                    .append("') AND (storage_pool_details.value='").append(detail.getValue()).append("')) OR ");
-        }
-        sql.delete(sql.length() - 4, sql.length());
-        sql.append(DetailsSqlSuffix);
-        Transaction txn = Transaction.currentTxn();
-        PreparedStatement pstmt = null;
-        try {
-            pstmt = txn.prepareAutoCloseStatement(sql.toString());
-            int i = 1;
-            pstmt.setLong(i++, dcId);
-            pstmt.setLong(i++, podId);
-            pstmt.setString(i++, scope.toString());
-            if (clusterId != null) {
-                pstmt.setLong(i++, clusterId);
-            }
-            pstmt.setInt(i++, details.size());
-            ResultSet rs = pstmt.executeQuery();
-            List<StoragePoolVO> pools = new ArrayList<StoragePoolVO>();
-            while (rs.next()) {
-                pools.add(toEntityBean(rs, false));
-            }
-            return pools;
-        } catch (SQLException e) {
-            throw new CloudRuntimeException("Unable to execute " + pstmt, e);
-        }
-    }
-
-    protected Map<String, String> tagsToDetails(String[] tags) {
-        Map<String, String> details = new HashMap<String, String>(tags.length);
-        for (String tag : tags) {
-            details.put(tag, "true");
-        }
-        return details;
-    }
-
-    @Override
-    public List<StoragePoolVO> findPoolsByTags(long dcId, long podId, Long clusterId, String[] tags) {
-        List<StoragePoolVO> storagePools = null;
-        if (tags == null || tags.length == 0) {
-            storagePools = listBy(dcId, podId, clusterId, ScopeType.CLUSTER);
-        } else {
-            Map<String, String> details = tagsToDetails(tags);
-            storagePools = findPoolsByDetails(dcId, podId, clusterId, details, ScopeType.CLUSTER);
-        }
-
-        return storagePools;
-    }
-
-    @Override
-    public List<StoragePoolVO> findLocalStoragePoolsByTags(long dcId, long podId, Long clusterId, String[] tags) {
-        List<StoragePoolVO> storagePools = null;
-        if (tags == null || tags.length == 0) {
-            storagePools = listBy(dcId, podId, clusterId, ScopeType.HOST);
-        } else {
-            Map<String, String> details = tagsToDetails(tags);
-            storagePools = findPoolsByDetails(dcId, podId, clusterId, details, ScopeType.HOST);
-        }
-
-        return storagePools;
-    }
-
-    @Override
-    public List<StoragePoolVO> findZoneWideStoragePoolsByTags(long dcId, String[] tags) {
-        List<StoragePoolVO> storagePools = null;
-        if (tags == null || tags.length == 0) {
-            SearchCriteriaService<StoragePoolVO, StoragePoolVO> sc = SearchCriteria2.create(StoragePoolVO.class);
-            sc.addAnd(sc.getEntity().getDataCenterId(), Op.EQ, dcId);
-            sc.addAnd(sc.getEntity().getStatus(), Op.EQ, Status.Up);
-            sc.addAnd(sc.getEntity().getScope(), Op.EQ, ScopeType.ZONE);
-            return sc.list();
-        } else {
-            Map<String, String> details = tagsToDetails(tags);
-
-            StringBuilder sql = new StringBuilder(ZoneWideDetailsSqlPrefix);
-
-            for (Map.Entry<String, String> detail : details.entrySet()) {
-                sql.append("((storage_pool_details.name='").append(detail.getKey())
-                        .append("') AND (storage_pool_details.value='").append(detail.getValue()).append("')) OR ");
-            }
-            sql.delete(sql.length() - 4, sql.length());
-            sql.append(ZoneWideDetailsSqlSuffix);
-            Transaction txn = Transaction.currentTxn();
-            PreparedStatement pstmt = null;
-            try {
-                pstmt = txn.prepareAutoCloseStatement(sql.toString());
-                int i = 1;
-                pstmt.setLong(i++, dcId);
-                pstmt.setString(i++, ScopeType.ZONE.toString());
-                pstmt.setInt(i++, details.size());
-                ResultSet rs = pstmt.executeQuery();
-                List<StoragePoolVO> pools = new ArrayList<StoragePoolVO>();
-                while (rs.next()) {
-                    pools.add(toEntityBean(rs, false));
-                }
-                return pools;
-            } catch (SQLException e) {
-                throw new CloudRuntimeException("Unable to execute " + pstmt, e);
-            }
-        }
-    }
-
-    @Override
-    @DB
-    public List<String> searchForStoragePoolDetails(long poolId, String value) {
-
-        StringBuilder sql = new StringBuilder(FindPoolTagDetails);
-
-        Transaction txn = Transaction.currentTxn();
-        PreparedStatement pstmt = null;
-        try {
-            pstmt = txn.prepareAutoCloseStatement(sql.toString());
-            pstmt.setLong(1, poolId);
-            pstmt.setString(2, value);
-
-            ResultSet rs = pstmt.executeQuery();
-            List<String> tags = new ArrayList<String>();
-
-            while (rs.next()) {
-                tags.add(rs.getString("name"));
-            }
-            return tags;
-        } catch (SQLException e) {
-            throw new CloudRuntimeException("Unable to execute " + pstmt.toString(), e);
-        }
-
-    }
-
-    @Override
-    public void updateDetails(long poolId, Map<String, String> details) {
-        if (details != null) {
-            _detailsDao.update(poolId, details);
-        }
-    }
-
-    @Override
-    public Map<String, String> getDetails(long poolId) {
-        return _detailsDao.getDetails(poolId);
-    }
-
-    @Override
-    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-        super.configure(name, params);
-        _detailsDao.configure("DetailsDao", params);
-        return true;
-    }
-
-    @Override
-    public long countPoolsByStatus(StoragePoolStatus... statuses) {
-        SearchCriteria<Long> sc = StatusCountSearch.create();
-
-        sc.setParameters("status", (Object[]) statuses);
-
-        List<Long> rs = customSearchIncludingRemoved(sc, null);
-        if (rs.size() == 0) {
-            return 0;
-        }
-
-        return rs.get(0);
-    }
-
-    @Override
-    public List<StoragePoolVO> listPoolsByCluster(long clusterId) {
-        SearchCriteria<StoragePoolVO> sc = AllFieldSearch.create();
-        sc.setParameters("clusterId", clusterId);
-
-        return listBy(sc);
-    }
-
-    @Override
-    public List<StoragePoolVO> findZoneWideStoragePoolsByHypervisor(long dataCenterId, HypervisorType hypervisorType) {
-        SearchCriteriaService<StoragePoolVO, StoragePoolVO> sc =  SearchCriteria2.create(StoragePoolVO.class);
-        sc.addAnd(sc.getEntity().getDataCenterId(), Op.EQ, dataCenterId);
-        sc.addAnd(sc.getEntity().getStatus(), Op.EQ, Status.Up);
-        sc.addAnd(sc.getEntity().getScope(), Op.EQ, ScopeType.ZONE);
-        sc.addAnd(sc.getEntity().getHypervisor(), Op.EQ, hypervisorType);
-        return sc.list();
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDetailVO.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDetailVO.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDetailVO.java
deleted file mode 100644
index 0d9af4b..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDetailVO.java
+++ /dev/null
@@ -1,79 +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 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 = "storage_pool_details")
-public class PrimaryDataStoreDetailVO {
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Column(name = "id")
-    long id;
-
-    @Column(name = "pool_id")
-    long poolId;
-
-    @Column(name = "name")
-    String name;
-
-    @Column(name = "value")
-    String value;
-
-    public PrimaryDataStoreDetailVO(long poolId, String name, String value) {
-        this.poolId = poolId;
-        this.name = name;
-        this.value = value;
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public long getPoolId() {
-        return poolId;
-    }
-
-    public void setPoolId(long poolId) {
-        this.poolId = poolId;
-    }
-
-    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 PrimaryDataStoreDetailVO() {
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDetailsDao.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDetailsDao.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDetailsDao.java
deleted file mode 100644
index 18e2f1c..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDetailsDao.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 PrimaryDataStoreDetailsDao extends GenericDao<PrimaryDataStoreDetailVO, Long> {
-
-    void update(long poolId, Map<String, String> details);
-
-    Map<String, String> getDetails(long poolId);
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreDao.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreDao.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreDao.java
deleted file mode 100644
index f903715..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreDao.java
+++ /dev/null
@@ -1,43 +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.List;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine;
-
-import com.cloud.storage.DataStoreRole;
-import com.cloud.utils.db.GenericDao;
-import com.cloud.utils.fsm.StateDao;
-
-public interface SnapshotDataStoreDao extends GenericDao<SnapshotDataStoreVO, Long>,
-StateDao<ObjectInDataStoreStateMachine.State, ObjectInDataStoreStateMachine.Event, DataObjectInStore> {
-
-    List<SnapshotDataStoreVO> listByStoreId(long id, DataStoreRole role);
-
-    List<SnapshotDataStoreVO> listActiveOnCache(long id);
-
-    void deletePrimaryRecordsForStore(long id, DataStoreRole role);
-
-    SnapshotDataStoreVO findByStoreSnapshot(DataStoreRole role, long storeId, long snapshotId);
-    SnapshotDataStoreVO findParent(DataStoreRole role, Long storeId, Long volumeId);
-
-    SnapshotDataStoreVO findBySnapshot(long snapshotId, DataStoreRole role);
-
-    List<SnapshotDataStoreVO> listDestroyed(long storeId);
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java
deleted file mode 100644
index 300df1e..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/SnapshotDataStoreVO.java
+++ /dev/null
@@ -1,271 +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.Date;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine;
-import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine.State;
-
-import com.cloud.storage.DataStoreRole;
-import com.cloud.utils.db.GenericDao;
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.fsm.StateObject;
-
-/**
- * Join table for image_data_store and snapshots
- * 
- */
-@Entity
-@Table(name = "snapshot_store_ref")
-public class SnapshotDataStoreVO implements StateObject<ObjectInDataStoreStateMachine.State>, DataObjectInStore {
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    Long id;
-
-    @Column(name = "store_id")
-    private long dataStoreId;
-
-    @Column(name = "store_role")
-    @Enumerated(EnumType.STRING)
-    private DataStoreRole role;
-
-    @Column(name = "snapshot_id")
-    private long snapshotId;
-
-    @Column(name = GenericDaoBase.CREATED_COLUMN)
-    private Date created = null;
-
-    @Column(name = "last_updated")
-    @Temporal(value = TemporalType.TIMESTAMP)
-    private Date lastUpdated = null;
-
-    @Column(name = "size")
-    private long size;
-
-    @Column(name = "physical_size")
-    private long physicalSize;
-
-    @Column(name = "parent_snapshot_id")
-    private long parentSnapshotId;
-
-    @Column(name = "job_id")
-    private String jobId;
-
-    @Column(name = "install_path")
-    private String installPath;
-
-    @Column(name = "update_count", updatable = true, nullable = false)
-    protected long updatedCount;
-
-    @Column(name = "updated")
-    @Temporal(value = TemporalType.TIMESTAMP)
-    Date updated;
-
-    @Column(name = "state")
-    @Enumerated(EnumType.STRING)
-    ObjectInDataStoreStateMachine.State state;
-
-    @Column(name = "ref_cnt")
-    Long refCnt = 0L;
-
-    @Column(name = "volume_id")
-    Long volumeId;
-
-    public String getInstallPath() {
-        return installPath;
-    }
-
-    @Override
-    public long getDataStoreId() {
-        return dataStoreId;
-    }
-
-    public void setDataStoreId(long storeId) {
-        this.dataStoreId = storeId;
-    }
-
-    public long getSnapshotId() {
-        return snapshotId;
-    }
-
-    public void setSnapshotId(long snapshotId) {
-        this.snapshotId = snapshotId;
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public Date getCreated() {
-        return created;
-    }
-
-    public Date getLastUpdated() {
-        return lastUpdated;
-    }
-
-    public void setLastUpdated(Date date) {
-        lastUpdated = date;
-    }
-
-    public void setInstallPath(String installPath) {
-        this.installPath = installPath;
-    }
-
-    public SnapshotDataStoreVO(long hostId, long snapshotId) {
-        super();
-        this.dataStoreId = hostId;
-        this.snapshotId = snapshotId;
-        this.state = ObjectInDataStoreStateMachine.State.Allocated;
-    }
-
-    public SnapshotDataStoreVO() {
-
-    }
-
-    public void setJobId(String jobId) {
-        this.jobId = jobId;
-    }
-
-    public String getJobId() {
-        return jobId;
-    }
-
-    public boolean equals(Object obj) {
-        if (obj instanceof SnapshotDataStoreVO) {
-            SnapshotDataStoreVO other = (SnapshotDataStoreVO) obj;
-            return (this.snapshotId == other.getSnapshotId() && this.dataStoreId == other.getDataStoreId());
-        }
-        return false;
-    }
-
-    public int hashCode() {
-        Long tid = new Long(snapshotId);
-        Long hid = new Long(dataStoreId);
-        return tid.hashCode() + hid.hashCode();
-    }
-
-    public void setSize(long size) {
-        this.size = size;
-    }
-
-    public long getSize() {
-        return size;
-    }
-
-    public void setPhysicalSize(long physicalSize) {
-        this.physicalSize = physicalSize;
-    }
-
-    public long getPhysicalSize() {
-        return physicalSize;
-    }
-
-    public long getVolumeSize() {
-        return -1;
-    }
-
-    public String toString() {
-        return new StringBuilder("VolumeHost[").append(id).append("-").append(snapshotId).append("-")
-                .append(dataStoreId).append(installPath).append("]").toString();
-    }
-
-    public long getUpdatedCount() {
-        return this.updatedCount;
-    }
-
-    public void incrUpdatedCount() {
-        this.updatedCount++;
-    }
-
-    public void decrUpdatedCount() {
-        this.updatedCount--;
-    }
-
-    public Date getUpdated() {
-        return updated;
-    }
-
-    @Override
-    public ObjectInDataStoreStateMachine.State getState() {
-        // TODO Auto-generated method stub
-        return this.state;
-    }
-
-    public void setState(ObjectInDataStoreStateMachine.State state) {
-        this.state = state;
-    }
-
-    @Override
-    public long getObjectId() {
-        return this.getSnapshotId();
-    }
-
-    public DataStoreRole getRole() {
-        return role;
-    }
-
-    public void setRole(DataStoreRole role) {
-        this.role = role;
-    }
-
-    @Override
-    public State getObjectInStoreState() {
-        return this.state;
-    }
-
-    public long getParentSnapshotId() {
-        return parentSnapshotId;
-    }
-
-    public void setParentSnapshotId(long parentSnapshotId) {
-        this.parentSnapshotId = parentSnapshotId;
-    }
-
-    public Long getRefCnt() {
-        return refCnt;
-    }
-
-    public void incrRefCnt() {
-        this.refCnt++;
-    }
-
-    public void decrRefCnt() {
-        this.refCnt--;
-    }
-
-    public Long getVolumeId() {
-        return volumeId;
-    }
-
-    public void setVolumeId(Long volumeId) {
-        this.volumeId = volumeId;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailVO.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailVO.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailVO.java
deleted file mode 100644
index e51f3a3..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailVO.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 = "storage_pool_details")
-public class StoragePoolDetailVO implements InternalIdentity {
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Column(name = "id")
-    long id;
-
-    @Column(name = "pool_id")
-    long poolId;
-
-    @Column(name = "name")
-    String name;
-
-    @Column(name = "value")
-    String value;
-
-    public StoragePoolDetailVO(long poolId, String name, String value) {
-        this.poolId = poolId;
-        this.name = name;
-        this.value = value;
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public long getPoolId() {
-        return poolId;
-    }
-
-    public void setPoolId(long poolId) {
-        this.poolId = poolId;
-    }
-
-    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 StoragePoolDetailVO() {
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailsDao.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailsDao.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailsDao.java
deleted file mode 100644
index 49f4f19..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailsDao.java
+++ /dev/null
@@ -1,30 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package org.apache.cloudstack.storage.datastore.db;
-
-import java.util.Map;
-
-import com.cloud.utils.db.GenericDao;
-
-public interface StoragePoolDetailsDao extends GenericDao<StoragePoolDetailVO, Long> {
-
-    void update(long poolId, Map<String, String> details);
-
-    Map<String, String> getDetails(long poolId);
-
-    StoragePoolDetailVO findDetail(long poolId, String name);
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
deleted file mode 100644
index 941b952..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/StoragePoolVO.java
+++ /dev/null
@@ -1,346 +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.Date;
-import java.util.UUID;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.TableGenerator;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-
-import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.storage.Storage.StoragePoolType;
-import com.cloud.storage.ScopeType;
-import com.cloud.storage.StoragePool;
-import com.cloud.storage.StoragePoolStatus;
-import com.cloud.utils.db.GenericDao;
-
-@Entity
-@Table(name = "storage_pool")
-public class StoragePoolVO implements StoragePool {
-    @Id
-    @TableGenerator(name = "storage_pool_sq", table = "sequence", pkColumnName = "name", valueColumnName = "value",
-            pkColumnValue = "storage_pool_seq", allocationSize = 1)
-    @Column(name = "id", updatable = false, nullable = false)
-    private long id;
-
-    @Column(name = "name", updatable = false, nullable = false, length = 255)
-    private String name = null;
-
-    @Column(name = "uuid", length = 255)
-    private String uuid = null;
-
-    @Column(name = "pool_type", updatable = false, nullable = false, length = 32)
-    @Enumerated(value = EnumType.STRING)
-    private StoragePoolType poolType;
-
-    @Column(name = GenericDao.CREATED_COLUMN)
-    Date created;
-
-    @Column(name = GenericDao.REMOVED_COLUMN)
-    private Date removed;
-
-    @Column(name = "update_time", updatable = true)
-    @Temporal(value = TemporalType.TIMESTAMP)
-    private Date updateTime;
-
-    @Column(name = "data_center_id", updatable = true, nullable = false)
-    private long dataCenterId;
-
-    @Column(name = "pod_id", updatable = true)
-    private Long podId;
-
-    @Column(name = "used_bytes", updatable = true, nullable = true)
-    private long usedBytes;
-
-    @Column(name = "capacity_bytes", updatable = true, nullable = true)
-    private long capacityBytes;
-
-    @Column(name = "status", updatable = true, nullable = false)
-    @Enumerated(value = EnumType.STRING)
-    private StoragePoolStatus status;
-
-    @Column(name = "storage_provider_name", updatable = true, nullable = false)
-    private String storageProviderName;
-
-    @Column(name = "host_address")
-    private String hostAddress;
-
-    @Column(name = "path")
-    private String path;
-
-    @Column(name = "port")
-    private int port;
-
-    @Column(name = "user_info")
-    private String userInfo;
-
-    @Column(name = "cluster_id")
-    private Long clusterId;
-
-    @Column(name = "scope")
-    @Enumerated(value = EnumType.STRING)
-    private ScopeType scope;
-
-    @Column(name = "managed")
-    private boolean managed;
-
-    @Column(name = "capacity_iops", updatable = true, nullable = true)
-    private Long capacityIops;
-
-    @Column(name = "hypervisor")
-    @Enumerated(value = EnumType.STRING)
-    private HypervisorType hypervisor;
-
-    public long getId() {
-        return id;
-    }
-
-    public StoragePoolStatus getStatus() {
-        return status;
-    }
-
-    public StoragePoolVO() {
-        this.status = StoragePoolStatus.Initial;
-    }
-
-    public StoragePoolVO(long poolId, String name, String uuid, StoragePoolType type, long dataCenterId, Long podId,
-            long availableBytes, long capacityBytes, String hostAddress, int port, String hostPath) {
-        this.name = name;
-        this.id = poolId;
-        this.uuid = uuid;
-        this.poolType = type;
-        this.dataCenterId = dataCenterId;
-        this.usedBytes = availableBytes;
-        this.capacityBytes = capacityBytes;
-        this.hostAddress = hostAddress;
-        this.path = hostPath;
-        this.port = port;
-        this.podId = podId;
-        this.setStatus(StoragePoolStatus.Initial);
-    }
-
-    public StoragePoolVO(StoragePoolVO that) {
-        this(that.id, that.name, that.uuid, that.poolType, that.dataCenterId, that.podId, that.usedBytes,
-                that.capacityBytes, that.hostAddress, that.port, that.path);
-    }
-
-    public StoragePoolVO(StoragePoolType type, String hostAddress, int port, String path) {
-        this.poolType = type;
-        this.hostAddress = hostAddress;
-        this.port = port;
-        this.path = path;
-        this.setStatus(StoragePoolStatus.Initial);
-        this.uuid = UUID.randomUUID().toString();
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public String getUuid() {
-        return uuid;
-    }
-
-    public StoragePoolType getPoolType() {
-        return poolType;
-    }
-
-    public void setPoolType(StoragePoolType protocol) {
-        this.poolType = protocol;
-    }
-
-    public Date getCreated() {
-        return created;
-    }
-
-    public Date getRemoved() {
-        return removed;
-    }
-
-    public Date getUpdateTime() {
-        return updateTime;
-    }
-
-    public long getDataCenterId() {
-        return dataCenterId;
-    }
-
-    public long getUsedBytes() {
-        return usedBytes;
-    }
-
-    public String getStorageProviderName() {
-        return storageProviderName;
-    }
-
-    public void setStorageProviderName(String providerName) {
-        storageProviderName = providerName;
-    }
-
-    public long getCapacityBytes() {
-        return capacityBytes;
-    }
-
-    public void setUsedBytes(long usedBytes) {
-        this.usedBytes = usedBytes;
-    }
-
-    public void setCapacityBytes(long capacityBytes) {
-        this.capacityBytes = capacityBytes;
-    }
-
-    public void setManaged(boolean managed) {
-    	this.managed = managed;
-    }
-
-    public boolean isManaged() {
-    	return managed;
-    }
-
-    public void setCapacityIops(Long capacityIops) {
-        this.capacityIops = capacityIops;
-    }
-
-    public Long getCapacityIops() {
-        return capacityIops;
-    }
-
-    public Long getClusterId() {
-        return clusterId;
-    }
-
-    public void setClusterId(Long clusterId) {
-        this.clusterId = clusterId;
-    }
-
-    public String getHostAddress() {
-        return hostAddress;
-    }
-
-    public void setHostAddress(String host) {
-        this.hostAddress = host;
-    }
-
-    public String getPath() {
-        return path;
-    }
-
-    public String getUserInfo() {
-        return userInfo;
-    }
-
-    public void setStatus(StoragePoolStatus status) {
-        this.status = status;
-    }
-
-    public void setId(long id) {
-        this.id = id;
-    }
-
-    public void setDataCenterId(long dcId) {
-        this.dataCenterId = dcId;
-    }
-
-    public void setPodId(Long podId) {
-        this.podId = podId;
-    }
-
-    public void setUuid(String uuid) {
-        this.uuid = uuid;
-    }
-
-    public void setPath(String path) {
-        this.path = path;
-    }
-
-    public void setUserInfo(String userInfo) {
-        this.userInfo = userInfo;
-    }
-
-    public int getPort() {
-        return port;
-    }
-
-    public void setPort(int port) {
-        this.port = port;
-    }
-
-    public Long getPodId() {
-        return podId;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public void setScope(ScopeType scope) {
-        this.scope = scope;
-    }
-
-    public ScopeType getScope() {
-        return this.scope;
-    }
-
-    public HypervisorType getHypervisor() {
-        return hypervisor;
-    }
-
-    public void setHypervisor(HypervisorType hypervisor) {
-        this.hypervisor = hypervisor;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (!(obj instanceof StoragePoolVO) || obj == null) {
-            return false;
-        }
-        StoragePoolVO that = (StoragePoolVO) obj;
-        return this.id == that.id;
-    }
-
-    @Override
-    public int hashCode() {
-        return new Long(id).hashCode();
-    }
-
-    @Override
-    public String toString() {
-        return new StringBuilder("Pool[").append(id).append("|").append(poolType).append("]").toString();
-    }
-
-    public boolean isShared() {
-        return this.scope == ScopeType.HOST ? false : true;
-    }
-
-    public boolean isLocal() {
-        return !isShared();
-    }
-
-    @Override
-    public boolean isInMaintenance() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreDao.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreDao.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreDao.java
deleted file mode 100644
index 9350751..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreDao.java
+++ /dev/null
@@ -1,65 +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.List;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine.State;
-import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine;
-
-import com.cloud.storage.DataStoreRole;
-import com.cloud.storage.VMTemplateStorageResourceAssoc;
-import com.cloud.utils.db.GenericDao;
-import com.cloud.utils.fsm.StateDao;
-
-public interface TemplateDataStoreDao extends GenericDao<TemplateDataStoreVO, Long>,
-StateDao<ObjectInDataStoreStateMachine.State, ObjectInDataStoreStateMachine.Event, DataObjectInStore> {
-
-    List<TemplateDataStoreVO> listByStoreId(long id);
-
-    List<TemplateDataStoreVO> listDestroyed(long storeId);
-
-    List<TemplateDataStoreVO> listActiveOnCache(long id);
-
-    void deletePrimaryRecordsForStore(long id);
-
-    void deletePrimaryRecordsForTemplate(long templateId);
-
-    List<TemplateDataStoreVO> listByTemplateStore(long templateId, long storeId);
-
-    List<TemplateDataStoreVO> listByTemplateStoreStatus(long templateId, long storeId, State... states);
-
-    List<TemplateDataStoreVO> listByTemplateStoreDownloadStatus(long templateId, long storeId,
-            VMTemplateStorageResourceAssoc.Status... status);
-
-    List<TemplateDataStoreVO> listByTemplateZoneDownloadStatus(long templateId, Long zoneId,
-            VMTemplateStorageResourceAssoc.Status... status);
-
-    TemplateDataStoreVO findByTemplateZoneDownloadStatus(long templateId, Long zoneId,
-            VMTemplateStorageResourceAssoc.Status... status);
-
-    TemplateDataStoreVO findByStoreTemplate(long storeId, long templateId);
-
-    TemplateDataStoreVO findByStoreTemplate(long storeId, long templateId, boolean lock);
-
-    TemplateDataStoreVO findByTemplate(long templateId, DataStoreRole role);
-
-    TemplateDataStoreVO findByTemplateZone(long templateId, Long zoneId, DataStoreRole role);
-
-    List<TemplateDataStoreVO> listByTemplate(long templateId);
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a4cea4eb/engine/api/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreVO.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreVO.java b/engine/api/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreVO.java
deleted file mode 100755
index b6af559..0000000
--- a/engine/api/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreVO.java
+++ /dev/null
@@ -1,372 +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.Date;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.EnumType;
-import javax.persistence.Enumerated;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Table;
-import javax.persistence.Temporal;
-import javax.persistence.TemporalType;
-
-import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine;
-import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine.State;
-
-import com.cloud.storage.DataStoreRole;
-import com.cloud.storage.VMTemplateStorageResourceAssoc.Status;
-
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.fsm.StateObject;
-
-/**
- * Join table for image_data_store and templates
- * 
- */
-@Entity
-@Table(name = "template_store_ref")
-public class TemplateDataStoreVO implements StateObject<ObjectInDataStoreStateMachine.State>, DataObjectInStore {
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    Long id;
-
-    @Column(name = "store_id")
-    private Long dataStoreId; // this can be null for baremetal templates
-
-    @Column(name = "template_id")
-    private long templateId;
-
-    @Column(name = "store_role")
-    @Enumerated(EnumType.STRING)
-    private DataStoreRole dataStoreRole;
-
-    @Column(name = GenericDaoBase.CREATED_COLUMN)
-    private Date created = null;
-
-    @Column(name = "last_updated")
-    @Temporal(value = TemporalType.TIMESTAMP)
-    private Date lastUpdated = null;
-
-    @Column(name = "download_pct")
-    private int downloadPercent;
-
-    @Column(name = "size")
-    private Long size;
-
-    @Column(name = "physical_size")
-    private long physicalSize;
-
-    @Column(name = "download_state")
-    @Enumerated(EnumType.STRING)
-    private Status downloadState;
-
-    @Column(name = "local_path")
-    private String localDownloadPath;
-
-    @Column(name = "error_str")
-    private String errorString;
-
-    @Column(name = "job_id")
-    private String jobId;
-
-    @Column(name = "install_path")
-    private String installPath;
-
-    @Column(name = "url")
-    private String downloadUrl;
-
-    @Column(name = "is_copy")
-    private boolean isCopy = false;
-
-    @Column(name = "destroyed")
-    boolean destroyed = false;
-
-    @Column(name = "update_count", updatable = true, nullable = false)
-    protected long updatedCount;
-
-    @Column(name = "updated")
-    @Temporal(value = TemporalType.TIMESTAMP)
-    Date updated;
-
-    @Column(name = "state")
-    @Enumerated(EnumType.STRING)
-    ObjectInDataStoreStateMachine.State state;
-
-    @Column(name = "ref_cnt")
-    Long refCnt = 0L;
-
-    public TemplateDataStoreVO(Long hostId, long templateId) {
-        super();
-        this.dataStoreId = hostId;
-        this.templateId = templateId;
-        this.state = ObjectInDataStoreStateMachine.State.Allocated;
-        this.refCnt = 0L;
-    }
-
-    public TemplateDataStoreVO(Long hostId, long templateId, Date lastUpdated, int downloadPercent,
-            Status downloadState, String localDownloadPath, String errorString, String jobId, String installPath,
-            String downloadUrl) {
-        super();
-        this.dataStoreId = hostId;
-        this.templateId = templateId;
-        this.lastUpdated = lastUpdated;
-        this.downloadPercent = downloadPercent;
-        this.downloadState = downloadState;
-        this.localDownloadPath = localDownloadPath;
-        this.errorString = errorString;
-        this.jobId = jobId;
-        this.refCnt = 0L;
-        this.installPath = installPath;
-        this.setDownloadUrl(downloadUrl);
-        switch (downloadState) {
-        case DOWNLOADED:
-            this.state = ObjectInDataStoreStateMachine.State.Ready;
-            break;
-        case CREATING:
-        case DOWNLOAD_IN_PROGRESS:
-        case UPLOAD_IN_PROGRESS:
-            this.state = ObjectInDataStoreStateMachine.State.Creating2;
-            break;
-        case DOWNLOAD_ERROR:
-        case UPLOAD_ERROR:
-            this.state = ObjectInDataStoreStateMachine.State.Failed;
-            break;
-        case ABANDONED:
-            this.state = ObjectInDataStoreStateMachine.State.Destroyed;
-            break;
-        default:
-            this.state = ObjectInDataStoreStateMachine.State.Allocated;
-            break;
-        }
-    }
-
-    public TemplateDataStoreVO() {
-        this.refCnt = 0L;
-    }
-
-    @Override
-    public String getInstallPath() {
-        return installPath;
-    }
-
-    @Override
-    public long getDataStoreId() {
-        return dataStoreId;
-    }
-
-    public void setDataStoreId(long storeId) {
-        this.dataStoreId = storeId;
-    }
-
-    public long getTemplateId() {
-        return templateId;
-    }
-
-    public void setTemplateId(long templateId) {
-        this.templateId = templateId;
-    }
-
-    public int getDownloadPercent() {
-        return downloadPercent;
-    }
-
-    public void setDownloadPercent(int downloadPercent) {
-        this.downloadPercent = downloadPercent;
-    }
-
-    public void setDownloadState(Status downloadState) {
-        this.downloadState = downloadState;
-    }
-
-    public long getId() {
-        return id;
-    }
-
-    public Date getCreated() {
-        return created;
-    }
-
-    public Date getLastUpdated() {
-        return lastUpdated;
-    }
-
-    public void setLastUpdated(Date date) {
-        lastUpdated = date;
-    }
-
-    @Override
-    public void setInstallPath(String installPath) {
-        this.installPath = installPath;
-    }
-
-    public Status getDownloadState() {
-        return downloadState;
-    }
-
-    public void setLocalDownloadPath(String localPath) {
-        this.localDownloadPath = localPath;
-    }
-
-    public String getLocalDownloadPath() {
-        return localDownloadPath;
-    }
-
-    public void setErrorString(String errorString) {
-        this.errorString = errorString;
-    }
-
-    public String getErrorString() {
-        return errorString;
-    }
-
-    public void setJobId(String jobId) {
-        this.jobId = jobId;
-    }
-
-    public String getJobId() {
-        return jobId;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof TemplateDataStoreVO) {
-            TemplateDataStoreVO other = (TemplateDataStoreVO) obj;
-            return (this.templateId == other.getTemplateId() && this.dataStoreId == other.getDataStoreId());
-        }
-        return false;
-    }
-
-    @Override
-    public int hashCode() {
-        Long tid = new Long(templateId);
-        Long hid = new Long(dataStoreId);
-        return tid.hashCode() + hid.hashCode();
-    }
-
-    public void setSize(Long size) {
-        this.size = size;
-    }
-
-    public long getSize() {
-        return size;
-    }
-
-    public void setPhysicalSize(long physicalSize) {
-        this.physicalSize = physicalSize;
-    }
-
-    public long getPhysicalSize() {
-        return physicalSize;
-    }
-
-    public void setDestroyed(boolean destroyed) {
-        this.destroyed = destroyed;
-    }
-
-    public boolean getDestroyed() {
-        return destroyed;
-    }
-
-    public void setDownloadUrl(String downloadUrl) {
-        this.downloadUrl = downloadUrl;
-    }
-
-    public String getDownloadUrl() {
-        return downloadUrl;
-    }
-
-    public void setCopy(boolean isCopy) {
-        this.isCopy = isCopy;
-    }
-
-    public boolean isCopy() {
-        return isCopy;
-    }
-
-    public long getTemplateSize() {
-        return -1;
-    }
-
-    @Override
-    public String toString() {
-        return new StringBuilder("TmplHost[").append(id).append("-").append(templateId).append("-").append(dataStoreId)
-                .append(installPath).append("]").toString();
-    }
-
-    @Override
-    public ObjectInDataStoreStateMachine.State getState() {
-        // TODO Auto-generated method stub
-        return this.state;
-    }
-
-    public void setState(ObjectInDataStoreStateMachine.State state) {
-        this.state = state;
-    }
-
-    public long getUpdatedCount() {
-        return this.updatedCount;
-    }
-
-    public void incrUpdatedCount() {
-        this.updatedCount++;
-    }
-
-    public void decrUpdatedCount() {
-        this.updatedCount--;
-    }
-
-    public Date getUpdated() {
-        return updated;
-    }
-
-    @Override
-    public long getObjectId() {
-        return this.getTemplateId();
-    }
-
-    @Override
-    public State getObjectInStoreState() {
-        return this.state;
-    }
-
-    public DataStoreRole getDataStoreRole() {
-        return dataStoreRole;
-    }
-
-    public void setDataStoreRole(DataStoreRole dataStoreRole) {
-        this.dataStoreRole = dataStoreRole;
-    }
-
-    public Long getRefCnt() {
-        return refCnt;
-    }
-
-    public void incrRefCnt() {
-        this.refCnt++;
-    }
-
-    public void decrRefCnt() {
-        this.refCnt--;
-    }
-
-}


Mime
View raw message