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 765832a
Date Thu, 24 Oct 2013 17:45:25 GMT
Updated Branches:
  refs/heads/master 499a8c091 -> 765832a5c


CLOUDSTACK-4649: added support to removeResourceDetail to remove details for UserVm/Templates

Conflicts:
	engine/schema/src/com/cloud/vm/dao/UserVmDetailsDaoImpl.java
	server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java


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

Branch: refs/heads/master
Commit: 765832a5cf687524cc6143b4f986ead9aeddc398
Parents: 499a8c0
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Thu Oct 24 09:49:29 2013 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Thu Oct 24 10:34:21 2013 -0700

----------------------------------------------------------------------
 .../cloud/storage/dao/VMTemplateDetailsDao.java |  4 ++-
 .../storage/dao/VMTemplateDetailsDaoImpl.java   | 14 +++++++++-
 .../src/com/cloud/vm/dao/NicDetailDao.java      |  2 +-
 .../src/com/cloud/vm/dao/NicDetailDaoImpl.java  |  4 +--
 .../src/com/cloud/vm/dao/UserVmDetailsDao.java  |  6 ++---
 .../com/cloud/vm/dao/UserVmDetailsDaoImpl.java  | 27 ++++++++++----------
 .../metadata/ResourceMetaDataManagerImpl.java   | 12 ++++-----
 7 files changed, 40 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/765832a5/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 284380e..3021b8f 100644
--- a/engine/schema/src/com/cloud/storage/dao/VMTemplateDetailsDao.java
+++ b/engine/schema/src/com/cloud/storage/dao/VMTemplateDetailsDao.java
@@ -30,5 +30,7 @@ public interface VMTemplateDetailsDao extends GenericDao<VMTemplateDetailVO,
Lon
 
     void deleteDetails(long vmId);
     
-    void addTemplateDetail(Long templateId, String key, String value);
+    void addTemplateDetail(long templateId, String key, String value);
+    
+    void removeDetails(long templateId, String key);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/765832a5/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 34b5cc5..f1af0d0 100644
--- a/engine/schema/src/com/cloud/storage/dao/VMTemplateDetailsDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VMTemplateDetailsDaoImpl.java
@@ -98,7 +98,7 @@ public class VMTemplateDetailsDaoImpl extends GenericDaoBase<VMTemplateDetailVO,
     }
     
     @Override
-    public void addTemplateDetail(Long templateId, String key, String value) {
+    public void addTemplateDetail(long templateId, String key, String value) {
         VMTemplateDetailVO detail = findDetail(templateId, key);
         if (detail == null) {
             VMTemplateDetailVO newEntry = new VMTemplateDetailVO(templateId, key, value);
@@ -108,4 +108,16 @@ public class VMTemplateDetailsDaoImpl extends GenericDaoBase<VMTemplateDetailVO,
             update(detail.getId(), detail);
         }
     }
+    
+    @Override
+    public void removeDetails(long templateId, String key) {
+        if(key != null){
+            VMTemplateDetailVO detail = findDetail(templateId, key);
+            if(detail != null){
+                remove(detail.getId());
+            }
+        } else {
+            deleteDetails(templateId);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/765832a5/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
index 38eb2f2..66bff16 100644
--- a/engine/schema/src/com/cloud/vm/dao/NicDetailDao.java
+++ b/engine/schema/src/com/cloud/vm/dao/NicDetailDao.java
@@ -31,5 +31,5 @@ public interface NicDetailDao extends GenericDao<NicDetailVO, Long>
{
 
     void deleteDetails(long nicId);
 
-    void removeDetails(Long id, String key);
+    void removeDetails(long nicId, String key);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/765832a5/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
index 033acca..4c1d59c 100644
--- a/engine/schema/src/com/cloud/vm/dao/NicDetailDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/NicDetailDaoImpl.java
@@ -89,8 +89,7 @@ public class NicDetailDaoImpl extends GenericDaoBase<NicDetailVO, Long>
implemen
     }
 
     @Override
-    public void removeDetails(Long nicId, String key) {
-
+    public void removeDetails(long nicId, String key) {
         if(key != null){
             NicDetailVO detail = findDetail(nicId, key);
             if(detail != null){
@@ -99,7 +98,6 @@ public class NicDetailDaoImpl extends GenericDaoBase<NicDetailVO, Long>
implemen
         }else {
             deleteDetails(nicId);
         }
-
     }
     
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/765832a5/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 02e5563..ce36c0b 100644
--- a/engine/schema/src/com/cloud/vm/dao/UserVmDetailsDao.java
+++ b/engine/schema/src/com/cloud/vm/dao/UserVmDetailsDao.java
@@ -32,8 +32,8 @@ public interface UserVmDetailsDao extends GenericDao<UserVmDetailVO,
Long> {
     UserVmDetailVO findDetail(long vmId, String name);
     
 	void deleteDetails(long vmId);
-
-    public void removeDetails(Long vmId, String key);
 	
-    void addVmDetail(Long vmId, String key, String value);
+    void addVmDetail(long vmId, String key, String value);
+    
+    void removeDetails(long vmId, String key);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/765832a5/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 6cf9baf..67b7f81 100644
--- a/engine/schema/src/com/cloud/vm/dao/UserVmDetailsDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/UserVmDetailsDaoImpl.java
@@ -106,20 +106,7 @@ public class UserVmDetailsDaoImpl extends GenericDaoBase<UserVmDetailVO,
Long> i
 	}
 
     @Override
-    public void removeDetails(Long vmId, String key) {
-        if(key != null){
-            UserVmDetailVO detail = findDetail(vmId, key);
-            if(detail != null){
-                remove(detail.getId());
-            }
-        }else {
-            deleteDetails(vmId);
-        }
-
-    }
-
-    @Override
-    public void addVmDetail(Long vmId, String key, String value) {
+    public void addVmDetail(long vmId, String key, String value) {
         UserVmDetailVO detail = findDetail(vmId, key);
         if (detail == null) {
             UserVmDetailVO newEntry = new UserVmDetailVO(vmId, key, value);
@@ -129,4 +116,16 @@ public class UserVmDetailsDaoImpl extends GenericDaoBase<UserVmDetailVO,
Long> i
             update(detail.getId(), detail);
         }
     }
+
+    @Override
+    public void removeDetails(long vmId, String key) {
+        if(key != null){
+            UserVmDetailVO detail = findDetail(vmId, key);
+            if(detail != null){
+                remove(detail.getId());
+            }
+        }else {
+            deleteDetails(vmId);
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/765832a5/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 58f2bf5..4159a80 100644
--- a/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
+++ b/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
@@ -152,16 +152,16 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements
Resource
         }
         
         // TODO - Have a better design here.
-        if(resourceType == ResourceObjectType.Volume){
+        if (resourceType == ResourceObjectType.Volume){
            _volumeDetailDao.removeDetails(id, key);
-        } else if(resourceType == ResourceObjectType.Nic){
+        } else if (resourceType == ResourceObjectType.Nic){
             _nicDetailDao.removeDetails(id, key);
-        } else if(resourceType == ResourceObjectType.UserVm){
-            _userVmDetailDao.removeDetails(id, key);
+        } else if (resourceType == ResourceObjectType.UserVm) {
+            _userVmDetailsDao.removeDetails(id, key); 
+        } else if (resourceType == ResourceObjectType.Template) {
+            _templateDetailsDao.removeDetails(id, key);
         } else if (resourceType == ResourceObjectType.Zone){
             _dcDetailsDao.removeDetails(id, key);
-        } else if (resourceType == ResourceObjectType.Network){
-            _networkDetailsDao.removeDetails(id, key);
         }
 
         return true;


Mime
View raw message