cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject git commit: updated refs/heads/master to 591dcd1
Date Tue, 29 Oct 2013 16:40:17 GMT
Updated Branches:
  refs/heads/master 30aea0b30 -> 591dcd1d1


ResourceDetails: added "display" field to a bunch of VOs - determines whether the detail should be returned to the regular user


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

Branch: refs/heads/master
Commit: 591dcd1d1c3c9e547631610bcee79a5f5120b661
Parents: 30aea0b
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Mon Oct 28 16:01:56 2013 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Tue Oct 29 09:18:11 2013 -0700

----------------------------------------------------------------------
 .../cloud/server/ResourceMetaDataService.java   |  7 +--
 .../org/apache/cloudstack/api/ApiConstants.java |  1 +
 .../apache/cloudstack/api/ResourceDetail.java   |  2 +
 .../user/volume/ListResourceDetailsCmd.java     | 41 +++++++++++-----
 .../api/response/ResourceDetailResponse.java    | 15 +++---
 .../apache/cloudstack/query/QueryService.java   |  2 +-
 client/tomcatconf/commands.properties.in        |  2 +-
 .../com/cloud/vm/VirtualMachineManagerImpl.java | 16 ++----
 .../src/com/cloud/dc/DataCenterDetailVO.java    |  8 +++
 .../src/com/cloud/dc/dao/DataCenterDaoImpl.java |  4 +-
 .../cloud/dc/dao/DataCenterDetailsDaoImpl.java  |  4 +-
 .../com/cloud/network/dao/NetworkDetailVO.java  |  8 +++
 .../network/dao/NetworkDetailsDaoImpl.java      |  4 +-
 .../cloud/service/ServiceOfferingDetailsVO.java |  8 +++
 .../service/dao/ServiceOfferingDaoImpl.java     |  4 +-
 .../dao/ServiceOfferingDetailsDaoImpl.java      |  4 +-
 .../com/cloud/storage/VMTemplateDetailVO.java   |  8 +++
 .../src/com/cloud/storage/VolumeDetailVO.java   |  9 +++-
 .../storage/dao/StoragePoolDetailsDaoImpl.java  |  4 +-
 .../cloud/storage/dao/VMTemplateDaoImpl.java    |  6 +--
 .../storage/dao/VMTemplateDetailsDaoImpl.java   |  4 +-
 .../cloud/storage/dao/VolumeDetailsDaoImpl.java |  4 +-
 engine/schema/src/com/cloud/vm/NicDetailVO.java |  7 +++
 .../schema/src/com/cloud/vm/UserVmDetailVO.java |  8 +++
 .../src/com/cloud/vm/dao/NicDetailsDaoImpl.java |  4 +-
 .../src/com/cloud/vm/dao/UserVmDaoImpl.java     |  4 +-
 .../com/cloud/vm/dao/UserVmDetailsDaoImpl.java  |  4 +-
 .../resourcedetail/FirewallRuleDetailVO.java    |  8 +++
 .../resourcedetail/ResourceDetailsDao.java      | 45 ++++++++++++++---
 .../resourcedetail/ResourceDetailsDaoBase.java  | 31 ++++++++++--
 .../dao/FirewallRuleDetailsDaoImpl.java         |  4 +-
 .../datastore/db/PrimaryDataStoreDaoImpl.java   |  4 +-
 .../datastore/db/PrimaryDataStoreDetailVO.java  |  8 +++
 .../datastore/db/StoragePoolDetailVO.java       |  8 +++
 .../db/PrimaryDataStoreDetailsDaoImpl.java      |  4 +-
 .../cloud/deploy/ImplicitDedicationPlanner.java |  2 +-
 .../implicitplanner/ImplicitPlannerTest.java    |  2 +-
 server/src/com/cloud/api/ApiDBUtils.java        | 29 +++++------
 .../com/cloud/api/query/QueryManagerImpl.java   | 25 +++++-----
 .../api/query/dao/DataCenterJoinDaoImpl.java    |  2 +-
 .../query/dao/ServiceOfferingJoinDaoImpl.java   |  3 +-
 .../configuration/ConfigurationManagerImpl.java |  8 ++-
 .../consoleproxy/ConsoleProxyManagerImpl.java   |  2 +-
 .../cloud/hypervisor/HypervisorGuruBase.java    |  2 +-
 .../metadata/ResourceMetaDataManagerImpl.java   | 51 +++++++++++---------
 .../VirtualNetworkApplianceManagerImpl.java     |  2 +-
 .../com/cloud/storage/StorageManagerImpl.java   |  2 +-
 .../secondary/SecondaryStorageManagerImpl.java  |  2 +-
 .../com/cloud/template/TemplateManagerImpl.java |  2 +-
 server/src/com/cloud/vm/UserVmManagerImpl.java  |  4 +-
 setup/db/db/schema-421to430.sql                 | 14 +++++-
 51 files changed, 307 insertions(+), 149 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/api/src/com/cloud/server/ResourceMetaDataService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/server/ResourceMetaDataService.java b/api/src/com/cloud/server/ResourceMetaDataService.java
index 46f1c4a..a71cfe7 100644
--- a/api/src/com/cloud/server/ResourceMetaDataService.java
+++ b/api/src/com/cloud/server/ResourceMetaDataService.java
@@ -44,10 +44,11 @@ public interface ResourceMetaDataService {
     public boolean deleteResourceMetaData(String resourceId, ResourceObjectType resourceType, String key);
 
 
-    List<? extends ResourceDetail> getDetails(long resourceId, ResourceObjectType resourceType);
+    ResourceDetail getDetail(long resourceId, ResourceObjectType resourceType, String key);
 
 
-    ResourceDetail getDetail(long resourceId, ResourceObjectType resourceType, String key);
+    Map<String, String> getDetailsMap(long resourceId, ResourceObjectType resourceType, Boolean forDisplay);
 
+    List<? extends ResourceDetail> getDetailsList(long resourceId, ResourceObjectType resourceType, Boolean forDisplay);
 
-    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/api/src/org/apache/cloudstack/api/ApiConstants.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java
index e10c37b..e56fdbc 100755
--- a/api/src/org/apache/cloudstack/api/ApiConstants.java
+++ b/api/src/org/apache/cloudstack/api/ApiConstants.java
@@ -523,6 +523,7 @@ public class ApiConstants {
     public static final String SERVICE_STATE = "servicestate";
     public static final String RESOURCE_DETAILS = "resourcedetails";
     public static final String EXPUNGE = "expunge";
+    public static final String FOR_DISPLAY = "fordisplay";
 
     public enum HostDetails {
         all, capacity, events, stats, min;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/api/src/org/apache/cloudstack/api/ResourceDetail.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/ResourceDetail.java b/api/src/org/apache/cloudstack/api/ResourceDetail.java
index 7a2570b..4914c78 100644
--- a/api/src/org/apache/cloudstack/api/ResourceDetail.java
+++ b/api/src/org/apache/cloudstack/api/ResourceDetail.java
@@ -23,5 +23,7 @@ public interface ResourceDetail extends InternalIdentity{
     public String getName();
     
     public String getValue();
+    
+    public boolean isDisplay();
         
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/api/src/org/apache/cloudstack/api/command/user/volume/ListResourceDetailsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/ListResourceDetailsCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/ListResourceDetailsCmd.java
index 18accac..1e522b2 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/ListResourceDetailsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/ListResourceDetailsCmd.java
@@ -26,6 +26,7 @@ import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.response.ListResponse;
 import org.apache.cloudstack.api.response.ResourceDetailResponse;
 import org.apache.cloudstack.api.response.ResourceTagResponse;
+import org.apache.cloudstack.context.CallContext;
 
 import com.cloud.server.ResourceTag;
 
@@ -41,6 +42,31 @@ public class ListResourceDetailsCmd extends BaseListProjectAndAccountResourcesCm
 
     @Parameter(name=ApiConstants.KEY, type=CommandType.STRING, description="list by key")
     private String key;
+    
+    @Parameter(name=ApiConstants.FOR_DISPLAY, type=CommandType.BOOLEAN, description="if set to true, only details marked with display=true, are returned." +
+    		" Always false is the call is made by the regular user", since="4.3")
+    private Boolean forDisplay;
+    
+    public String getResourceId() {
+        return resourceId;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    @Override
+    public String getCommandName() {
+        return s_name;
+    }
+    
+    public Boolean forDisplay() {
+        if (!_accountService.isAdmin(CallContext.current().getCallingAccount().getType())) {
+            return true;
+        } 
+        
+        return forDisplay;
+    }
 
     /////////////////////////////////////////////////////
     /////////////////// Accessors ///////////////////////
@@ -50,7 +76,7 @@ public class ListResourceDetailsCmd extends BaseListProjectAndAccountResourcesCm
     public void execute() {
 
         ListResponse<ResourceDetailResponse> response = new ListResponse<ResourceDetailResponse>();
-        List<ResourceDetailResponse> resourceDetailResponse = _queryService.listResource(this);
+        List<ResourceDetailResponse> resourceDetailResponse = _queryService.listResourceDetails(this);
         response.setResponses(resourceDetailResponse);
         response.setResponseName(getCommandName());
         this.setResponseObject(response);
@@ -60,17 +86,6 @@ public class ListResourceDetailsCmd extends BaseListProjectAndAccountResourcesCm
         return _taggedResourceService.getResourceType(resourceType);
     }
 
-    public String getResourceId() {
-        return resourceId;
-    }
-
-    public String getKey() {
-        return key;
-    }
-
-    @Override
-    public String getCommandName() {
-        return s_name;
-    }
+    
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/api/src/org/apache/cloudstack/api/response/ResourceDetailResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/ResourceDetailResponse.java b/api/src/org/apache/cloudstack/api/response/ResourceDetailResponse.java
index 0e917d7..989a126 100644
--- a/api/src/org/apache/cloudstack/api/response/ResourceDetailResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/ResourceDetailResponse.java
@@ -16,14 +16,8 @@
 // under the License.
 package org.apache.cloudstack.api.response;
 
-import java.util.Date;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseResponse;
-import org.apache.cloudstack.api.EntityReference;
 
 import com.cloud.serializer.Param;
 import com.google.gson.annotations.SerializedName;
@@ -47,6 +41,11 @@ public class ResourceDetailResponse extends BaseResponse{
     @Param(description = "value of the resource detail")
     private String value;
 
+    
+    @SerializedName(ApiConstants.FOR_DISPLAY)
+    @Param(description = "if detail is returned to the regular user", since="4.3")
+    private boolean forDisplay;
+    
     public String getResourceId() {
         return resourceId;
     }
@@ -78,4 +77,8 @@ public class ResourceDetailResponse extends BaseResponse{
     public void setValue(String value) {
         this.value = value;
     }
+
+    public void setForDisplay(boolean forDisplay) {
+        this.forDisplay = forDisplay;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/api/src/org/apache/cloudstack/query/QueryService.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/query/QueryService.java b/api/src/org/apache/cloudstack/query/QueryService.java
index a203564..4a9e218 100644
--- a/api/src/org/apache/cloudstack/query/QueryService.java
+++ b/api/src/org/apache/cloudstack/query/QueryService.java
@@ -100,7 +100,7 @@ public interface QueryService {
             String affinityGroupType, Long vmId, String accountName, Long domainId, boolean isRecursive,
             boolean listAll, Long startIndex, Long pageSize);
 
-    public List<ResourceDetailResponse> listResource(ListResourceDetailsCmd cmd);
+    public List<ResourceDetailResponse> listResourceDetails(ListResourceDetailsCmd cmd);
 
     ListResponse<DomainRouterResponse> searchForInternalLbVms(ListInternalLBVMsCmd cmd);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/client/tomcatconf/commands.properties.in
----------------------------------------------------------------------
diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in
index 81fd985..b106b9f 100644
--- a/client/tomcatconf/commands.properties.in
+++ b/client/tomcatconf/commands.properties.in
@@ -473,7 +473,7 @@ listTags=15
 #### Meta Data commands
 addResourceDetail=1
 removeResourceDetail=1
-listResourceDetails=1
+listResourceDetails=15
 
 ### Site-to-site VPN commands
 createVpnCustomerGateway=15

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
index 539936f..b74b4c5 100755
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -35,7 +35,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
 import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao;
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
@@ -51,6 +50,7 @@ import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
 import org.apache.cloudstack.storage.to.VolumeObjectTO;
 import org.apache.cloudstack.utils.identity.ManagementServerNode;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.Listener;
@@ -162,8 +162,6 @@ import com.cloud.utils.db.DB;
 import com.cloud.utils.db.EntityManager;
 import com.cloud.utils.db.GlobalLock;
 import com.cloud.utils.db.Transaction;
-import com.cloud.utils.db.TransactionCallback;
-import com.cloud.utils.db.TransactionCallbackNoReturn;
 import com.cloud.utils.db.TransactionCallbackWithException;
 import com.cloud.utils.db.TransactionCallbackWithExceptionNoReturn;
 import com.cloud.utils.db.TransactionStatus;
@@ -803,15 +801,11 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
                 //storing the value of overcommit in the vm_details table for doing a capacity check in case the cluster overcommit ratio is changed.
                 if (_uservmDetailsDao.findDetail(vm.getId(), "cpuOvercommitRatio") == null &&
                         ((Float.parseFloat(cluster_detail_cpu.getValue()) > 1f || Float.parseFloat(cluster_detail_ram.getValue()) > 1f))) {
-                    UserVmDetailVO vmDetail_cpu = new UserVmDetailVO(vm.getId(), "cpuOvercommitRatio", cluster_detail_cpu.getValue());
-                    UserVmDetailVO vmDetail_ram = new UserVmDetailVO(vm.getId(), "memoryOvercommitRatio", cluster_detail_ram.getValue());
-                    _uservmDetailsDao.persist(vmDetail_cpu);
-                    _uservmDetailsDao.persist(vmDetail_ram);
+                    _uservmDetailsDao.addDetail(vm.getId(), "cpuOvercommitRatio", cluster_detail_cpu.getValue());
+                    _uservmDetailsDao.addDetail(vm.getId(), "memoryOvercommitRatio", cluster_detail_ram.getValue());
                 } else if (_uservmDetailsDao.findDetail(vm.getId(), "cpuOvercommitRatio") != null) {
-                    UserVmDetailVO vmDetail_cpu = _uservmDetailsDao.findDetail(vm.getId(), "cpuOvercommitRatio");
-                    UserVmDetailVO vmDetail_ram = _uservmDetailsDao.findDetail(vm.getId(), "memoryOvercommitRatio");
-                    _uservmDetailsDao.addDetail(vmDetail_cpu);
-                    _uservmDetailsDao.addDetail(vmDetail_ram);
+                    _uservmDetailsDao.addDetail(vm.getId(), "cpuOvercommitRatio", cluster_detail_cpu.getValue());
+                    _uservmDetailsDao.addDetail(vm.getId(), "memoryOvercommitRatio", cluster_detail_ram.getValue());
                 }
                 vmProfile.setCpuOvercommitRatio(Float.parseFloat(cluster_detail_cpu.getValue()));
                 vmProfile.setMemoryOvercommitRatio(Float.parseFloat(cluster_detail_ram.getValue()));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/com/cloud/dc/DataCenterDetailVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/dc/DataCenterDetailVO.java b/engine/schema/src/com/cloud/dc/DataCenterDetailVO.java
index 6771ef8..0ff7865 100644
--- a/engine/schema/src/com/cloud/dc/DataCenterDetailVO.java
+++ b/engine/schema/src/com/cloud/dc/DataCenterDetailVO.java
@@ -42,6 +42,9 @@ public class DataCenterDetailVO implements ResourceDetail {
     @Column(name="value")
     private String value;
     
+    @Column(name="display")
+    private boolean display;
+    
     protected DataCenterDetailVO() {
     }
     
@@ -71,4 +74,9 @@ public class DataCenterDetailVO implements ResourceDetail {
     public long getResourceId() {
         return resourceId;
     }
+    
+    @Override
+    public boolean isDisplay() {
+        return display;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java b/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java
index 9d90241..9cc43ef 100755
--- a/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java
+++ b/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java
@@ -358,7 +358,7 @@ public class DataCenterDaoImpl extends GenericDaoBase<DataCenterVO, Long> implem
 
     @Override
     public void loadDetails(DataCenterVO zone) {
-        Map<String, String> details =_detailsDao.findDetails(zone.getId());
+        Map<String, String> details =_detailsDao.listDetailsKeyPairs(zone.getId());
         zone.setDetails(details);
     }
 
@@ -374,7 +374,7 @@ public class DataCenterDaoImpl extends GenericDaoBase<DataCenterVO, Long> implem
             resourceDetails.add(new DataCenterDetailVO(zone.getId(), key, details.get(key)));
         }
         
-        _detailsDao.addDetails(resourceDetails);
+        _detailsDao.saveDetails(resourceDetails);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/com/cloud/dc/dao/DataCenterDetailsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/dc/dao/DataCenterDetailsDaoImpl.java b/engine/schema/src/com/cloud/dc/dao/DataCenterDetailsDaoImpl.java
index 93c08ec..49092f8 100644
--- a/engine/schema/src/com/cloud/dc/dao/DataCenterDetailsDaoImpl.java
+++ b/engine/schema/src/com/cloud/dc/dao/DataCenterDetailsDaoImpl.java
@@ -42,8 +42,8 @@ public class DataCenterDetailsDaoImpl extends ResourceDetailsDaoBase<DataCenterD
     }
 
     @Override
-    public DataCenterDetailVO createDetail(long resourceId, String key, String value) {
-        return new DataCenterDetailVO(resourceId, key, value);
+    public void addDetail(long resourceId, String key, String value) {
+        super.addDetail(new DataCenterDetailVO(resourceId, key, value));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/com/cloud/network/dao/NetworkDetailVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/NetworkDetailVO.java b/engine/schema/src/com/cloud/network/dao/NetworkDetailVO.java
index c7006c4..b7c4db8 100644
--- a/engine/schema/src/com/cloud/network/dao/NetworkDetailVO.java
+++ b/engine/schema/src/com/cloud/network/dao/NetworkDetailVO.java
@@ -41,6 +41,9 @@ public class NetworkDetailVO implements ResourceDetail {
 
     @Column(name="value", length=1024)
     private String value;
+    
+    @Column(name="display")
+    private boolean display;
 
     public NetworkDetailVO() {}
 
@@ -69,4 +72,9 @@ public class NetworkDetailVO implements ResourceDetail {
     public long getResourceId() {
         return resourceId;
     }
+    
+    @Override
+    public boolean isDisplay() {
+        return display;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/com/cloud/network/dao/NetworkDetailsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/NetworkDetailsDaoImpl.java b/engine/schema/src/com/cloud/network/dao/NetworkDetailsDaoImpl.java
index db5c44f..b42481c 100644
--- a/engine/schema/src/com/cloud/network/dao/NetworkDetailsDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/NetworkDetailsDaoImpl.java
@@ -27,8 +27,8 @@ import org.springframework.stereotype.Component;
 public class NetworkDetailsDaoImpl extends ResourceDetailsDaoBase<NetworkDetailVO> implements NetworkDetailsDao {
 
     @Override
-    public NetworkDetailVO createDetail(long resourceId, String key, String value) {
-        return new NetworkDetailVO(resourceId, key, value);
+    public void addDetail(long resourceId, String key, String value) {
+        super.addDetail(new NetworkDetailVO(resourceId, key, value));
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/com/cloud/service/ServiceOfferingDetailsVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/service/ServiceOfferingDetailsVO.java b/engine/schema/src/com/cloud/service/ServiceOfferingDetailsVO.java
index 8b70b77..4ab3134 100644
--- a/engine/schema/src/com/cloud/service/ServiceOfferingDetailsVO.java
+++ b/engine/schema/src/com/cloud/service/ServiceOfferingDetailsVO.java
@@ -41,6 +41,9 @@ public class ServiceOfferingDetailsVO implements ResourceDetail {
 
     @Column(name="value")
     private String value;
+    
+    @Column(name="display")
+    boolean display;
 
     protected ServiceOfferingDetailsVO() {
     }
@@ -70,4 +73,9 @@ public class ServiceOfferingDetailsVO implements ResourceDetail {
     public long getId() {
         return id;
     }
+    
+    @Override
+    public boolean isDisplay() {
+        return display;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/com/cloud/service/dao/ServiceOfferingDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/service/dao/ServiceOfferingDaoImpl.java b/engine/schema/src/com/cloud/service/dao/ServiceOfferingDaoImpl.java
index 648e4d0..f807f0d 100644
--- a/engine/schema/src/com/cloud/service/dao/ServiceOfferingDaoImpl.java
+++ b/engine/schema/src/com/cloud/service/dao/ServiceOfferingDaoImpl.java
@@ -162,7 +162,7 @@ public class ServiceOfferingDaoImpl extends GenericDaoBase<ServiceOfferingVO, Lo
 
     @Override
     public void loadDetails(ServiceOfferingVO serviceOffering) {
-        Map<String, String> details = detailsDao.findDetails(serviceOffering.getId());
+        Map<String, String> details = detailsDao.listDetailsKeyPairs(serviceOffering.getId());
         serviceOffering.setDetails(details);
     }
 
@@ -178,6 +178,6 @@ public class ServiceOfferingDaoImpl extends GenericDaoBase<ServiceOfferingVO, Lo
             resourceDetails.add(new ServiceOfferingDetailsVO(serviceOffering.getId(), key, details.get(key)));
         }
         
-        detailsDao.addDetails(resourceDetails);
+        detailsDao.saveDetails(resourceDetails);
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/com/cloud/service/dao/ServiceOfferingDetailsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/service/dao/ServiceOfferingDetailsDaoImpl.java b/engine/schema/src/com/cloud/service/dao/ServiceOfferingDetailsDaoImpl.java
index 8a78b17..5d81861 100644
--- a/engine/schema/src/com/cloud/service/dao/ServiceOfferingDetailsDaoImpl.java
+++ b/engine/schema/src/com/cloud/service/dao/ServiceOfferingDetailsDaoImpl.java
@@ -29,8 +29,8 @@ public class ServiceOfferingDetailsDaoImpl extends ResourceDetailsDaoBase<Servic
         implements ServiceOfferingDetailsDao {
 
     @Override
-    public ServiceOfferingDetailsVO createDetail(long resourceId, String key, String value) {
-        return new ServiceOfferingDetailsVO(resourceId, key, value);
+    public void addDetail(long resourceId, String key, String value) {
+        super.addDetail(new ServiceOfferingDetailsVO(resourceId, key, value));
     }
     
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/com/cloud/storage/VMTemplateDetailVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/VMTemplateDetailVO.java b/engine/schema/src/com/cloud/storage/VMTemplateDetailVO.java
index 59b490b..52efe3b 100644
--- a/engine/schema/src/com/cloud/storage/VMTemplateDetailVO.java
+++ b/engine/schema/src/com/cloud/storage/VMTemplateDetailVO.java
@@ -41,6 +41,9 @@ public class VMTemplateDetailVO implements ResourceDetail {
 
     @Column(name = "value", length = 1024)
     private String value;
+    
+    @Column(name="display")
+    private boolean display;
 
     public VMTemplateDetailVO() {
     }
@@ -70,4 +73,9 @@ public class VMTemplateDetailVO implements ResourceDetail {
     public String getValue() {
         return value;
     }
+    
+    @Override
+    public boolean isDisplay() {
+        return display;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/com/cloud/storage/VolumeDetailVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/VolumeDetailVO.java b/engine/schema/src/com/cloud/storage/VolumeDetailVO.java
index 499be86..f9b7653 100644
--- a/engine/schema/src/com/cloud/storage/VolumeDetailVO.java
+++ b/engine/schema/src/com/cloud/storage/VolumeDetailVO.java
@@ -23,7 +23,6 @@ import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.Table;
 
-import org.apache.cloudstack.api.InternalIdentity;
 import org.apache.cloudstack.api.ResourceDetail;
 
 @Entity
@@ -42,6 +41,9 @@ public class VolumeDetailVO implements ResourceDetail {
 
     @Column(name="value", length=1024)
     private String value;
+    
+    @Column(name="display")
+    private boolean display;
 
     public VolumeDetailVO() {}
 
@@ -70,5 +72,10 @@ public class VolumeDetailVO implements ResourceDetail {
     public long getResourceId() {
         return resourceId;
     }
+    
+    @Override
+    public boolean isDisplay() {
+        return display;
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/com/cloud/storage/dao/StoragePoolDetailsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/dao/StoragePoolDetailsDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/StoragePoolDetailsDaoImpl.java
index 3c177d0..ed10270 100644
--- a/engine/schema/src/com/cloud/storage/dao/StoragePoolDetailsDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/StoragePoolDetailsDaoImpl.java
@@ -44,7 +44,7 @@ public class StoragePoolDetailsDaoImpl extends ResourceDetailsDaoBase<StoragePoo
     }
 
     @Override
-    public StoragePoolDetailVO createDetail(long resourceId, String key, String value) {
-        return new StoragePoolDetailVO(resourceId, key, value);
+    public void addDetail(long resourceId, String key, String value) {
+        super.addDetail(new StoragePoolDetailVO(resourceId, key, value));
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
index d4bb367..73b68ea 100755
--- a/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
@@ -405,7 +405,7 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
 
     @Override
     public void loadDetails(VMTemplateVO tmpl) {
-        Map<String, String> details = _templateDetailsDao.findDetails(tmpl.getId());
+        Map<String, String> details = _templateDetailsDao.listDetailsKeyPairs(tmpl.getId());
         tmpl.setDetails(details);
     }
 
@@ -421,7 +421,7 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
             details.add(detail);
         }
         
-        _templateDetailsDao.addDetails(details);
+        _templateDetailsDao.saveDetails(details);
     }
 
 
@@ -756,7 +756,7 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
                 for (String key : tmplt.getDetails().keySet()) {
                     details.add(new VMTemplateDetailVO(tmplt.getId(), key, tmplt.getDetails().get(key)));
                 }
-                _templateDetailsDao.addDetails(details);
+                _templateDetailsDao.saveDetails(details);
             }
         }
         VMTemplateZoneVO tmpltZoneVO = _templateZoneDao.findByZoneTemplate(zoneId, tmplt.getId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/com/cloud/storage/dao/VMTemplateDetailsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/dao/VMTemplateDetailsDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/VMTemplateDetailsDaoImpl.java
index e2f5abf..327f854 100644
--- a/engine/schema/src/com/cloud/storage/dao/VMTemplateDetailsDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VMTemplateDetailsDaoImpl.java
@@ -28,7 +28,7 @@ import com.cloud.storage.VMTemplateDetailVO;
 public class VMTemplateDetailsDaoImpl extends ResourceDetailsDaoBase<VMTemplateDetailVO> implements VMTemplateDetailsDao {
 
     @Override
-    public VMTemplateDetailVO createDetail(long resourceId, String key, String value) {
-        return new VMTemplateDetailVO(resourceId, key, value);
+    public void addDetail(long resourceId, String key, String value) {
+        super.addDetail(new VMTemplateDetailVO(resourceId, key, value));
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/com/cloud/storage/dao/VolumeDetailsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/dao/VolumeDetailsDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/VolumeDetailsDaoImpl.java
index 1afa6a2..7bb540a 100644
--- a/engine/schema/src/com/cloud/storage/dao/VolumeDetailsDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VolumeDetailsDaoImpl.java
@@ -28,8 +28,8 @@ import com.cloud.storage.VolumeDetailVO;
 public class VolumeDetailsDaoImpl extends ResourceDetailsDaoBase<VolumeDetailVO> implements VolumeDetailsDao {
 
     @Override
-    public VolumeDetailVO createDetail(long resourceId, String key, String value) {
-        return new VolumeDetailVO(resourceId, key, value);
+    public void addDetail(long resourceId, String key, String value) {
+        super.addDetail(new VolumeDetailVO(resourceId, key, value));
     }
     
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/com/cloud/vm/NicDetailVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/NicDetailVO.java b/engine/schema/src/com/cloud/vm/NicDetailVO.java
index 4be5723..93d0d32 100644
--- a/engine/schema/src/com/cloud/vm/NicDetailVO.java
+++ b/engine/schema/src/com/cloud/vm/NicDetailVO.java
@@ -41,6 +41,9 @@ public class NicDetailVO implements ResourceDetail {
 
     @Column(name="value", length=1024)
     private String value;
+    
+    @Column(name="display")
+    private boolean display;
 
     public NicDetailVO() {}
 
@@ -70,4 +73,8 @@ public class NicDetailVO implements ResourceDetail {
         return resourceId;
     }
 
+    @Override
+    public boolean isDisplay() {
+        return display;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/com/cloud/vm/UserVmDetailVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/UserVmDetailVO.java b/engine/schema/src/com/cloud/vm/UserVmDetailVO.java
index 62c924b..82bf32d 100644
--- a/engine/schema/src/com/cloud/vm/UserVmDetailVO.java
+++ b/engine/schema/src/com/cloud/vm/UserVmDetailVO.java
@@ -42,6 +42,9 @@ public class UserVmDetailVO implements ResourceDetail {
     @Column(name="value", length=1024)
     private String value;
     
+    @Column(name="display")
+    private boolean display;
+    
     public UserVmDetailVO() {}
     
     public UserVmDetailVO(long vmId, String name, String value) {
@@ -69,5 +72,10 @@ public class UserVmDetailVO implements ResourceDetail {
     public long getResourceId() {
         return resourceId;
     }
+    
+    @Override
+    public boolean isDisplay() {
+        return display;
+    }
 	
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/com/cloud/vm/dao/NicDetailsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/dao/NicDetailsDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/NicDetailsDaoImpl.java
index d442982..013c87b 100644
--- a/engine/schema/src/com/cloud/vm/dao/NicDetailsDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/NicDetailsDaoImpl.java
@@ -28,7 +28,7 @@ import com.cloud.vm.NicDetailVO;
 public class NicDetailsDaoImpl extends ResourceDetailsDaoBase<NicDetailVO> implements NicDetailsDao {
 
     @Override
-    public NicDetailVO createDetail(long resourceId, String key, String value) {
-        return new NicDetailVO(resourceId, key, value);
+    public void addDetail(long resourceId, String key, String value) {
+        super.addDetail(new NicDetailVO(resourceId, key, value));
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java
index 1992ef47..2108069 100755
--- a/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java
@@ -332,7 +332,7 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use
 
 	@Override
 	public void loadDetails(UserVmVO vm) {
-        Map<String, String> details = _detailsDao.findDetails(vm.getId());
+        Map<String, String> details = _detailsDao.listDetailsKeyPairs(vm.getId());
         vm.setDetails(details);
 	}
 
@@ -347,7 +347,7 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use
             details.add(new UserVmDetailVO(vm.getId(), key, detailsStr.get(key)));
         }
         
-        _detailsDao.addDetails(details);
+        _detailsDao.saveDetails(details);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/com/cloud/vm/dao/UserVmDetailsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/dao/UserVmDetailsDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/UserVmDetailsDaoImpl.java
index 0445419..fad9ace 100644
--- a/engine/schema/src/com/cloud/vm/dao/UserVmDetailsDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/UserVmDetailsDaoImpl.java
@@ -28,8 +28,8 @@ import com.cloud.vm.UserVmDetailVO;
 public class UserVmDetailsDaoImpl extends ResourceDetailsDaoBase<UserVmDetailVO> implements UserVmDetailsDao {
 
     @Override
-    public UserVmDetailVO createDetail(long resourceId, String key, String value) {
-        return new UserVmDetailVO(resourceId, key, value);
+    public void addDetail(long resourceId, String key, String value) {
+        super.addDetail(new UserVmDetailVO(resourceId, key, value));
     }
     
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/org/apache/cloudstack/resourcedetail/FirewallRuleDetailVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/resourcedetail/FirewallRuleDetailVO.java b/engine/schema/src/org/apache/cloudstack/resourcedetail/FirewallRuleDetailVO.java
index d7e90e8..88d2b00 100644
--- a/engine/schema/src/org/apache/cloudstack/resourcedetail/FirewallRuleDetailVO.java
+++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/FirewallRuleDetailVO.java
@@ -41,6 +41,9 @@ public class FirewallRuleDetailVO implements ResourceDetail{
 
         @Column(name="value", length=1024)
         private String value;
+        
+        @Column(name="display")
+        private boolean display;
 
         public FirewallRuleDetailVO() {}
 
@@ -69,4 +72,9 @@ public class FirewallRuleDetailVO implements ResourceDetail{
         public long getResourceId() {
             return resourceId;
         }
+
+        @Override
+        public boolean isDisplay() {
+            return display;
+        }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/org/apache/cloudstack/resourcedetail/ResourceDetailsDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/resourcedetail/ResourceDetailsDao.java b/engine/schema/src/org/apache/cloudstack/resourcedetail/ResourceDetailsDao.java
index 043c833..4689543 100644
--- a/engine/schema/src/org/apache/cloudstack/resourcedetail/ResourceDetailsDao.java
+++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/ResourceDetailsDao.java
@@ -24,19 +24,48 @@ import org.apache.cloudstack.api.ResourceDetail;
 import com.cloud.utils.db.GenericDao;
 
 public interface ResourceDetailsDao<R extends ResourceDetail> extends GenericDao<R, Long>{
+    /**
+     * Finds detail by resourceId and key
+     * @param resourceId
+     * @param name
+     * @return
+     */
     public R findDetail(long resourceId, String name);
-
-    public Map<String, String> findDetails(long resourceId);
-
-    public List<R> findDetailsList(long resourceId);
-
+    
+    /**
+     * Removes all details for the resource specified
+     * @param resourceId
+     */
     public void removeDetails(long resourceId);
 
+    /**
+     * Removes detail having resourceId and key specified (unique combination)
+     * @param resourceId
+     * @param key
+     */
     public void removeDetail(long resourceId, String key);
 
-    public void addDetails(List<R> details);
+    /**
+     * Lists all details for the resourceId
+     * @param resourceId
+     * @return list of details each implementing ResourceDetail interface
+     */
+    public List<R> listDetails(long resourceId);
     
-    public void addDetail(R detail);
+    /**
+     * List details for resourceId having display field = forDisplay value passed in
+     * @param resourceId
+     * @param forDisplay
+     * @return
+     */
+    public List<R> listDetails(long resourceId, boolean forDisplay);
+
+    public Map<String, String> listDetailsKeyPairs(long resourceId);
+    
+    public Map<String, String> listDetailsKeyPairs(long resourceId, boolean forDisplay);
     
-    public R createDetail(long resourceId, String key, String value);
+    public void saveDetails(List<R> details);
+        
+    public void addDetail(long resourceId, String key, String value);
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/org/apache/cloudstack/resourcedetail/ResourceDetailsDaoBase.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/resourcedetail/ResourceDetailsDaoBase.java b/engine/schema/src/org/apache/cloudstack/resourcedetail/ResourceDetailsDaoBase.java
index a514b1e..4ecebf8 100644
--- a/engine/schema/src/org/apache/cloudstack/resourcedetail/ResourceDetailsDaoBase.java
+++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/ResourceDetailsDaoBase.java
@@ -35,6 +35,7 @@ public abstract class ResourceDetailsDaoBase<R extends ResourceDetail> extends G
         AllFieldsSearch = createSearchBuilder();
         AllFieldsSearch.and("resourceId", AllFieldsSearch.entity().getResourceId(), SearchCriteria.Op.EQ);
         AllFieldsSearch.and("name", AllFieldsSearch.entity().getName(), SearchCriteria.Op.EQ);
+        AllFieldsSearch.and("display", AllFieldsSearch.entity().isDisplay(), SearchCriteria.Op.EQ);
         AllFieldsSearch.done();
     }
 
@@ -47,7 +48,7 @@ public abstract class ResourceDetailsDaoBase<R extends ResourceDetail> extends G
     }
 
 
-    public Map<String, String> findDetails(long resourceId) {
+    public Map<String, String> listDetailsKeyPairs(long resourceId) {
         SearchCriteria<R> sc = AllFieldsSearch.create();
         sc.setParameters("resourceId", resourceId);
         
@@ -59,7 +60,7 @@ public abstract class ResourceDetailsDaoBase<R extends ResourceDetail> extends G
         return details;
     }
 
-    public List<R> findDetailsList(long resourceId) {
+    public List<R> listDetails(long resourceId) {
         SearchCriteria<R> sc = AllFieldsSearch.create();
         sc.setParameters("resourceId", resourceId);
 
@@ -84,7 +85,7 @@ public abstract class ResourceDetailsDaoBase<R extends ResourceDetail> extends G
     }
 
 
-    public void addDetails(List<R> details) {
+    public void saveDetails(List<R> details) {
         if (details.isEmpty()) {
             return;
         }
@@ -102,7 +103,7 @@ public abstract class ResourceDetailsDaoBase<R extends ResourceDetail> extends G
     }
     
 
-    public void addDetail(R detail) {
+    protected void addDetail(R detail) {
         if (detail == null) {
             return;
         }
@@ -112,5 +113,27 @@ public abstract class ResourceDetailsDaoBase<R extends ResourceDetail> extends G
         }
         persist(detail);
     }
+    
+    public Map<String, String> listDetailsKeyPairs(long resourceId, boolean forDisplay) {
+        SearchCriteria<R> sc = AllFieldsSearch.create();
+        sc.setParameters("resourceId", resourceId);
+        sc.setParameters("display", forDisplay);
+        
+        List<R> results = search(sc, null);
+        Map<String, String> details = new HashMap<String, String>(results.size());
+        for (R result : results) {
+            details.put(result.getName(), result.getValue());
+        }
+        return details;
+    }
+    
 
+    public List<R> listDetails(long resourceId, boolean forDisplay) {
+        SearchCriteria<R> sc = AllFieldsSearch.create();
+        sc.setParameters("resourceId", resourceId);
+        sc.setParameters("display", forDisplay);
+
+        List<R> results = search(sc, null);
+        return results;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/FirewallRuleDetailsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/FirewallRuleDetailsDaoImpl.java b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/FirewallRuleDetailsDaoImpl.java
index bff86db..35613d6 100644
--- a/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/FirewallRuleDetailsDaoImpl.java
+++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/FirewallRuleDetailsDaoImpl.java
@@ -28,7 +28,7 @@ import org.springframework.stereotype.Component;
 public class FirewallRuleDetailsDaoImpl extends ResourceDetailsDaoBase<FirewallRuleDetailVO> implements FirewallRuleDetailsDao {
 
     @Override
-    public FirewallRuleDetailVO createDetail(long resourceId, String key, String value) {
-        return new FirewallRuleDetailVO(resourceId, key, value);
+    public void addDetail(long resourceId, String key, String value) {
+        super.addDetail(new FirewallRuleDetailVO(resourceId, key, value));
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
index bee76f5..d35aa44 100644
--- a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
+++ b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java
@@ -386,13 +386,13 @@ public class PrimaryDataStoreDaoImpl extends GenericDaoBase<StoragePoolVO, Long>
             for (String key : details.keySet()) {
                 detailsVO.add(new StoragePoolDetailVO(poolId, key, details.get(key)));
             }
-            _detailsDao.addDetails(detailsVO);
+            _detailsDao.saveDetails(detailsVO);
         }
     }
 
     @Override
     public Map<String, String> getDetails(long poolId) {
-        return _detailsDao.findDetails(poolId);
+        return _detailsDao.listDetailsKeyPairs(poolId);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDetailVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDetailVO.java b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDetailVO.java
index badb637..68da2e2 100644
--- a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDetailVO.java
+++ b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDetailVO.java
@@ -41,6 +41,9 @@ public class PrimaryDataStoreDetailVO implements ResourceDetail{
 
     @Column(name = "value")
     String value;
+    
+    @Column(name="display")
+    private boolean display;
 
     public PrimaryDataStoreDetailVO(long poolId, String name, String value) {
         this.resourceId = poolId;
@@ -70,4 +73,9 @@ public class PrimaryDataStoreDetailVO implements ResourceDetail{
     public String getValue() {
         return value;
     }
+    
+    @Override
+    public boolean isDisplay() {
+        return display;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/schema/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailVO.java b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailVO.java
index 9499df0..5968fd2 100644
--- a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailVO.java
+++ b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailVO.java
@@ -42,6 +42,9 @@ public class StoragePoolDetailVO implements ResourceDetail {
     @Column(name = "value")
     String value;
 
+    @Column(name="display")
+    private boolean display;
+    
     public StoragePoolDetailVO(long poolId, String name, String value) {
         this.resourceId = poolId;
         this.name = name;
@@ -70,4 +73,9 @@ public class StoragePoolDetailVO implements ResourceDetail {
     public String getValue() {
         return value;
     }
+    
+    @Override
+    public boolean isDisplay() {
+        return display;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/engine/storage/src/org/apache/cloudstack/storage/volume/db/PrimaryDataStoreDetailsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/volume/db/PrimaryDataStoreDetailsDaoImpl.java b/engine/storage/src/org/apache/cloudstack/storage/volume/db/PrimaryDataStoreDetailsDaoImpl.java
index 61125f6..ee45053 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/volume/db/PrimaryDataStoreDetailsDaoImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/volume/db/PrimaryDataStoreDetailsDaoImpl.java
@@ -27,8 +27,8 @@ public class PrimaryDataStoreDetailsDaoImpl extends ResourceDetailsDaoBase<Prima
         PrimaryDataStoreDetailsDao {
 
     @Override
-    public PrimaryDataStoreDetailVO createDetail(long resourceId, String key, String value) {
-        return new PrimaryDataStoreDetailVO(resourceId, key, value);
+    public void addDetail(long resourceId, String key, String value) {
+        super.addDetail(new PrimaryDataStoreDetailVO(resourceId, key, value));
     }
     
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/plugins/deployment-planners/implicit-dedication/src/com/cloud/deploy/ImplicitDedicationPlanner.java
----------------------------------------------------------------------
diff --git a/plugins/deployment-planners/implicit-dedication/src/com/cloud/deploy/ImplicitDedicationPlanner.java b/plugins/deployment-planners/implicit-dedication/src/com/cloud/deploy/ImplicitDedicationPlanner.java
index 6eee28d..e73bc72 100644
--- a/plugins/deployment-planners/implicit-dedication/src/com/cloud/deploy/ImplicitDedicationPlanner.java
+++ b/plugins/deployment-planners/implicit-dedication/src/com/cloud/deploy/ImplicitDedicationPlanner.java
@@ -223,7 +223,7 @@ public class ImplicitDedicationPlanner extends FirstFitPlanner implements Deploy
 
     private boolean isServiceOfferingUsingPlannerInPreferredMode(long serviceOfferingId) {
         boolean preferred = false;
-        Map<String, String> details = serviceOfferingDetailsDao.findDetails(serviceOfferingId);
+        Map<String, String> details = serviceOfferingDetailsDao.listDetailsKeyPairs(serviceOfferingId);
         if (details != null && !details.isEmpty()) {
             String preferredAttribute = details.get("ImplicitDedicationMode");
             if (preferredAttribute != null && preferredAttribute.equals("Preferred")) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/plugins/deployment-planners/implicit-dedication/test/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java
----------------------------------------------------------------------
diff --git a/plugins/deployment-planners/implicit-dedication/test/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java b/plugins/deployment-planners/implicit-dedication/test/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java
index c0ce9d0..f1fa71c 100644
--- a/plugins/deployment-planners/implicit-dedication/test/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java
+++ b/plugins/deployment-planners/implicit-dedication/test/org/apache/cloudstack/implicitplanner/ImplicitPlannerTest.java
@@ -405,7 +405,7 @@ public class ImplicitPlannerTest {
 
         Map<String, String> details = new HashMap<String, String>();
         details.put("ImplicitDedicationMode", plannerMode);
-        when(serviceOfferingDetailsDao.findDetails(offeringId)).thenReturn(details);
+        when(serviceOfferingDetailsDao.listDetailsKeyPairs(offeringId)).thenReturn(details);
 
         // Initialize hosts in clusters
         HostVO host1 = mock(HostVO.class);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/server/src/com/cloud/api/ApiDBUtils.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiDBUtils.java b/server/src/com/cloud/api/ApiDBUtils.java
index aec25e5..d36604c 100755
--- a/server/src/com/cloud/api/ApiDBUtils.java
+++ b/server/src/com/cloud/api/ApiDBUtils.java
@@ -52,6 +52,7 @@ import org.apache.cloudstack.api.response.UserResponse;
 import org.apache.cloudstack.api.response.UserVmResponse;
 import org.apache.cloudstack.api.response.VolumeResponse;
 import org.apache.cloudstack.api.response.ZoneResponse;
+import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
 import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
@@ -59,7 +60,6 @@ import org.apache.cloudstack.framework.jobs.AsyncJob;
 import org.apache.cloudstack.framework.jobs.AsyncJobManager;
 import org.apache.cloudstack.framework.jobs.dao.AsyncJobDao;
 import org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDao;
-import org.apache.cloudstack.resourcedetail.ResourceDetailsDaoBase;
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
 
@@ -117,7 +117,6 @@ import com.cloud.dc.ClusterDetailsDao;
 import com.cloud.dc.ClusterDetailsVO;
 import com.cloud.dc.ClusterVO;
 import com.cloud.dc.DataCenter;
-import com.cloud.dc.DataCenterDetailVO;
 import com.cloud.dc.DataCenterVO;
 import com.cloud.dc.HostPodVO;
 import com.cloud.dc.Vlan;
@@ -219,6 +218,7 @@ import com.cloud.region.ha.GlobalLoadBalancingRulesService;
 import com.cloud.resource.ResourceManager;
 import com.cloud.server.Criteria;
 import com.cloud.server.ManagementServer;
+import com.cloud.server.ResourceMetaDataService;
 import com.cloud.server.ResourceTag;
 import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.server.StatsCollector;
@@ -401,11 +401,8 @@ public class ApiDBUtils {
     static AffinityGroupJoinDao _affinityGroupJoinDao;
     static GlobalLoadBalancingRulesService _gslbService;
     static NetworkACLDao _networkACLDao;
-    static ServiceOfferingDetailsDao _serviceOfferingDetailsDao;
     static AccountService _accountService;
-    static DataCenterDetailsDao _zoneDetailsDao;
-
-
+    static ResourceMetaDataService _resourceDetailsService;
 
     @Inject
     private ManagementServer ms;
@@ -520,6 +517,7 @@ public class ApiDBUtils {
     @Inject private AccountService accountService;
     @Inject private ConfigurationManager configMgr;
     @Inject private DataCenterDetailsDao zoneDetailsDao;
+    @Inject private  ResourceMetaDataService resourceDetailsService;
 
     @PostConstruct
     void init() {
@@ -629,9 +627,8 @@ public class ApiDBUtils {
         // Note: stats collector should already have been initialized by this time, otherwise a null instance is returned
         _statsCollector = StatsCollector.getInstance();
         _networkACLDao = networkACLDao;
-        _serviceOfferingDetailsDao = serviceOfferingDetailsDao;
         _accountService = accountService;
-        _zoneDetailsDao = zoneDetailsDao;
+        _resourceDetailsService = resourceDetailsService;
 
     }
 
@@ -894,7 +891,7 @@ public class ApiDBUtils {
     public static VMTemplateVO findTemplateById(Long templateId) {
         VMTemplateVO template = _templateDao.findByIdIncludingRemoved(templateId);
         if(template != null) {
-            Map details = _templateDetailsDao.findDetails(templateId);
+            Map<String, String> details = _templateDetailsDao.listDetailsKeyPairs(templateId);
             if(details != null && !details.isEmpty()) {
                 template.setDetails(details);
             }
@@ -1687,8 +1684,13 @@ public class ApiDBUtils {
         return providerDnsName;
     }
 
-    public static Map<String, String> getServiceOfferingDetails(long serviceOfferingId) {
-        Map<String, String> details = _serviceOfferingDetailsDao.findDetails(serviceOfferingId);
+    public static Map<String, String> getResourceDetails(long resourceId, ResourceObjectType resourceType) {
+        Map<String, String> details = null;
+        if (isAdmin(CallContext.current().getCallingAccount())) {
+            details = _resourceDetailsService.getDetailsMap(resourceId, resourceType, null);
+        } else {
+            details = _resourceDetailsService.getDetailsMap(resourceId, resourceType, true);
+        }
         return details.isEmpty() ? null : details;
     }
 
@@ -1699,9 +1701,4 @@ public class ApiDBUtils {
     public static List<ResourceTagJoinVO> listResourceTagViewByResourceUUID(String resourceUUID, ResourceObjectType resourceType){
         return  _tagJoinDao.listBy(resourceUUID, resourceType);
     }
-    
-    public static Map<String, String> getZoneDetails(long zoneId) {
-        Map<String, String> details = _zoneDetailsDao.findDetails(zoneId);
-        return details.isEmpty() ? null : details;
-    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/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 a7d85cf..0e3f7c9 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -3260,8 +3260,9 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
     }
 
     @Override
-    public List<ResourceDetailResponse> listResource(ListResourceDetailsCmd cmd) {
+    public List<ResourceDetailResponse> listResourceDetails(ListResourceDetailsCmd cmd) {
         String key = cmd.getKey();
+        Boolean forDisplay = cmd.forDisplay();
         ResourceTag.ResourceObjectType resourceType = cmd.getResourceType();
         String resourceIdStr = cmd.getResourceId();
         long resourceId = _taggedResourceMgr.getResourceId(resourceIdStr, resourceType);
@@ -3269,20 +3270,21 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
         ResourceDetail requestedDetail = null;
 
         if (key == null) {
-            detailList = _resourceMetaDataMgr.getDetails(resourceId, resourceType);
+            detailList = _resourceMetaDataMgr.getDetailsList(resourceId, resourceType, forDisplay);
         } else {
             requestedDetail = _resourceMetaDataMgr.getDetail(resourceId, resourceType, key);
+            if (forDisplay != null && requestedDetail.isDisplay() != forDisplay) {
+                requestedDetail = null;
+            }
         }
         
         List<ResourceDetailResponse> responseList = new ArrayList<ResourceDetailResponse>();
         if (requestedDetail != null) {
-            ResourceDetailResponse detailResponse = createResourceDetailsResponse(resourceId, requestedDetail.getName(), requestedDetail.getValue(),
-                    resourceType);
+            ResourceDetailResponse detailResponse = createResourceDetailsResponse(requestedDetail, resourceType);
             responseList.add(detailResponse);
         } else {
             for (ResourceDetail detail : detailList) {
-                ResourceDetailResponse detailResponse = createResourceDetailsResponse(resourceId, detail.getName(), detail.getValue(),
-                        resourceType);
+                ResourceDetailResponse detailResponse = createResourceDetailsResponse(detail, resourceType);
                 responseList.add(detailResponse);
             }
         }
@@ -3291,12 +3293,13 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
     }
 
     
-    protected ResourceDetailResponse createResourceDetailsResponse(long resourceId, String key, String value, ResourceTag.ResourceObjectType type) {
+    protected ResourceDetailResponse createResourceDetailsResponse(ResourceDetail requestedDetail, ResourceTag.ResourceObjectType resourceType) {
         ResourceDetailResponse resourceDetailResponse = new ResourceDetailResponse();
-        resourceDetailResponse.setResourceId(String.valueOf(resourceId));
-        resourceDetailResponse.setName(key);
-        resourceDetailResponse.setValue(value);
-        resourceDetailResponse.setResourceType(type.toString());
+        resourceDetailResponse.setResourceId(String.valueOf(requestedDetail.getResourceId()));
+        resourceDetailResponse.setName(requestedDetail.getName());
+        resourceDetailResponse.setValue(requestedDetail.getValue());
+        resourceDetailResponse.setForDisplay(requestedDetail.isDisplay());
+        resourceDetailResponse.setResourceType(resourceType.toString().toString());
         resourceDetailResponse.setObjectName("resourcedetail");
         return resourceDetailResponse;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/server/src/com/cloud/api/query/dao/DataCenterJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/DataCenterJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/DataCenterJoinDaoImpl.java
index 5198555..c06e294 100644
--- a/server/src/com/cloud/api/query/dao/DataCenterJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/DataCenterJoinDaoImpl.java
@@ -105,7 +105,7 @@ public class DataCenterJoinDaoImpl extends GenericDaoBase<DataCenterJoinVO, Long
             zoneResponse.addTag(tagResponse);
         }
         
-        zoneResponse.setResourceDetails(ApiDBUtils.getZoneDetails(dataCenter.getId()));
+        zoneResponse.setResourceDetails(ApiDBUtils.getResourceDetails(dataCenter.getId(), ResourceObjectType.Zone));
         
         zoneResponse.setObjectName("zone");
         return zoneResponse;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/server/src/com/cloud/api/query/dao/ServiceOfferingJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/ServiceOfferingJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/ServiceOfferingJoinDaoImpl.java
index 1727034..3bc6c78 100644
--- a/server/src/com/cloud/api/query/dao/ServiceOfferingJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/ServiceOfferingJoinDaoImpl.java
@@ -27,6 +27,7 @@ import org.springframework.stereotype.Component;
 import com.cloud.api.ApiDBUtils;
 import com.cloud.api.query.vo.ServiceOfferingJoinVO;
 import com.cloud.offering.ServiceOffering;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.utils.db.GenericDaoBase;
 import com.cloud.utils.db.SearchBuilder;
 import com.cloud.utils.db.SearchCriteria;
@@ -79,7 +80,7 @@ public class ServiceOfferingJoinDaoImpl extends GenericDaoBase<ServiceOfferingJo
         offeringResponse.setBytesWriteRate(offering.getBytesWriteRate());
         offeringResponse.setIopsReadRate(offering.getIopsReadRate());
         offeringResponse.setIopsWriteRate(offering.getIopsWriteRate());
-        offeringResponse.setDetails(ApiDBUtils.getServiceOfferingDetails(offering.getId()));
+        offeringResponse.setDetails(ApiDBUtils.getResourceDetails(offering.getId(), ResourceObjectType.ServiceOffering));
         offeringResponse.setObjectName("serviceoffering");
 
         return offeringResponse;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 998e3ef..e3aa4fa 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -451,8 +451,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
                 if (zone == null) {
                     throw new InvalidParameterValueException("unable to find zone by id " + resourceId);
                 }
-                DataCenterDetailVO dcDetailVO = new DataCenterDetailVO(resourceId, name, value);
-                _dcDetailsDao.addDetail(dcDetailVO);
+                _dcDetailsDao.addDetail(resourceId, name, value);
                 break;
             case Cluster:
                 ClusterVO cluster = _clusterDao.findById(resourceId);
@@ -474,8 +473,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
                 if (pool == null) {
                     throw new InvalidParameterValueException("unable to find storage pool by id " + resourceId);
                 }
-                StoragePoolDetailVO storagePoolDetailVO = _storagePoolDetailsDao.findDetail(resourceId, name);
-                _storagePoolDetailsDao.addDetail(storagePoolDetailVO);
+                _storagePoolDetailsDao.addDetail(resourceId, name, value);
                 
                 break;
 
@@ -2107,7 +2105,7 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
                     detailsVO.add(new ServiceOfferingDetailsVO(offering.getId(), key, details.get(key)));
                 }
                 
-                _serviceOfferingDetailsDao.addDetails(detailsVO);
+                _serviceOfferingDetailsDao.saveDetails(detailsVO);
             }
             CallContext.current().setEventDetails("Service offering id=" + offering.getId());
             return offering;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
index e55477a..e82aaba 100755
--- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
+++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
@@ -1326,7 +1326,7 @@ VirtualMachineGuru, SystemVmLoadScanHandler<Long>, ResourceStateAdapter {
     public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) {
 
         ConsoleProxyVO vm = _consoleProxyDao.findById(profile.getId());
-        Map<String, String> details = _vmDetailsDao.findDetails(vm.getId());
+        Map<String, String> details = _vmDetailsDao.listDetailsKeyPairs(vm.getId());
         vm.setDetails(details);
 
         StringBuilder buf = profile.getBootArgsBuilder();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/server/src/com/cloud/hypervisor/HypervisorGuruBase.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/HypervisorGuruBase.java b/server/src/com/cloud/hypervisor/HypervisorGuruBase.java
index a528334..4e28a6a 100644
--- a/server/src/com/cloud/hypervisor/HypervisorGuruBase.java
+++ b/server/src/com/cloud/hypervisor/HypervisorGuruBase.java
@@ -115,7 +115,7 @@ public abstract class HypervisorGuruBase extends AdapterBase implements Hypervis
             to.setArch("x86_64");
         }
 
-        Map<String, String> detailsInVm = _userVmDetailsDao.findDetails(vm.getId());
+        Map<String, String> detailsInVm = _userVmDetailsDao.listDetailsKeyPairs(vm.getId());
         if(detailsInVm != null) {
             to.setDetails(detailsInVm);
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java b/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
index ec5b7ea..5f7ad4b 100644
--- a/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
+++ b/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
@@ -16,7 +16,6 @@
 // under the License.
 package com.cloud.metadata;
 
-import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -122,14 +121,7 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements Resource
                     }
 
                     DetailDaoHelper newDetailDaoHelper = new DetailDaoHelper(resourceType);
-                    ResourceDetail detail = newDetailDaoHelper.createDetail( _taggedResourceMgr.getResourceId(resourceId, resourceType), key, value);
-                    
-                    if (detail == null) {
-                        throw new UnsupportedOperationException("ResourceType " + resourceType + " doesn't support metadata");
-
-                    }
-                    newDetailDaoHelper.addDetail(detail);
-                        
+                    newDetailDaoHelper.addDetail( _taggedResourceMgr.getResourceId(resourceId, resourceType), key, value);                    
                 }
                 
                 return true;
@@ -166,39 +158,50 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements Resource
             this.dao = (ResourceDetailsDao)_daoMap.get(resourceType);
         }
         
-        private void addDetail(ResourceDetail detail) {
-            dao.addDetail(detail);   
-        }
-        
         private void removeDetail(long resourceId, String key) {
             dao.removeDetail(resourceId, key);
         }
         
-        private List<? extends ResourceDetail> getDetails(long resourceId) {
-            List<? extends ResourceDetail> detailList = new ArrayList<ResourceDetail>();        
-            detailList = dao.findDetailsList(resourceId);
-            return detailList;
-        }
-        
         private ResourceDetail getDetail(long resourceId, String key) {
             return dao.findDetail(resourceId, key);
         }
         
-        private ResourceDetail createDetail(long resourceId, String key, String value) {
-            return dao.createDetail(resourceId, key, value);
+        private void addDetail(long resourceId, String key, String value) {
+            dao.addDetail(resourceId, key, value);
+        }
+        
+        private Map<String, String> getDetailsMap(long resourceId, Boolean forDisplay) {            
+            if (forDisplay == null) {
+                return dao.listDetailsKeyPairs(resourceId);
+            } else  {
+                return dao.listDetailsKeyPairs(resourceId, forDisplay);
+            }
         }
         
+        private List<? extends ResourceDetail> getDetailsList(long resourceId, Boolean forDisplay) {
+            if (forDisplay == null) {
+                return dao.listDetails(resourceId);
+            } else {
+                return dao.listDetails(resourceId, forDisplay);
+            }
+        }
     }
     
     @Override
-    public List<? extends ResourceDetail> getDetails(long resourceId, ResourceObjectType resourceType) {
+    public List<? extends ResourceDetail> getDetailsList(long resourceId, ResourceObjectType resourceType, Boolean forDisplay) {
         DetailDaoHelper newDetailDaoHelper = new DetailDaoHelper(resourceType);
-        return newDetailDaoHelper.getDetails(resourceId);  
+        return newDetailDaoHelper.getDetailsList(resourceId, forDisplay);  
     }
     
     @Override
     public ResourceDetail getDetail(long resourceId, ResourceObjectType resourceType, String key) {
         DetailDaoHelper newDetailDaoHelper = new DetailDaoHelper(resourceType);
-        return newDetailDaoHelper.getDetail(resourceId, key);  
+        return newDetailDaoHelper.getDetail(resourceId, key);
+    }
+    
+    @Override 
+    public Map<String, String> getDetailsMap(long resourceId, ResourceObjectType resourceType, Boolean forDisplay) {
+        DetailDaoHelper newDetailDaoHelper = new DetailDaoHelper(resourceType);
+        return newDetailDaoHelper.getDetailsMap(resourceId, forDisplay); 
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index 48fdc35..a93480b 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -2008,7 +2008,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V
 
         //1) Set router details
         DomainRouterVO router = _routerDao.findById(profile.getVirtualMachine().getId());
-        Map<String, String> details = _vmDetailsDao.findDetails(router.getId());
+        Map<String, String> details = _vmDetailsDao.listDetailsKeyPairs(router.getId());
         router.setDetails(details);
 
         //2) Prepare boot loader elements related with Control network

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/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 7342653..a301639 100755
--- a/server/src/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/com/cloud/storage/StorageManagerImpl.java
@@ -706,7 +706,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
         Map<String, String> updatedDetails = new HashMap<String, String>();
 
         if (tags != null) {
-            Map<String, String> existingDetails = _storagePoolDetailsDao.findDetails(id);
+            Map<String, String> existingDetails = _storagePoolDetailsDao.listDetailsKeyPairs(id);
             Set<String> existingKeys = existingDetails.keySet();
 
             Map<String, String> existingDetailsToKeep = new HashMap<String, String>();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
index 007557d..7743dca 100755
--- a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
+++ b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
@@ -1006,7 +1006,7 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements Secondar
     public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) {
 
         SecondaryStorageVmVO vm = _secStorageVmDao.findById(profile.getId());
-        Map<String, String> details = _vmDetailsDao.findDetails(vm.getId());
+        Map<String, String> details = _vmDetailsDao.listDetailsKeyPairs(vm.getId());
         vm.setDetails(details);
 
         DataStore secStore = _dataStoreMgr.getImageStore(dest.getDataCenter().getId());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/server/src/com/cloud/template/TemplateManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java
index d32776a..50e557a 100755
--- a/server/src/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/com/cloud/template/TemplateManagerImpl.java
@@ -1639,7 +1639,7 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
                 for (String key : detailsStr.keySet()) {
                     details.add(new VMTemplateDetailVO(template.getId(), key, detailsStr.get(key)));
                 }
-                _templateDetailsDao.addDetails(details);
+                _templateDetailsDao.saveDetails(details);
             }
 
             _resourceLimitMgr.incrementResourceCount(templateOwner.getId(), ResourceType.template);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index f202784..a0c7151 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -3002,7 +3002,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
     @Override
     public boolean finalizeVirtualMachineProfile(VirtualMachineProfile profile, DeployDestination dest, ReservationContext context) {
         UserVmVO vm = _vmDao.findById(profile.getId());
-        Map<String, String> details = _vmDetailsDao.findDetails(vm.getId());
+        Map<String, String> details = _vmDetailsDao.listDetailsKeyPairs(vm.getId());
         vm.setDetails(details);
 
         if (vm.getIsoId() != null) {
@@ -4202,7 +4202,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
     }
     private boolean isServiceOfferingUsingPlannerInPreferredMode(long serviceOfferingId) {
         boolean preferred = false;
-        Map<String, String> details = serviceOfferingDetailsDao.findDetails(serviceOfferingId);
+        Map<String, String> details = serviceOfferingDetailsDao.listDetailsKeyPairs(serviceOfferingId);
         if (details != null && !details.isEmpty()) {
             String preferredAttribute = details.get("ImplicitDedicationMode");
             if (preferredAttribute != null && preferredAttribute.equals("Preferred")) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/591dcd1d/setup/db/db/schema-421to430.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-421to430.sql b/setup/db/db/schema-421to430.sql
index 0e78875..803f1d9 100644
--- a/setup/db/db/schema-421to430.sql
+++ b/setup/db/db/schema-421to430.sql
@@ -464,10 +464,20 @@ CREATE VIEW `cloud`.`storage_pool_view` AS
             
 CREATE TABLE `cloud`.`firewall_rule_details` (
   `id` bigint unsigned NOT NULL auto_increment,
-  `firewall_rule_id` bigint unsigned NOT NULL COMMENT 'firewall rule id',
+  `firewall_rule_id` bigint unsigned NOT NULL COMMENT 'Firewall rule id',
   `name` varchar(255) NOT NULL,
   `value` varchar(1024) NOT NULL,
-  `display_detail` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'True if detail can be displayed to the end user',
+  `display` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'True if the detail can be displayed to the end user',
   PRIMARY KEY (`id`),
   CONSTRAINT `fk_firewall_rule_details__firewall_rule_id` FOREIGN KEY `fk_firewall_rule_details__firewall_rule_id`(`firewall_rule_id`) REFERENCES `firewall_rules`(`id`) ON DELETE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+
+ALTER TABLE `cloud`.`data_center_details` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'True if the detail can be displayed to the end user';
+ALTER TABLE `cloud`.`network_details` CHANGE `display_detail` `display` tinyint(0) NOT NULL DEFAULT '0' COMMENT 'True if the detail can be displayed to the end user';
+ALTER TABLE `cloud`.`vm_template_details` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'True if the detail can be displayed to the end user';
+ALTER TABLE `cloud`.`volume_details` CHANGE `display_detail` `display` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'True if the detail can be displayed to the end user';
+ALTER TABLE `cloud`.`nic_details` CHANGE `display_detail` `display` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'True if the detail can be displayed to the end user';
+ALTER TABLE `cloud`.`user_vm_details` CHANGE `display_detail` `display` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'True if the detail can be displayed to the end user';
+ALTER TABLE `cloud`.`service_offering_details` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'True if the detail can be displayed to the end user';
+ALTER TABLE `cloud`.`storage_pool_details` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'True if the detail can be displayed to the end user';


Mime
View raw message