cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [46/50] [abbrv] git commit: updated refs/heads/object_store_migration to 5ec2a44
Date Tue, 29 Oct 2013 03:53:36 GMT
ResourceDetails -

1) added createDetail to ResourceDetailDao interface to provide generic way of creating resourceDetail DB objects
2) added resource details support for firewall rules


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

Branch: refs/heads/object_store_migration
Commit: 5caeab782d8123bc8f1bfe0937e1bbd703a35f66
Parents: 9b1cfa4
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Mon Oct 28 12:53:00 2013 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Mon Oct 28 14:45:52 2013 -0700

----------------------------------------------------------------------
 api/src/com/cloud/server/ResourceTag.java       |   2 +-
 .../spring-engine-schema-core-daos-context.xml  |   4 +-
 .../com/cloud/dc/dao/DataCenterDetailsDao.java  |   2 +-
 .../cloud/dc/dao/DataCenterDetailsDaoImpl.java  |   3 +-
 .../src/com/cloud/dc/dao/ResourceDetailDao.java |  42 -------
 .../com/cloud/dc/dao/ResourceDetailDaoBase.java | 116 -------------------
 .../com/cloud/dc/dao/ResourceDetailsDao.java    |  42 +++++++
 .../cloud/dc/dao/ResourceDetailsDaoBase.java    | 116 +++++++++++++++++++
 .../cloud/network/dao/NetworkDetailsDao.java    |   4 +-
 .../network/dao/NetworkDetailsDaoImpl.java      |   4 +-
 .../service/dao/ServiceOfferingDetailsDao.java  |   4 +-
 .../dao/ServiceOfferingDetailsDaoImpl.java      |   4 +-
 .../storage/dao/StoragePoolDetailsDaoImpl.java  |   4 +-
 .../cloud/storage/dao/VMTemplateDetailsDao.java |   4 +-
 .../storage/dao/VMTemplateDetailsDaoImpl.java   |   4 +-
 .../com/cloud/storage/dao/VolumeDetailsDao.java |   4 +-
 .../cloud/storage/dao/VolumeDetailsDaoImpl.java |   4 +-
 .../src/com/cloud/vm/dao/NicDetailDao.java      |  24 ----
 .../src/com/cloud/vm/dao/NicDetailDaoImpl.java  |  34 ------
 .../src/com/cloud/vm/dao/NicDetailsDao.java     |  24 ++++
 .../src/com/cloud/vm/dao/NicDetailsDaoImpl.java |  34 ++++++
 .../src/com/cloud/vm/dao/UserVmDetailsDao.java  |   4 +-
 .../com/cloud/vm/dao/UserVmDetailsDaoImpl.java  |   4 +-
 .../resourcedetail/FirewallRuleDetailVO.java    |  72 ++++++++++++
 .../dao/FirewallRuleDetailsDao.java             |  26 +++++
 .../dao/FirewallRuleDetailsDaoImpl.java         |  34 ++++++
 .../db/PrimaryDataStoreDetailsDao.java          |   4 +-
 .../datastore/db/StoragePoolDetailsDao.java     |   4 +-
 .../db/PrimaryDataStoreDetailsDaoImpl.java      |   4 +-
 server/src/com/cloud/api/ApiDBUtils.java        |   2 +-
 .../com/cloud/api/query/QueryManagerImpl.java   |   4 +-
 .../metadata/ResourceMetaDataManagerImpl.java   |  20 ++--
 .../metadata/ResourceMetaDataManagerTest.java   |   4 +-
 setup/db/db/schema-421to430.sql                 |  13 +++
 34 files changed, 412 insertions(+), 262 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/api/src/com/cloud/server/ResourceTag.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/server/ResourceTag.java b/api/src/com/cloud/server/ResourceTag.java
index 85bbcd0..ab74d26 100644
--- a/api/src/com/cloud/server/ResourceTag.java
+++ b/api/src/com/cloud/server/ResourceTag.java
@@ -33,7 +33,7 @@ public interface ResourceTag extends ControlledEntity, Identity, InternalIdentit
         Nic (false, true),
         LoadBalancer (true, false),
         PortForwardingRule (true, false),
-        FirewallRule (true, false),
+        FirewallRule (true, true),
         SecurityGroup (true, false),
         PublicIpAddress (true, false),
         Project (true, false),

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
----------------------------------------------------------------------
diff --git a/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml b/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
index 3fce439..e811cce 100644
--- a/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
+++ b/engine/schema/resources/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml
@@ -203,7 +203,7 @@
   <bean id="networkRuleConfigDaoImpl" class="com.cloud.network.dao.NetworkRuleConfigDaoImpl" />
   <bean id="networkServiceMapDaoImpl" class="com.cloud.network.dao.NetworkServiceMapDaoImpl" />
   <bean id="nicDaoImpl" class="com.cloud.vm.dao.NicDaoImpl" />
-  <bean id="nicDetailDaoImpl" class="com.cloud.vm.dao.NicDetailDaoImpl" />
+  <bean id="nicDetailsDaoImpl" class="com.cloud.vm.dao.NicDetailsDaoImpl" />
   <bean id="nicSecondaryIpDaoImpl" class="com.cloud.vm.dao.NicSecondaryIpDaoImpl" />
   <bean id="nicIpAliasDaoImpl" class="com.cloud.vm.dao.NicIpAliasDaoImpl" />
   <bean id="objectInDataStoreDaoImpl" class="org.apache.cloudstack.storage.db.ObjectInDataStoreDaoImpl" />
@@ -313,10 +313,10 @@
   <bean id="networkOfferingDetailsDaoImpl" class="com.cloud.offerings.dao.NetworkOfferingDetailsDaoImpl" />
   <bean id="serviceOfferingDetailsDaoImpl" class="com.cloud.service.dao.ServiceOfferingDetailsDaoImpl"/>
   <bean id="networkDetailsDaoImpl" class="com.cloud.network.dao.NetworkDetailsDaoImpl" />
-
   <bean id="AffinityGroupDaoImpl" class="org.apache.cloudstack.affinity.dao.AffinityGroupDaoImpl" />
   <bean id="AffinityGroupVMMapDaoImpl" class="org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDaoImpl" />
   <bean id="AffinityGroupDomainMapDaoImpl" class="org.apache.cloudstack.affinity.dao.AffinityGroupDomainMapDaoImpl" />
+  <bean id="FirewallRuleDetailsDaoImpl" class="org.apache.cloudstack.resourcedetail.dao.FirewallRuleDetailsDaoImpl" />
   
   <bean id="databaseIntegrityChecker" class="com.cloud.upgrade.DatabaseIntegrityChecker" />
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/engine/schema/src/com/cloud/dc/dao/DataCenterDetailsDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/dc/dao/DataCenterDetailsDao.java b/engine/schema/src/com/cloud/dc/dao/DataCenterDetailsDao.java
index 011aa73..747d558 100644
--- a/engine/schema/src/com/cloud/dc/dao/DataCenterDetailsDao.java
+++ b/engine/schema/src/com/cloud/dc/dao/DataCenterDetailsDao.java
@@ -19,5 +19,5 @@ package com.cloud.dc.dao;
 import com.cloud.dc.DataCenterDetailVO;
 import com.cloud.utils.db.GenericDao;
 
-public interface DataCenterDetailsDao extends GenericDao<DataCenterDetailVO, Long>, ResourceDetailDao<DataCenterDetailVO> {
+public interface DataCenterDetailsDao extends GenericDao<DataCenterDetailVO, Long>, ResourceDetailsDao<DataCenterDetailVO> {
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/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 bc0621d..1d003ca 100644
--- a/engine/schema/src/com/cloud/dc/dao/DataCenterDetailsDaoImpl.java
+++ b/engine/schema/src/com/cloud/dc/dao/DataCenterDetailsDaoImpl.java
@@ -26,7 +26,8 @@ import org.apache.cloudstack.framework.config.ScopedConfigStorage;
 import com.cloud.dc.DataCenterDetailVO;
 
 @Local(value=DataCenterDetailsDao.class)
-public class DataCenterDetailsDaoImpl extends ResourceDetailDaoBase<DataCenterDetailVO> implements DataCenterDetailsDao, ScopedConfigStorage {
+public class DataCenterDetailsDaoImpl extends ResourceDetailsDaoBase<DataCenterDetailVO> implements DataCenterDetailsDao, ScopedConfigStorage {
+
     
     @Override
     public Scope getScope() {

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

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/engine/schema/src/com/cloud/dc/dao/ResourceDetailDaoBase.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/dc/dao/ResourceDetailDaoBase.java b/engine/schema/src/com/cloud/dc/dao/ResourceDetailDaoBase.java
deleted file mode 100644
index 9102a62..0000000
--- a/engine/schema/src/com/cloud/dc/dao/ResourceDetailDaoBase.java
+++ /dev/null
@@ -1,116 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.dc.dao;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.cloudstack.api.ResourceDetail;
-
-import com.cloud.utils.db.GenericDaoBase;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
-import com.cloud.utils.db.TransactionLegacy;
-
-
-public abstract class ResourceDetailDaoBase<R extends ResourceDetail> extends GenericDaoBase<R, Long>{
-    private SearchBuilder<R> AllFieldsSearch;
-    
-    public ResourceDetailDaoBase() {
-        AllFieldsSearch = createSearchBuilder();
-        AllFieldsSearch.and("resourceId", AllFieldsSearch.entity().getResourceId(), SearchCriteria.Op.EQ);
-        AllFieldsSearch.and("name", AllFieldsSearch.entity().getName(), SearchCriteria.Op.EQ);
-        AllFieldsSearch.done();
-    }
-
-    public R findDetail(long resourceId, String name) {
-        SearchCriteria<R> sc = AllFieldsSearch.create();
-        sc.setParameters("resourceId", resourceId);
-        sc.setParameters("name", name);
-        
-        return findOneBy(sc);
-    }
-
-
-    public Map<String, String> findDetails(long resourceId) {
-        SearchCriteria<R> sc = AllFieldsSearch.create();
-        sc.setParameters("resourceId", resourceId);
-        
-        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> findDetailsList(long resourceId) {
-        SearchCriteria<R> sc = AllFieldsSearch.create();
-        sc.setParameters("resourceId", resourceId);
-
-        List<R> results = search(sc, null);
-        return results;
-    }
-
-
-    public void removeDetails(long resourceId) {
-        SearchCriteria<R> sc = AllFieldsSearch.create();
-        sc.setParameters("resourceId", resourceId);
-        remove(sc);
-    }
-
-    
-    public void removeDetail(long resourceId, String key) {
-        if (key != null){
-            SearchCriteria<R> sc = AllFieldsSearch.create();
-            sc.setParameters("name", key);
-            remove(sc);
-        }
-    }
-
-
-    public void addDetails(List<R> details) {
-        if (details.isEmpty()) {
-            return;
-        }
-        TransactionLegacy txn = TransactionLegacy.currentTxn();
-        txn.start();
-        SearchCriteria<R> sc = AllFieldsSearch.create();
-        sc.setParameters("resourceId", details.get(0).getResourceId());
-        expunge(sc);
-        
-        for (R detail : details) {
-            persist(detail);
-        }
-        
-        txn.commit();
-    }
-    
-
-    public void addDetail(R detail) {
-        if (detail == null) {
-            return;
-        }
-        R existingDetail = findDetail(detail.getResourceId(), detail.getName());
-        if (existingDetail != null) {
-            remove(existingDetail.getId());
-        }
-        persist(detail);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/engine/schema/src/com/cloud/dc/dao/ResourceDetailsDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/dc/dao/ResourceDetailsDao.java b/engine/schema/src/com/cloud/dc/dao/ResourceDetailsDao.java
new file mode 100644
index 0000000..fd8f89c
--- /dev/null
+++ b/engine/schema/src/com/cloud/dc/dao/ResourceDetailsDao.java
@@ -0,0 +1,42 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.dc.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.cloudstack.api.ResourceDetail;
+
+import com.cloud.utils.db.GenericDao;
+
+public interface ResourceDetailsDao<R extends ResourceDetail> extends GenericDao<R, Long>{
+    public R findDetail(long resourceId, String name);
+
+    public Map<String, String> findDetails(long resourceId);
+
+    public List<R> findDetailsList(long resourceId);
+
+    public void removeDetails(long resourceId);
+
+    public void removeDetail(long resourceId, String key);
+
+    public void addDetails(List<R> details);
+    
+    public void addDetail(R detail);
+    
+    public R createDetail(long resourceId, String key, String value);
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/engine/schema/src/com/cloud/dc/dao/ResourceDetailsDaoBase.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/dc/dao/ResourceDetailsDaoBase.java b/engine/schema/src/com/cloud/dc/dao/ResourceDetailsDaoBase.java
new file mode 100644
index 0000000..ba0e5c3
--- /dev/null
+++ b/engine/schema/src/com/cloud/dc/dao/ResourceDetailsDaoBase.java
@@ -0,0 +1,116 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.dc.dao;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.cloudstack.api.ResourceDetail;
+
+import com.cloud.utils.db.GenericDaoBase;
+import com.cloud.utils.db.SearchBuilder;
+import com.cloud.utils.db.SearchCriteria;
+import com.cloud.utils.db.TransactionLegacy;
+
+
+public abstract class ResourceDetailsDaoBase<R extends ResourceDetail> extends GenericDaoBase<R, Long>{
+    private SearchBuilder<R> AllFieldsSearch;
+    
+    public ResourceDetailsDaoBase() {
+        AllFieldsSearch = createSearchBuilder();
+        AllFieldsSearch.and("resourceId", AllFieldsSearch.entity().getResourceId(), SearchCriteria.Op.EQ);
+        AllFieldsSearch.and("name", AllFieldsSearch.entity().getName(), SearchCriteria.Op.EQ);
+        AllFieldsSearch.done();
+    }
+
+    public R findDetail(long resourceId, String name) {
+        SearchCriteria<R> sc = AllFieldsSearch.create();
+        sc.setParameters("resourceId", resourceId);
+        sc.setParameters("name", name);
+        
+        return findOneBy(sc);
+    }
+
+
+    public Map<String, String> findDetails(long resourceId) {
+        SearchCriteria<R> sc = AllFieldsSearch.create();
+        sc.setParameters("resourceId", resourceId);
+        
+        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> findDetailsList(long resourceId) {
+        SearchCriteria<R> sc = AllFieldsSearch.create();
+        sc.setParameters("resourceId", resourceId);
+
+        List<R> results = search(sc, null);
+        return results;
+    }
+
+
+    public void removeDetails(long resourceId) {
+        SearchCriteria<R> sc = AllFieldsSearch.create();
+        sc.setParameters("resourceId", resourceId);
+        remove(sc);
+    }
+
+    
+    public void removeDetail(long resourceId, String key) {
+        if (key != null){
+            SearchCriteria<R> sc = AllFieldsSearch.create();
+            sc.setParameters("name", key);
+            remove(sc);
+        }
+    }
+
+
+    public void addDetails(List<R> details) {
+        if (details.isEmpty()) {
+            return;
+        }
+        TransactionLegacy txn = TransactionLegacy.currentTxn();
+        txn.start();
+        SearchCriteria<R> sc = AllFieldsSearch.create();
+        sc.setParameters("resourceId", details.get(0).getResourceId());
+        expunge(sc);
+        
+        for (R detail : details) {
+            persist(detail);
+        }
+        
+        txn.commit();
+    }
+    
+
+    public void addDetail(R detail) {
+        if (detail == null) {
+            return;
+        }
+        R existingDetail = findDetail(detail.getResourceId(), detail.getName());
+        if (existingDetail != null) {
+            remove(existingDetail.getId());
+        }
+        persist(detail);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/engine/schema/src/com/cloud/network/dao/NetworkDetailsDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/NetworkDetailsDao.java b/engine/schema/src/com/cloud/network/dao/NetworkDetailsDao.java
index f791888..ec1b44c 100644
--- a/engine/schema/src/com/cloud/network/dao/NetworkDetailsDao.java
+++ b/engine/schema/src/com/cloud/network/dao/NetworkDetailsDao.java
@@ -16,9 +16,9 @@
 // under the License.
 package com.cloud.network.dao;
 
-import com.cloud.dc.dao.ResourceDetailDao;
+import com.cloud.dc.dao.ResourceDetailsDao;
 import com.cloud.utils.db.GenericDao;
 
-public interface NetworkDetailsDao extends GenericDao<NetworkDetailVO, Long>, ResourceDetailDao<NetworkDetailVO> {
+public interface NetworkDetailsDao extends GenericDao<NetworkDetailVO, Long>, ResourceDetailsDao<NetworkDetailVO> {
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/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 7f43f44..5306a35 100644
--- a/engine/schema/src/com/cloud/network/dao/NetworkDetailsDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/NetworkDetailsDaoImpl.java
@@ -20,11 +20,11 @@ import javax.ejb.Local;
 
 import org.springframework.stereotype.Component;
 
-import com.cloud.dc.dao.ResourceDetailDaoBase;
+import com.cloud.dc.dao.ResourceDetailsDaoBase;
 
 @Component
 @Local(value=NetworkDetailsDao.class)
-public class NetworkDetailsDaoImpl extends ResourceDetailDaoBase<NetworkDetailVO> implements NetworkDetailsDao {
+public class NetworkDetailsDaoImpl extends ResourceDetailsDaoBase<NetworkDetailVO> implements NetworkDetailsDao {
 
     @Override
     public NetworkDetailVO createDetail(long resourceId, String key, String value) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/engine/schema/src/com/cloud/service/dao/ServiceOfferingDetailsDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/service/dao/ServiceOfferingDetailsDao.java b/engine/schema/src/com/cloud/service/dao/ServiceOfferingDetailsDao.java
index ba753b7..495ccd5 100644
--- a/engine/schema/src/com/cloud/service/dao/ServiceOfferingDetailsDao.java
+++ b/engine/schema/src/com/cloud/service/dao/ServiceOfferingDetailsDao.java
@@ -16,9 +16,9 @@
 // under the License.
 package com.cloud.service.dao;
 
-import com.cloud.dc.dao.ResourceDetailDao;
+import com.cloud.dc.dao.ResourceDetailsDao;
 import com.cloud.service.ServiceOfferingDetailsVO;
 import com.cloud.utils.db.GenericDao;
 
-public interface ServiceOfferingDetailsDao extends GenericDao<ServiceOfferingDetailsVO, Long>, ResourceDetailDao<ServiceOfferingDetailsVO> {
+public interface ServiceOfferingDetailsDao extends GenericDao<ServiceOfferingDetailsVO, Long>, ResourceDetailsDao<ServiceOfferingDetailsVO> {
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/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 96f1085..c059ca8 100644
--- a/engine/schema/src/com/cloud/service/dao/ServiceOfferingDetailsDaoImpl.java
+++ b/engine/schema/src/com/cloud/service/dao/ServiceOfferingDetailsDaoImpl.java
@@ -20,12 +20,12 @@ import javax.ejb.Local;
 
 import org.springframework.stereotype.Component;
 
-import com.cloud.dc.dao.ResourceDetailDaoBase;
+import com.cloud.dc.dao.ResourceDetailsDaoBase;
 import com.cloud.service.ServiceOfferingDetailsVO;
 
 @Component
 @Local(value=ServiceOfferingDetailsDao.class)
-public class ServiceOfferingDetailsDaoImpl extends ResourceDetailDaoBase<ServiceOfferingDetailsVO>
+public class ServiceOfferingDetailsDaoImpl extends ResourceDetailsDaoBase<ServiceOfferingDetailsVO>
         implements ServiceOfferingDetailsDao {
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/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 521f325..8914732 100644
--- a/engine/schema/src/com/cloud/storage/dao/StoragePoolDetailsDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/StoragePoolDetailsDaoImpl.java
@@ -24,10 +24,10 @@ import org.apache.cloudstack.framework.config.ScopedConfigStorage;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolDetailVO;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolDetailsDao;
 
-import com.cloud.dc.dao.ResourceDetailDaoBase;
+import com.cloud.dc.dao.ResourceDetailsDaoBase;
 
 @Local(value = StoragePoolDetailsDao.class)
-public class StoragePoolDetailsDaoImpl extends ResourceDetailDaoBase<StoragePoolDetailVO> implements StoragePoolDetailsDao, ScopedConfigStorage {
+public class StoragePoolDetailsDaoImpl extends ResourceDetailsDaoBase<StoragePoolDetailVO> implements StoragePoolDetailsDao, ScopedConfigStorage {
 
     public StoragePoolDetailsDaoImpl() {
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/engine/schema/src/com/cloud/storage/dao/VMTemplateDetailsDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/dao/VMTemplateDetailsDao.java b/engine/schema/src/com/cloud/storage/dao/VMTemplateDetailsDao.java
index aa7ce4b..818f9dd 100644
--- a/engine/schema/src/com/cloud/storage/dao/VMTemplateDetailsDao.java
+++ b/engine/schema/src/com/cloud/storage/dao/VMTemplateDetailsDao.java
@@ -16,10 +16,10 @@
 // under the License.
 package com.cloud.storage.dao;
 
-import com.cloud.dc.dao.ResourceDetailDao;
+import com.cloud.dc.dao.ResourceDetailsDao;
 import com.cloud.storage.VMTemplateDetailVO;
 import com.cloud.utils.db.GenericDao;
 
-public interface VMTemplateDetailsDao extends GenericDao<VMTemplateDetailVO, Long>, ResourceDetailDao<VMTemplateDetailVO> {
+public interface VMTemplateDetailsDao extends GenericDao<VMTemplateDetailVO, Long>, ResourceDetailsDao<VMTemplateDetailVO> {
   
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/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 ad3f1d5..d4ca38e 100644
--- a/engine/schema/src/com/cloud/storage/dao/VMTemplateDetailsDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VMTemplateDetailsDaoImpl.java
@@ -20,12 +20,12 @@ import javax.ejb.Local;
 
 import org.springframework.stereotype.Component;
 
-import com.cloud.dc.dao.ResourceDetailDaoBase;
+import com.cloud.dc.dao.ResourceDetailsDaoBase;
 import com.cloud.storage.VMTemplateDetailVO;
 
 @Component
 @Local(value = VMTemplateDetailsDao.class)
-public class VMTemplateDetailsDaoImpl extends ResourceDetailDaoBase<VMTemplateDetailVO> implements VMTemplateDetailsDao {
+public class VMTemplateDetailsDaoImpl extends ResourceDetailsDaoBase<VMTemplateDetailVO> implements VMTemplateDetailsDao {
 
     @Override
     public VMTemplateDetailVO createDetail(long resourceId, String key, String value) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/engine/schema/src/com/cloud/storage/dao/VolumeDetailsDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/dao/VolumeDetailsDao.java b/engine/schema/src/com/cloud/storage/dao/VolumeDetailsDao.java
index 635ca97..a7c7013 100644
--- a/engine/schema/src/com/cloud/storage/dao/VolumeDetailsDao.java
+++ b/engine/schema/src/com/cloud/storage/dao/VolumeDetailsDao.java
@@ -16,10 +16,10 @@
 // under the License.
 package com.cloud.storage.dao;
 
-import com.cloud.dc.dao.ResourceDetailDao;
+import com.cloud.dc.dao.ResourceDetailsDao;
 import com.cloud.storage.VolumeDetailVO;
 import com.cloud.utils.db.GenericDao;
 
-public interface VolumeDetailsDao extends GenericDao<VolumeDetailVO, Long>, ResourceDetailDao<VolumeDetailVO> {
+public interface VolumeDetailsDao extends GenericDao<VolumeDetailVO, Long>, ResourceDetailsDao<VolumeDetailVO> {
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/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 26fdd2f..700be46 100644
--- a/engine/schema/src/com/cloud/storage/dao/VolumeDetailsDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VolumeDetailsDaoImpl.java
@@ -20,12 +20,12 @@ import javax.ejb.Local;
 
 import org.springframework.stereotype.Component;
 
-import com.cloud.dc.dao.ResourceDetailDaoBase;
+import com.cloud.dc.dao.ResourceDetailsDaoBase;
 import com.cloud.storage.VolumeDetailVO;
 
 @Component
 @Local(value=VolumeDetailsDao.class)
-public class VolumeDetailsDaoImpl extends ResourceDetailDaoBase<VolumeDetailVO> implements VolumeDetailsDao {
+public class VolumeDetailsDaoImpl extends ResourceDetailsDaoBase<VolumeDetailVO> implements VolumeDetailsDao {
 
     @Override
     public VolumeDetailVO createDetail(long resourceId, String key, String value) {

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

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/engine/schema/src/com/cloud/vm/dao/NicDetailDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/dao/NicDetailDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/NicDetailDaoImpl.java
deleted file mode 100644
index afab4fd..0000000
--- a/engine/schema/src/com/cloud/vm/dao/NicDetailDaoImpl.java
+++ /dev/null
@@ -1,34 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.vm.dao;
-
-import javax.ejb.Local;
-
-import org.springframework.stereotype.Component;
-
-import com.cloud.dc.dao.ResourceDetailDaoBase;
-import com.cloud.vm.NicDetailVO;
-
-@Component
-@Local (value={NicDetailDao.class})
-public class NicDetailDaoImpl extends ResourceDetailDaoBase<NicDetailVO> implements NicDetailDao {
-
-    @Override
-    public NicDetailVO createDetail(long resourceId, String key, String value) {
-        return new NicDetailVO(resourceId, key, value);
-    }
-}

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

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/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
new file mode 100644
index 0000000..0775f7f
--- /dev/null
+++ b/engine/schema/src/com/cloud/vm/dao/NicDetailsDaoImpl.java
@@ -0,0 +1,34 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.vm.dao;
+
+import javax.ejb.Local;
+
+import org.springframework.stereotype.Component;
+
+import com.cloud.dc.dao.ResourceDetailsDaoBase;
+import com.cloud.vm.NicDetailVO;
+
+@Component
+@Local (value={NicDetailsDao.class})
+public class NicDetailsDaoImpl extends ResourceDetailsDaoBase<NicDetailVO> implements NicDetailsDao {
+
+    @Override
+    public NicDetailVO createDetail(long resourceId, String key, String value) {
+        return new NicDetailVO(resourceId, key, value);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/engine/schema/src/com/cloud/vm/dao/UserVmDetailsDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/dao/UserVmDetailsDao.java b/engine/schema/src/com/cloud/vm/dao/UserVmDetailsDao.java
index a0249e6..c06e9bb 100644
--- a/engine/schema/src/com/cloud/vm/dao/UserVmDetailsDao.java
+++ b/engine/schema/src/com/cloud/vm/dao/UserVmDetailsDao.java
@@ -16,9 +16,9 @@
 // under the License.
 package com.cloud.vm.dao;
 
-import com.cloud.dc.dao.ResourceDetailDao;
+import com.cloud.dc.dao.ResourceDetailsDao;
 import com.cloud.utils.db.GenericDao;
 import com.cloud.vm.UserVmDetailVO;
 
-public interface UserVmDetailsDao extends GenericDao<UserVmDetailVO, Long>, ResourceDetailDao<UserVmDetailVO> {
+public interface UserVmDetailsDao extends GenericDao<UserVmDetailVO, Long>, ResourceDetailsDao<UserVmDetailVO> {
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/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 2829192..45c33cd 100644
--- a/engine/schema/src/com/cloud/vm/dao/UserVmDetailsDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/UserVmDetailsDaoImpl.java
@@ -20,12 +20,12 @@ import javax.ejb.Local;
 
 import org.springframework.stereotype.Component;
 
-import com.cloud.dc.dao.ResourceDetailDaoBase;
+import com.cloud.dc.dao.ResourceDetailsDaoBase;
 import com.cloud.vm.UserVmDetailVO;
 
 @Component
 @Local(value=UserVmDetailsDao.class)
-public class UserVmDetailsDaoImpl extends ResourceDetailDaoBase<UserVmDetailVO> implements UserVmDetailsDao {
+public class UserVmDetailsDaoImpl extends ResourceDetailsDaoBase<UserVmDetailVO> implements UserVmDetailsDao {
 
     @Override
     public UserVmDetailVO createDetail(long resourceId, String key, String value) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/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
new file mode 100644
index 0000000..d7e90e8
--- /dev/null
+++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/FirewallRuleDetailVO.java
@@ -0,0 +1,72 @@
+// 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.resourcedetail;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.apache.cloudstack.api.ResourceDetail;
+
+@Entity
+@Table(name="firewall_rule_details")
+public class FirewallRuleDetailVO implements ResourceDetail{
+        @Id
+        @GeneratedValue(strategy= GenerationType.IDENTITY)
+        @Column(name="id")
+        private long id;
+
+        @Column(name="firewall_rule_id")
+        private long resourceId;
+
+        @Column(name="name")
+        private String name;
+
+        @Column(name="value", length=1024)
+        private String value;
+
+        public FirewallRuleDetailVO() {}
+
+        public FirewallRuleDetailVO(long networkId, String name, String value) {
+            this.resourceId = networkId;
+            this.name = name;
+            this.value = value;
+        }
+
+        @Override
+        public long getId() {
+            return id;
+        }
+
+        @Override
+        public String getName() {
+            return name;
+        }
+
+        @Override
+        public String getValue() {
+            return value;
+        }
+
+        @Override
+        public long getResourceId() {
+            return resourceId;
+        }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/FirewallRuleDetailsDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/FirewallRuleDetailsDao.java b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/FirewallRuleDetailsDao.java
new file mode 100644
index 0000000..eae1d10
--- /dev/null
+++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/FirewallRuleDetailsDao.java
@@ -0,0 +1,26 @@
+// 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.resourcedetail.dao;
+
+import org.apache.cloudstack.resourcedetail.FirewallRuleDetailVO;
+
+import com.cloud.dc.dao.ResourceDetailsDao;
+import com.cloud.utils.db.GenericDao;
+
+public interface FirewallRuleDetailsDao extends GenericDao<FirewallRuleDetailVO, Long>, ResourceDetailsDao<FirewallRuleDetailVO>{
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/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
new file mode 100644
index 0000000..b235ace
--- /dev/null
+++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/dao/FirewallRuleDetailsDaoImpl.java
@@ -0,0 +1,34 @@
+// 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.resourcedetail.dao;
+
+import javax.ejb.Local;
+
+import org.apache.cloudstack.resourcedetail.FirewallRuleDetailVO;
+import org.springframework.stereotype.Component;
+
+import com.cloud.dc.dao.ResourceDetailsDaoBase;
+
+@Component
+@Local (value={FirewallRuleDetailsDao.class})
+public class FirewallRuleDetailsDaoImpl extends ResourceDetailsDaoBase<FirewallRuleDetailVO> implements FirewallRuleDetailsDao {
+
+    @Override
+    public FirewallRuleDetailVO createDetail(long resourceId, String key, String value) {
+        return new FirewallRuleDetailVO(resourceId, key, value);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDetailsDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDetailsDao.java b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDetailsDao.java
index 8466107..7b6d390 100644
--- a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDetailsDao.java
+++ b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDetailsDao.java
@@ -16,7 +16,7 @@
 // under the License.
 package org.apache.cloudstack.storage.datastore.db;
 
-import com.cloud.dc.dao.ResourceDetailDao;
+import com.cloud.dc.dao.ResourceDetailsDao;
 
-public interface PrimaryDataStoreDetailsDao extends ResourceDetailDao<PrimaryDataStoreDetailVO> {
+public interface PrimaryDataStoreDetailsDao extends ResourceDetailsDao<PrimaryDataStoreDetailVO> {
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/engine/schema/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailsDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailsDao.java b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailsDao.java
index f7ef631..2ec04d5 100644
--- a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailsDao.java
+++ b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/StoragePoolDetailsDao.java
@@ -16,8 +16,8 @@
 // under the License.
 package org.apache.cloudstack.storage.datastore.db;
 
-import com.cloud.dc.dao.ResourceDetailDao;
+import com.cloud.dc.dao.ResourceDetailsDao;
 import com.cloud.utils.db.GenericDao;
 
-public interface StoragePoolDetailsDao extends GenericDao<StoragePoolDetailVO, Long>, ResourceDetailDao<StoragePoolDetailVO> {
+public interface StoragePoolDetailsDao extends GenericDao<StoragePoolDetailVO, Long>, ResourceDetailsDao<StoragePoolDetailVO> {
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/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 a1470a3..5613931 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
@@ -20,10 +20,10 @@ import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDetailVO;
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDetailsDao;
 import org.springframework.stereotype.Component;
 
-import com.cloud.dc.dao.ResourceDetailDaoBase;
+import com.cloud.dc.dao.ResourceDetailsDaoBase;
 
 @Component
-public class PrimaryDataStoreDetailsDaoImpl extends ResourceDetailDaoBase<PrimaryDataStoreDetailVO> implements
+public class PrimaryDataStoreDetailsDaoImpl extends ResourceDetailsDaoBase<PrimaryDataStoreDetailVO> implements
         PrimaryDataStoreDetailsDao {
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/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 37b9e9c..1be6a21 100755
--- a/server/src/com/cloud/api/ApiDBUtils.java
+++ b/server/src/com/cloud/api/ApiDBUtils.java
@@ -126,7 +126,7 @@ import com.cloud.dc.dao.ClusterDao;
 import com.cloud.dc.dao.DataCenterDao;
 import com.cloud.dc.dao.DataCenterDetailsDao;
 import com.cloud.dc.dao.HostPodDao;
-import com.cloud.dc.dao.ResourceDetailDaoBase;
+import com.cloud.dc.dao.ResourceDetailsDaoBase;
 import com.cloud.dc.dao.VlanDao;
 import com.cloud.domain.DomainVO;
 import com.cloud.domain.dao.DomainDao;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/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 85674ea..a7d85cf 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -189,7 +189,7 @@ import com.cloud.vm.DomainRouterVO;
 import com.cloud.vm.UserVmVO;
 import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.dao.DomainRouterDao;
-import com.cloud.vm.dao.NicDetailDao;
+import com.cloud.vm.dao.NicDetailsDao;
 import com.cloud.vm.dao.UserVmDao;
 import com.cloud.vm.dao.UserVmDetailsDao;
 
@@ -295,7 +295,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
     private VolumeDetailsDao _volumeDetailDao;
 
     @Inject
-    private NicDetailDao _nicDetailDao;
+    private NicDetailsDao _nicDetailDao;
 
     @Inject
     UserVmDetailsDao _userVmDetailDao;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/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 9a61a67..6d03b2a 100644
--- a/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
+++ b/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
@@ -26,12 +26,13 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
 import org.apache.cloudstack.api.ResourceDetail;
+import org.apache.cloudstack.resourcedetail.dao.FirewallRuleDetailsDao;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolDetailsDao;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.dc.dao.DataCenterDetailsDao;
-import com.cloud.dc.dao.ResourceDetailDao;
+import com.cloud.dc.dao.ResourceDetailsDao;
 import com.cloud.event.ActionEvent;
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
@@ -47,7 +48,7 @@ import com.cloud.utils.db.DB;
 import com.cloud.utils.db.Transaction;
 import com.cloud.utils.db.TransactionCallback;
 import com.cloud.utils.db.TransactionStatus;
-import com.cloud.vm.dao.NicDetailDao;
+import com.cloud.vm.dao.NicDetailsDao;
 import com.cloud.vm.dao.UserVmDetailsDao;
 
 
@@ -58,7 +59,7 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements Resource
     @Inject
     VolumeDetailsDao _volumeDetailDao;
     @Inject
-    NicDetailDao _nicDetailDao;
+    NicDetailsDao _nicDetailDao;
     @Inject
     UserVmDetailsDao _userVmDetailDao;
     @Inject
@@ -73,9 +74,11 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements Resource
     ServiceOfferingDetailsDao _serviceOfferingDetailsDao;
     @Inject
     StoragePoolDetailsDao _storageDetailsDao;
+    @Inject
+    FirewallRuleDetailsDao _firewallRuleDetailsDao;
     
-    private static Map<ResourceObjectType, ResourceDetailDao<? extends ResourceDetail>> _daoMap= 
-            new HashMap<ResourceObjectType, ResourceDetailDao<? extends ResourceDetail>>();
+    private static Map<ResourceObjectType, ResourceDetailsDao<? extends ResourceDetail>> _daoMap= 
+            new HashMap<ResourceObjectType, ResourceDetailsDao<? extends ResourceDetail>>();
     
 
     @Override
@@ -88,6 +91,7 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements Resource
         _daoMap.put(ResourceObjectType.ServiceOffering, _serviceOfferingDetailsDao);
         _daoMap.put(ResourceObjectType.Zone, _dcDetailsDao);
         _daoMap.put(ResourceObjectType.Storage, _storageDetailsDao);
+        _daoMap.put(ResourceObjectType.FirewallRule, _firewallRuleDetailsDao);
         
         return true;
     }
@@ -148,18 +152,18 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements Resource
 
     private class DetailDaoHelper {
         private ResourceObjectType resourceType;
-        private ResourceDetailDao<? super ResourceDetail> dao;
+        private ResourceDetailsDao<? super ResourceDetail> dao;
         
         private DetailDaoHelper(ResourceObjectType resourceType) {
             if (!resourceType.resourceMetadataSupport()) {
                 throw new UnsupportedOperationException("ResourceType " + resourceType + " doesn't support metadata");
             }
             this.resourceType = resourceType;
-            ResourceDetailDao<?> dao = _daoMap.get(resourceType);
+            ResourceDetailsDao<?> dao = _daoMap.get(resourceType);
             if (dao == null) {
                 throw new UnsupportedOperationException("ResourceType " + resourceType + " doesn't support metadata");
             }
-            this.dao = (ResourceDetailDao)_daoMap.get(resourceType);
+            this.dao = (ResourceDetailsDao)_daoMap.get(resourceType);
         }
         
         private void addDetail(ResourceDetail detail) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/server/test/com/cloud/metadata/ResourceMetaDataManagerTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/metadata/ResourceMetaDataManagerTest.java b/server/test/com/cloud/metadata/ResourceMetaDataManagerTest.java
index ae3cae4..84000fc 100644
--- a/server/test/com/cloud/metadata/ResourceMetaDataManagerTest.java
+++ b/server/test/com/cloud/metadata/ResourceMetaDataManagerTest.java
@@ -37,7 +37,7 @@ import com.cloud.exception.ResourceAllocationException;
 import com.cloud.server.ResourceTag;
 import com.cloud.server.TaggedResourceService;
 import com.cloud.storage.dao.VolumeDetailsDao;
-import com.cloud.vm.dao.NicDetailDao;
+import com.cloud.vm.dao.NicDetailsDao;
 
 
 public class ResourceMetaDataManagerTest {
@@ -47,7 +47,7 @@ public class ResourceMetaDataManagerTest {
     @Spy ResourceMetaDataManagerImpl _resourceMetaDataMgr = new ResourceMetaDataManagerImpl();
     @Mock VolumeDetailsDao _volumeDetailDao;
     @Mock
-    NicDetailDao _nicDetailDao;
+    NicDetailsDao _nicDetailDao;
     @Mock TaggedResourceService _taggedResourceMgr;
 
     @Before

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5caeab78/setup/db/db/schema-421to430.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-421to430.sql b/setup/db/db/schema-421to430.sql
index a858e27..0e78875 100644
--- a/setup/db/db/schema-421to430.sql
+++ b/setup/db/db/schema-421to430.sql
@@ -458,3 +458,16 @@ CREATE VIEW `cloud`.`storage_pool_view` AS
         `cloud`.`async_job` ON async_job.instance_id = storage_pool.id
             and async_job.instance_type = 'StoragePool'
             and async_job.job_status = 0;
+            
+            
+            DROP TABLE IF EXISTS `cloud`.`vm_snapshot_details`;
+            
+CREATE TABLE `cloud`.`firewall_rule_details` (
+  `id` bigint unsigned NOT NULL auto_increment,
+  `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',
+  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;


Mime
View raw message