cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [3/6] git commit: updated refs/heads/ui-restyle to d97be4f
Date Wed, 02 Oct 2013 17:53:42 GMT
AddResourceDetail: enabled support for adding details for user vm (user_vm_details db table)


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

Branch: refs/heads/ui-restyle
Commit: 3e7d0efb906d594f4168f412891eeba83143860f
Parents: a5ede3a
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Mon Sep 30 22:28:22 2013 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Tue Oct 1 09:28:35 2013 -0700

----------------------------------------------------------------------
 .../metadata/ResourceMetaDataManagerImpl.java   | 40 +++++++-------------
 1 file changed, 14 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3e7d0efb/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 8586589..82a62be 100644
--- a/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
+++ b/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
@@ -16,35 +16,20 @@
 // under the License.
 package com.cloud.metadata;
 
-import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import com.cloud.server.ResourceMetaDataService;
-import com.cloud.storage.VolumeDetailVO;
-import com.cloud.storage.dao.VolumeDetailsDao;
-import com.cloud.vm.NicDetailVO;
-import com.cloud.vm.dao.NicDao;
-import com.cloud.vm.dao.NicDetailDao;
-
-import org.apache.cloudstack.api.command.user.tag.ListTagsCmd;
-import org.apache.cloudstack.context.CallContext;
-
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.api.query.dao.ResourceTagJoinDao;
-import com.cloud.api.query.vo.ResourceTagJoinVO;
-import com.cloud.domain.Domain;
 import com.cloud.event.ActionEvent;
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.exception.PermissionDeniedException;
 import com.cloud.network.dao.FirewallRulesDao;
 import com.cloud.network.dao.IPAddressDao;
 import com.cloud.network.dao.LoadBalancerDao;
@@ -54,32 +39,30 @@ import com.cloud.network.rules.dao.PortForwardingRulesDao;
 import com.cloud.network.security.dao.SecurityGroupDao;
 import com.cloud.network.vpc.dao.StaticRouteDao;
 import com.cloud.network.vpc.dao.VpcDao;
-import com.cloud.projects.Project.ListProjectResourcesCriteria;
 import com.cloud.projects.dao.ProjectDao;
+import com.cloud.server.ResourceMetaDataService;
 import com.cloud.server.ResourceTag;
 import com.cloud.server.ResourceTag.TaggedResourceType;
 import com.cloud.server.TaggedResourceService;
+import com.cloud.storage.VolumeDetailVO;
 import com.cloud.storage.dao.SnapshotDao;
 import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.storage.dao.VolumeDao;
+import com.cloud.storage.dao.VolumeDetailsDao;
 import com.cloud.tags.dao.ResourceTagDao;
-import com.cloud.user.Account;
 import com.cloud.user.AccountManager;
 import com.cloud.user.DomainManager;
-import com.cloud.utils.Pair;
-import com.cloud.utils.Ternary;
-import com.cloud.utils.component.Manager;
 import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.DB;
-import com.cloud.utils.db.DbUtil;
-import com.cloud.utils.db.Filter;
 import com.cloud.utils.db.GenericDao;
-import com.cloud.utils.db.SearchBuilder;
-import com.cloud.utils.db.SearchCriteria;
 import com.cloud.utils.db.Transaction;
-import com.cloud.utils.exception.CloudRuntimeException;
 import com.cloud.uuididentity.dao.IdentityDao;
+import com.cloud.vm.NicDetailVO;
+import com.cloud.vm.UserVmDetailVO;
+import com.cloud.vm.dao.NicDao;
+import com.cloud.vm.dao.NicDetailDao;
 import com.cloud.vm.dao.UserVmDao;
+import com.cloud.vm.dao.UserVmDetailsDao;
 import com.cloud.vm.snapshot.dao.VMSnapshotDao;
 
 
@@ -139,6 +122,8 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements
Resource
     NicDao _nicDao;
     @Inject
     TaggedResourceService _taggedResourceMgr;
+    @Inject
+    UserVmDetailsDao _userVmDetail;
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException
{
@@ -215,9 +200,12 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements
Resource
                 if(resourceType == TaggedResourceType.Volume){
                     VolumeDetailVO v = new VolumeDetailVO(id, key, value);
                     _volumeDetailDao.persist(v);
-                }else if (resourceType == TaggedResourceType.Nic){
+                } else if (resourceType == TaggedResourceType.Nic){
                     NicDetailVO n = new NicDetailVO(id, key, value);
                     _nicDetailDao.persist(n);
+                } else if (resourceType == TaggedResourceType.UserVm) {
+                    UserVmDetailVO v = new UserVmDetailVO(id, key, value);
+                    _userVmDetail.persist(v);
                 }else{
                     throw new InvalidParameterValueException("The resource type " + resourceType
+ " is not supported by the API yet");
                 }


Mime
View raw message