cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject [3/3] git commit: updated refs/heads/master to 2bb716e
Date Thu, 24 Oct 2013 00:52:32 GMT
ResourceMetaData (Resource details) fixes:

* changed name for TaggedResourceType enum to ResourceObjectType as this enum is used both by ResourceMetaData and ResourceTags code
* enhanced the enum with extra fields resourceTagsSupport (boolean) and metadataSupport identifying if the resource supports tags and/or metadata.
* cleanup unused @Inject objects from the ResourceMetaDataManager


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

Branch: refs/heads/master
Commit: 2bb716efd846deb2fe29e02e465fadb3dd85e51f
Parents: e52e7a5
Author: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Authored: Wed Oct 23 15:49:58 2013 -0700
Committer: Alena Prokharchyk <alena.prokharchyk@citrix.com>
Committed: Wed Oct 23 17:39:16 2013 -0700

----------------------------------------------------------------------
 .../cloud/server/ResourceMetaDataService.java   |   9 +-
 api/src/com/cloud/server/ResourceTag.java       |  61 ++++---
 .../com/cloud/server/TaggedResourceService.java |  30 ++--
 .../api/command/user/tag/CreateTagsCmd.java     |   4 +-
 .../api/command/user/tag/DeleteTagsCmd.java     |   4 +-
 .../user/volume/AddResourceDetailCmd.java       |   2 +-
 .../user/volume/ListResourceDetailsCmd.java     |   2 +-
 .../user/volume/RemoveResourceDetailCmd.java    |   2 +-
 .../cloud/network/dao/FirewallRulesDaoImpl.java |  10 +-
 .../com/cloud/network/dao/IPAddressDaoImpl.java |   4 +-
 .../com/cloud/network/dao/NetworkDaoImpl.java   |   4 +-
 .../security/dao/SecurityGroupDaoImpl.java      |   6 +-
 .../network/vpc/dao/StaticRouteDaoImpl.java     |   4 +-
 .../com/cloud/network/vpc/dao/VpcDaoImpl.java   |   4 +-
 .../com/cloud/projects/dao/ProjectDaoImpl.java  |   4 +-
 .../com/cloud/storage/dao/SnapshotDaoImpl.java  |   4 +-
 .../cloud/storage/dao/VMTemplateDaoImpl.java    |   8 +-
 .../com/cloud/storage/dao/VolumeDaoImpl.java    |   4 +-
 .../src/com/cloud/tags/ResourceTagVO.java       |   6 +-
 .../src/com/cloud/tags/dao/ResourceTagDao.java  |   6 +-
 .../com/cloud/tags/dao/ResourceTagsDaoImpl.java |   6 +-
 .../src/com/cloud/vm/dao/UserVmDaoImpl.java     |   4 +-
 .../src/com/cloud/vm/dao/VMInstanceDaoImpl.java |   4 +-
 server/src/com/cloud/api/ApiDBUtils.java        |   8 +-
 server/src/com/cloud/api/ApiResponseHelper.java |  22 +--
 .../com/cloud/api/query/QueryManagerImpl.java   |  24 +--
 .../api/query/dao/DataCenterJoinDaoImpl.java    |   4 +-
 .../cloud/api/query/dao/ResourceTagJoinDao.java |   4 +-
 .../api/query/dao/ResourceTagJoinDaoImpl.java   |   4 +-
 .../query/dao/ServiceOfferingJoinDaoImpl.java   |  10 --
 .../com/cloud/api/query/vo/ProjectJoinVO.java   |   6 +-
 .../cloud/api/query/vo/ResourceTagJoinVO.java   |   6 +-
 .../cloud/api/query/vo/SecurityGroupJoinVO.java |   6 +-
 .../com/cloud/api/query/vo/TemplateJoinVO.java  |   6 +-
 .../com/cloud/api/query/vo/UserVmJoinVO.java    |   6 +-
 .../com/cloud/api/query/vo/VolumeJoinVO.java    |   6 +-
 .../metadata/ResourceMetaDataManagerImpl.java   | 173 ++++---------------
 .../com/cloud/network/NetworkServiceImpl.java   |   4 +-
 .../network/firewall/FirewallManagerImpl.java   |   4 +-
 .../lb/LoadBalancingRulesManagerImpl.java       |   4 +-
 .../cloud/network/rules/RulesManagerImpl.java   |   4 +-
 .../network/vpc/NetworkACLServiceImpl.java      |   4 +-
 .../com/cloud/network/vpc/VpcManagerImpl.java   |   6 +-
 .../com/cloud/server/ManagementServerImpl.java  |   4 +-
 .../storage/snapshot/SnapshotManagerImpl.java   |   4 +-
 .../cloud/tags/TaggedResourceManagerImpl.java   |  82 ++++-----
 .../com/cloud/uuididentity/dao/IdentityDao.java |   4 +-
 .../cloud/uuididentity/dao/IdentityDaoImpl.java |   6 +-
 .../lb/ApplicationLoadBalancerManagerImpl.java  |   4 +-
 .../metadata/ResourceMetaDataManagerTest.java   |  31 +---
 50 files changed, 261 insertions(+), 377 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/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 556f974..1a12b6a 100644
--- a/api/src/com/cloud/server/ResourceMetaDataService.java
+++ b/api/src/com/cloud/server/ResourceMetaDataService.java
@@ -16,22 +16,19 @@
 // under the License.package com.cloud.server;
 
 package com.cloud.server;
-import java.util.List;
 import java.util.Map;
 
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 
 public interface ResourceMetaDataService {
 
-    TaggedResourceType getResourceType (String resourceTypeStr);
-
     /**
      * @param resourceId TODO
      * @param resourceType
      * @param details
      * @return
      */
-    boolean addResourceMetaData(String resourceId, TaggedResourceType resourceType, Map<String, String> details);
+    boolean addResourceMetaData(String resourceId, ResourceObjectType resourceType, Map<String, String> details);
 
 
     /**
@@ -41,7 +38,7 @@ public interface ResourceMetaDataService {
      * @param key
      * @return
      */
-    public boolean deleteResourceMetaData(String resourceId, TaggedResourceType resourceType, String key);
+    public boolean deleteResourceMetaData(String resourceId, ResourceObjectType resourceType, String key);
 
 
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/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 9e166ab..f2bcd18 100644
--- a/api/src/com/cloud/server/ResourceTag.java
+++ b/api/src/com/cloud/server/ResourceTag.java
@@ -22,27 +22,44 @@ import org.apache.cloudstack.api.InternalIdentity;
 
 public interface ResourceTag extends ControlledEntity, Identity, InternalIdentity {
 
-    public enum  TaggedResourceType {
-        UserVm,
-        Template,
-        ISO,
-        Volume,
-        Snapshot,
-        Network,
-        Nic,
-        LoadBalancer,
-        PortForwardingRule,
-        FirewallRule,
-        SecurityGroup,
-        PublicIpAddress,
-        Project,
-        Vpc,
-        NetworkACL,
-        StaticRoute,
-        VMSnapshot,
-        RemoteAccessVpn,
-        Zone,
-        ServiceOffering
+    //FIXME - extract enum to another interface as its used both by resourceTags and resourceMetaData code
+    public enum  ResourceObjectType {
+        UserVm (true, true),
+        Template (true, true),
+        ISO (true, false),
+        Volume (true, true),
+        Snapshot (true, false),
+        Network (true, true),
+        Nic (false, true),
+        LoadBalancer (true, false),
+        PortForwardingRule (true, false),
+        FirewallRule (true, false),
+        SecurityGroup (true, false),
+        PublicIpAddress (true, false),
+        Project (true, false),
+        Vpc (true, false),
+        NetworkACL (true, false),
+        StaticRoute (true, false),
+        VMSnapshot (true, false),
+        RemoteAccessVpn (true, false),
+        Zone (false, true),
+        ServiceOffering (false, true);
+        
+        ResourceObjectType(boolean resourceTagsSupport, boolean resourceMetadataSupport) {
+            this.resourceTagsSupport = resourceTagsSupport;
+            this.metadataSupport = resourceMetadataSupport;
+        }
+        
+        private final boolean resourceTagsSupport;
+        private final boolean metadataSupport;
+        
+        public boolean resourceTagsSupport() {
+            return this.resourceTagsSupport;
+        }
+        
+        public boolean resourceMetadataSupport() {
+            return this.metadataSupport;
+        }
     }
 
     /**
@@ -63,7 +80,7 @@ public interface ResourceTag extends ControlledEntity, Identity, InternalIdentit
     /**
      * @return
      */
-    TaggedResourceType getResourceType();
+    ResourceObjectType getResourceType();
 
     /**
      * @return

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/api/src/com/cloud/server/TaggedResourceService.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/server/TaggedResourceService.java b/api/src/com/cloud/server/TaggedResourceService.java
index 46b1854..97046ac 100644
--- a/api/src/com/cloud/server/TaggedResourceService.java
+++ b/api/src/com/cloud/server/TaggedResourceService.java
@@ -19,12 +19,10 @@ package com.cloud.server;
 import java.util.List;
 import java.util.Map;
 
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 
 public interface TaggedResourceService {
 
-    TaggedResourceType getResourceType (String resourceTypeStr);
-
     /**
      * @param resourceIds TODO
      * @param resourceType
@@ -32,14 +30,7 @@ public interface TaggedResourceService {
      * @param customer TODO
      * @return
      */
-    List<ResourceTag> createTags(List<String> resourceIds, TaggedResourceType resourceType, Map<String, String> tags, String customer);
-
-    /**
-     * @param resourceId
-     * @param resourceType
-     * @return
-     */
-    String getUuid(String resourceId, TaggedResourceType resourceType);
+    List<ResourceTag> createTags(List<String> resourceIds, ResourceObjectType resourceType, Map<String, String> tags, String customer);
 
 
     /**
@@ -48,10 +39,19 @@ public interface TaggedResourceService {
      * @param tags
      * @return
      */
-    boolean deleteTags(List<String> resourceIds, TaggedResourceType resourceType, Map<String, String> tags);
+    boolean deleteTags(List<String> resourceIds, ResourceObjectType resourceType, Map<String, String> tags);
 
-    List<? extends ResourceTag> listByResourceTypeAndId(TaggedResourceType type, long resourceId);
+    List<? extends ResourceTag> listByResourceTypeAndId(ResourceObjectType type, long resourceId);
 
-    public Long getResourceId(String resourceId, TaggedResourceType resourceType);
+    //FIXME - the methods below should be extracted to its separate manager/service responsible just for retrieving object details
+    ResourceObjectType getResourceType (String resourceTypeStr);
 
-    }
+    /**
+     * @param resourceId
+     * @param resourceType
+     * @return
+     */
+    String getUuid(String resourceId, ResourceObjectType resourceType);
+    
+    public long getResourceId(String resourceId, ResourceObjectType resourceType);
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java b/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java
index a01bac3..84226d7 100644
--- a/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java
@@ -34,7 +34,7 @@ import org.apache.log4j.Logger;
 
 import com.cloud.event.EventTypes;
 import com.cloud.server.ResourceTag;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 @APICommand(name = "createTags", description = "Creates resource tag(s)", responseObject = SuccessResponse.class, since = "4.0.0")
 public class CreateTagsCmd extends BaseAsyncCmd{
     public static final Logger s_logger = Logger.getLogger(CreateTagsCmd.class.getName());
@@ -64,7 +64,7 @@ public class CreateTagsCmd extends BaseAsyncCmd{
     /////////////////////////////////////////////////////
 
 
-    public TaggedResourceType getResourceType(){
+    public ResourceObjectType getResourceType(){
         return _taggedResourceService.getResourceType(resourceType);
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java b/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java
index a6ba0da..5ce2e37 100644
--- a/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java
@@ -33,7 +33,7 @@ import org.apache.cloudstack.api.response.SuccessResponse;
 import org.apache.log4j.Logger;
 
 import com.cloud.event.EventTypes;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 @APICommand(name = "deleteTags", description = "Deleting resource tag(s)", responseObject = SuccessResponse.class, since = "4.0.0")
 public class DeleteTagsCmd extends BaseAsyncCmd{
     public static final Logger s_logger = Logger.getLogger(DeleteTagsCmd.class.getName());
@@ -59,7 +59,7 @@ public class DeleteTagsCmd extends BaseAsyncCmd{
     /////////////////////////////////////////////////////
 
 
-    public TaggedResourceType getResourceType(){
+    public ResourceObjectType getResourceType(){
         return _taggedResourceService.getResourceType(resourceType);
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/api/src/org/apache/cloudstack/api/command/user/volume/AddResourceDetailCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/AddResourceDetailCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/AddResourceDetailCmd.java
index a3b9247..1384b58 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/AddResourceDetailCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/AddResourceDetailCmd.java
@@ -71,7 +71,7 @@ public class AddResourceDetailCmd extends BaseAsyncCmd {
         return detailsMap;
     }
 
-    public ResourceTag.TaggedResourceType getResourceType() {
+    public ResourceTag.ResourceObjectType getResourceType() {
         return _taggedResourceService.getResourceType(resourceType);
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/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 c02d4b4..4c2856b 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
@@ -55,7 +55,7 @@ public class ListResourceDetailsCmd extends BaseListProjectAndAccountResourcesCm
         this.setResponseObject(response);
     }
 
-    public ResourceTag.TaggedResourceType getResourceType() {
+    public ResourceTag.ResourceObjectType getResourceType() {
         return _taggedResourceService.getResourceType(resourceType);
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/api/src/org/apache/cloudstack/api/command/user/volume/RemoveResourceDetailCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/RemoveResourceDetailCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/RemoveResourceDetailCmd.java
index fefa926..5f2e131 100644
--- a/api/src/org/apache/cloudstack/api/command/user/volume/RemoveResourceDetailCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/volume/RemoveResourceDetailCmd.java
@@ -51,7 +51,7 @@ public class RemoveResourceDetailCmd extends BaseAsyncCmd {
     /////////////////////////////////////////////////////
 
 
-    public ResourceTag.TaggedResourceType getResourceType(){
+    public ResourceTag.ResourceObjectType getResourceType(){
         return _taggedResourceService.getResourceType(resourceType);
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/engine/schema/src/com/cloud/network/dao/FirewallRulesDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/FirewallRulesDaoImpl.java b/engine/schema/src/com/cloud/network/dao/FirewallRulesDaoImpl.java
index 6aa8910..daac54a 100644
--- a/engine/schema/src/com/cloud/network/dao/FirewallRulesDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/FirewallRulesDaoImpl.java
@@ -29,7 +29,7 @@ import com.cloud.network.rules.FirewallRule.Purpose;
 import com.cloud.network.rules.FirewallRule.State;
 import com.cloud.network.rules.FirewallRule.TrafficType;
 import com.cloud.network.rules.FirewallRuleVO;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.tags.dao.ResourceTagDao;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.GenericDaoBase;
@@ -314,13 +314,13 @@ public class FirewallRulesDaoImpl extends GenericDaoBase<FirewallRuleVO, Long> i
         FirewallRuleVO entry = findById(id);
         if (entry != null) {
             if (entry.getPurpose() == Purpose.LoadBalancing) {
-                _tagsDao.removeByIdAndType(id, TaggedResourceType.LoadBalancer);
+                _tagsDao.removeByIdAndType(id, ResourceObjectType.LoadBalancer);
             } else if (entry.getPurpose() == Purpose.PortForwarding) {
-                _tagsDao.removeByIdAndType(id, TaggedResourceType.PortForwardingRule);
+                _tagsDao.removeByIdAndType(id, ResourceObjectType.PortForwardingRule);
             } else if (entry.getPurpose() == Purpose.Firewall) {
-                _tagsDao.removeByIdAndType(id, TaggedResourceType.FirewallRule);
+                _tagsDao.removeByIdAndType(id, ResourceObjectType.FirewallRule);
             } else if (entry.getPurpose() == Purpose.NetworkACL) {
-                _tagsDao.removeByIdAndType(id, TaggedResourceType.NetworkACL);
+                _tagsDao.removeByIdAndType(id, ResourceObjectType.NetworkACL);
             }
         }
         boolean result = super.remove(id);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java b/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java
index 46a34c5..08bff89 100755
--- a/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java
@@ -21,7 +21,7 @@ import com.cloud.dc.Vlan.VlanType;
 import com.cloud.dc.VlanVO;
 import com.cloud.dc.dao.VlanDao;
 import com.cloud.network.IpAddress.State;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.tags.dao.ResourceTagDao;
 import com.cloud.utils.db.DB;
 import com.cloud.utils.db.GenericDaoBase;
@@ -394,7 +394,7 @@ public class IPAddressDaoImpl extends GenericDaoBase<IPAddressVO, Long> implemen
         txn.start();
         IPAddressVO entry = findById(id);
         if (entry != null) {
-            _tagsDao.removeByIdAndType(id, TaggedResourceType.SecurityGroup);
+            _tagsDao.removeByIdAndType(id, ResourceObjectType.SecurityGroup);
         }
         boolean result = super.remove(id);
         txn.commit();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/engine/schema/src/com/cloud/network/dao/NetworkDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/NetworkDaoImpl.java b/engine/schema/src/com/cloud/network/dao/NetworkDaoImpl.java
index 6599d6b..90ba4a3 100644
--- a/engine/schema/src/com/cloud/network/dao/NetworkDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/NetworkDaoImpl.java
@@ -40,7 +40,7 @@ import com.cloud.network.Networks.TrafficType;
 import com.cloud.offering.NetworkOffering;
 import com.cloud.offerings.NetworkOfferingVO;
 import com.cloud.offerings.dao.NetworkOfferingDao;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.tags.dao.ResourceTagDao;
 import com.cloud.utils.db.*;
 import com.cloud.utils.db.JoinBuilder.JoinType;
@@ -580,7 +580,7 @@ public class NetworkDaoImpl extends GenericDaoBase<NetworkVO, Long> implements N
         txn.start();
         NetworkVO entry = findById(id);
         if (entry != null) {
-            _tagsDao.removeByIdAndType(id, TaggedResourceType.Network);
+            _tagsDao.removeByIdAndType(id, ResourceObjectType.Network);
         }
         boolean result = super.remove(id);
         txn.commit();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/engine/schema/src/com/cloud/network/security/dao/SecurityGroupDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/security/dao/SecurityGroupDaoImpl.java b/engine/schema/src/com/cloud/network/security/dao/SecurityGroupDaoImpl.java
index ee8c160..31131b8 100644
--- a/engine/schema/src/com/cloud/network/security/dao/SecurityGroupDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/security/dao/SecurityGroupDaoImpl.java
@@ -24,7 +24,7 @@ import javax.inject.Inject;
 import org.springframework.stereotype.Component;
 
 import com.cloud.network.security.SecurityGroupVO;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.tags.dao.ResourceTagDao;
 import com.cloud.tags.dao.ResourceTagsDaoImpl;
 
@@ -113,7 +113,7 @@ public class SecurityGroupDaoImpl extends GenericDaoBase<SecurityGroupVO, Long>
         txn.start();
         SecurityGroupVO entry = findById(id);
         if (entry != null) {
-            _tagsDao.removeByIdAndType(id, TaggedResourceType.SecurityGroup);
+            _tagsDao.removeByIdAndType(id, ResourceObjectType.SecurityGroup);
         }
         boolean result = super.remove(id);
         txn.commit();
@@ -127,7 +127,7 @@ public class SecurityGroupDaoImpl extends GenericDaoBase<SecurityGroupVO, Long>
         txn.start();
         SecurityGroupVO entry = findById(id);
         if (entry != null) {
-            _tagsDao.removeByIdAndType(id, TaggedResourceType.SecurityGroup);
+            _tagsDao.removeByIdAndType(id, ResourceObjectType.SecurityGroup);
         }
         boolean result = super.expunge(id);
         txn.commit();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/engine/schema/src/com/cloud/network/vpc/dao/StaticRouteDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/vpc/dao/StaticRouteDaoImpl.java b/engine/schema/src/com/cloud/network/vpc/dao/StaticRouteDaoImpl.java
index f5a9ed5..a85b907 100644
--- a/engine/schema/src/com/cloud/network/vpc/dao/StaticRouteDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/vpc/dao/StaticRouteDaoImpl.java
@@ -25,7 +25,7 @@ import org.springframework.stereotype.Component;
 
 import com.cloud.network.vpc.StaticRoute;
 import com.cloud.network.vpc.StaticRouteVO;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.tags.dao.ResourceTagDao;
 import com.cloud.tags.dao.ResourceTagsDaoImpl;
 
@@ -110,7 +110,7 @@ public class StaticRouteDaoImpl extends GenericDaoBase<StaticRouteVO, Long> impl
         txn.start();
         StaticRouteVO entry = findById(id);
         if (entry != null) {
-            _tagsDao.removeByIdAndType(id, TaggedResourceType.StaticRoute);
+            _tagsDao.removeByIdAndType(id, ResourceObjectType.StaticRoute);
         }
         boolean result = super.remove(id);
         txn.commit();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/engine/schema/src/com/cloud/network/vpc/dao/VpcDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/vpc/dao/VpcDaoImpl.java b/engine/schema/src/com/cloud/network/vpc/dao/VpcDaoImpl.java
index c34b551..ba030e9 100644
--- a/engine/schema/src/com/cloud/network/vpc/dao/VpcDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/vpc/dao/VpcDaoImpl.java
@@ -28,7 +28,7 @@ import org.springframework.stereotype.Component;
 
 import com.cloud.network.vpc.Vpc;
 import com.cloud.network.vpc.VpcVO;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.tags.dao.ResourceTagDao;
 
 import com.cloud.utils.db.DB;
@@ -111,7 +111,7 @@ public class VpcDaoImpl extends GenericDaoBase<VpcVO, Long> implements VpcDao{
         txn.start();
         VpcVO entry = findById(id);
         if (entry != null) {
-            _tagsDao.removeByIdAndType(id, TaggedResourceType.Vpc);
+            _tagsDao.removeByIdAndType(id, ResourceObjectType.Vpc);
         }
         boolean result = super.remove(id);
         txn.commit();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/engine/schema/src/com/cloud/projects/dao/ProjectDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/projects/dao/ProjectDaoImpl.java b/engine/schema/src/com/cloud/projects/dao/ProjectDaoImpl.java
index fd6c802..63a21c4 100644
--- a/engine/schema/src/com/cloud/projects/dao/ProjectDaoImpl.java
+++ b/engine/schema/src/com/cloud/projects/dao/ProjectDaoImpl.java
@@ -26,7 +26,7 @@ import org.springframework.stereotype.Component;
 
 import com.cloud.projects.Project;
 import com.cloud.projects.ProjectVO;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.tags.dao.ResourceTagDao;
 import com.cloud.tags.dao.ResourceTagsDaoImpl;
 
@@ -84,7 +84,7 @@ public class ProjectDaoImpl extends GenericDaoBase<ProjectVO, Long> implements P
             return false;
         } 
         
-        _tagsDao.removeByIdAndType(projectId, TaggedResourceType.Project);
+        _tagsDao.removeByIdAndType(projectId, ResourceObjectType.Project);
         result = super.remove(projectId);
         txn.commit();
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/engine/schema/src/com/cloud/storage/dao/SnapshotDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/dao/SnapshotDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/SnapshotDaoImpl.java
index 94b3871..c56a3cf 100644
--- a/engine/schema/src/com/cloud/storage/dao/SnapshotDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/SnapshotDaoImpl.java
@@ -27,7 +27,7 @@ import javax.inject.Inject;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.storage.DataStoreRole;
 import com.cloud.storage.Snapshot;
 import com.cloud.storage.Snapshot.Event;
@@ -308,7 +308,7 @@ public class SnapshotDaoImpl extends GenericDaoBase<SnapshotVO, Long> implements
         txn.start();
         SnapshotVO entry = findById(id);
         if (entry != null) {
-            _tagsDao.removeByIdAndType(id, TaggedResourceType.Snapshot);
+            _tagsDao.removeByIdAndType(id, ResourceObjectType.Snapshot);
         }
         boolean result = super.remove(id);
         txn.commit();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/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 03a6cbc..71ec6c7 100755
--- a/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VMTemplateDaoImpl.java
@@ -40,7 +40,7 @@ import com.cloud.host.Host;
 import com.cloud.host.HostVO;
 import com.cloud.host.dao.HostDao;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.storage.Storage;
 import com.cloud.storage.Storage.ImageFormat;
 import com.cloud.storage.Storage.TemplateType;
@@ -175,7 +175,7 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
 
         if (tags != null && !tags.isEmpty()) {
             int count = 0;
-            sc.setJoinParameters("tagSearch", "resourceType", TaggedResourceType.ISO.toString());
+            sc.setJoinParameters("tagSearch", "resourceType", ResourceObjectType.ISO.toString());
             for (String key : tags.keySet()) {
                 sc.setJoinParameters("tagSearch", "key" + String.valueOf(count), key);
                 sc.setJoinParameters("tagSearch", "value" + String.valueOf(count), tags.get(key));
@@ -880,9 +880,9 @@ public class VMTemplateDaoImpl extends GenericDaoBase<VMTemplateVO, Long> implem
         VMTemplateVO vo = findById(id);
         if (vo != null) {
             if (vo.getFormat() == ImageFormat.ISO) {
-                _tagsDao.removeByIdAndType(id, TaggedResourceType.ISO);
+                _tagsDao.removeByIdAndType(id, ResourceObjectType.ISO);
             } else {
-                _tagsDao.removeByIdAndType(id, TaggedResourceType.Template);
+                _tagsDao.removeByIdAndType(id, ResourceObjectType.Template);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java b/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java
index 59e61e9..54b6465 100755
--- a/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java
+++ b/engine/schema/src/com/cloud/storage/dao/VolumeDaoImpl.java
@@ -31,7 +31,7 @@ import org.springframework.stereotype.Component;
 
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.storage.ScopeType;
 import com.cloud.storage.Storage.ImageFormat;
 import com.cloud.storage.Volume;
@@ -523,7 +523,7 @@ public class VolumeDaoImpl extends GenericDaoBase<VolumeVO, Long> implements Vol
         txn.start();
         VolumeVO entry = findById(id);
         if (entry != null) {
-            _tagsDao.removeByIdAndType(id, TaggedResourceType.Volume);
+            _tagsDao.removeByIdAndType(id, ResourceObjectType.Volume);
         }
         boolean result = super.remove(id);
         txn.commit();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/engine/schema/src/com/cloud/tags/ResourceTagVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/tags/ResourceTagVO.java b/engine/schema/src/com/cloud/tags/ResourceTagVO.java
index 04ae757..6130390 100644
--- a/engine/schema/src/com/cloud/tags/ResourceTagVO.java
+++ b/engine/schema/src/com/cloud/tags/ResourceTagVO.java
@@ -64,7 +64,7 @@ public class ResourceTagVO implements ResourceTag {
     
     @Column(name="resource_type")
     @Enumerated(value=EnumType.STRING)
-    private TaggedResourceType resourceType;
+    private ResourceObjectType resourceType;
     
     @Column(name="customer")
     String customer;
@@ -85,7 +85,7 @@ public class ResourceTagVO implements ResourceTag {
      * @param resourceUuid TODO
      */
     public ResourceTagVO(String key, String value, long accountId, long domainId, long resourceId, 
-            TaggedResourceType resourceType, String customer, String resourceUuid) {
+            ResourceObjectType resourceType, String customer, String resourceUuid) {
         super();
         this.key = key;
         this.value = value;
@@ -139,7 +139,7 @@ public class ResourceTagVO implements ResourceTag {
     }
 
     @Override
-    public TaggedResourceType getResourceType() {
+    public ResourceObjectType getResourceType() {
         return resourceType;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/engine/schema/src/com/cloud/tags/dao/ResourceTagDao.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/tags/dao/ResourceTagDao.java b/engine/schema/src/com/cloud/tags/dao/ResourceTagDao.java
index 335c748..395cf1b 100644
--- a/engine/schema/src/com/cloud/tags/dao/ResourceTagDao.java
+++ b/engine/schema/src/com/cloud/tags/dao/ResourceTagDao.java
@@ -19,7 +19,7 @@ package com.cloud.tags.dao;
 import java.util.List;
 
 import com.cloud.server.ResourceTag;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.tags.ResourceTagVO;
 import com.cloud.utils.db.GenericDao;
 
@@ -30,8 +30,8 @@ public interface ResourceTagDao extends GenericDao<ResourceTagVO, Long>{
      * @param resourceType
      * @return
      */
-    boolean removeByIdAndType(long resourceId, TaggedResourceType resourceType);
+    boolean removeByIdAndType(long resourceId, ResourceObjectType resourceType);
     
-    List<? extends ResourceTag> listBy(long resourceId, TaggedResourceType resourceType);
+    List<? extends ResourceTag> listBy(long resourceId, ResourceObjectType resourceType);
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/engine/schema/src/com/cloud/tags/dao/ResourceTagsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/tags/dao/ResourceTagsDaoImpl.java b/engine/schema/src/com/cloud/tags/dao/ResourceTagsDaoImpl.java
index a8e1393..2243fab 100644
--- a/engine/schema/src/com/cloud/tags/dao/ResourceTagsDaoImpl.java
+++ b/engine/schema/src/com/cloud/tags/dao/ResourceTagsDaoImpl.java
@@ -23,7 +23,7 @@ import javax.ejb.Local;
 import org.springframework.stereotype.Component;
 
 import com.cloud.server.ResourceTag;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.tags.ResourceTagVO;
 import com.cloud.utils.db.GenericDaoBase;
 import com.cloud.utils.db.SearchBuilder;
@@ -44,7 +44,7 @@ public class ResourceTagsDaoImpl extends GenericDaoBase<ResourceTagVO, Long> imp
     }
     
     @Override
-    public boolean removeByIdAndType(long resourceId, ResourceTag.TaggedResourceType resourceType) {
+    public boolean removeByIdAndType(long resourceId, ResourceTag.ResourceObjectType resourceType) {
         SearchCriteria<ResourceTagVO> sc = AllFieldsSearch.create();
         sc.setParameters("resourceId", resourceId);
         sc.setParameters("resourceType", resourceType);
@@ -53,7 +53,7 @@ public class ResourceTagsDaoImpl extends GenericDaoBase<ResourceTagVO, Long> imp
     }
 
     @Override
-    public List<? extends ResourceTag> listBy(long resourceId, TaggedResourceType resourceType) {
+    public List<? extends ResourceTag> listBy(long resourceId, ResourceObjectType resourceType) {
         SearchCriteria<ResourceTagVO> sc = AllFieldsSearch.create();
         sc.setParameters("resourceId", resourceId);
         sc.setParameters("resourceType", resourceType);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/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 9cef0ae..70b04e3 100755
--- a/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java
@@ -34,7 +34,7 @@ import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.configuration.Resource;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.tags.dao.ResourceTagDao;
 import com.cloud.tags.dao.ResourceTagsDaoImpl;
 import com.cloud.user.Account;
@@ -577,7 +577,7 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use
     public boolean remove(Long id) {
         TransactionLegacy txn = TransactionLegacy.currentTxn();
         txn.start();
-        _tagsDao.removeByIdAndType(id, TaggedResourceType.UserVm);
+        _tagsDao.removeByIdAndType(id, ResourceObjectType.UserVm);
         boolean result = super.remove(id);
         txn.commit();
         return result;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
index 301944b..2c62376 100644
--- a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
+++ b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java
@@ -35,7 +35,7 @@ import org.springframework.stereotype.Component;
 
 import com.cloud.host.HostVO;
 import com.cloud.host.dao.HostDao;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.tags.dao.ResourceTagDao;
 import com.cloud.utils.Pair;
 import com.cloud.utils.db.Attribute;
@@ -658,7 +658,7 @@ public class VMInstanceDaoImpl extends GenericDaoBase<VMInstanceVO, Long> implem
         txn.start();
         VMInstanceVO vm = findById(id);
         if (vm != null && vm.getType() == Type.User) {
-            _tagsDao.removeByIdAndType(id, TaggedResourceType.UserVm);
+            _tagsDao.removeByIdAndType(id, ResourceObjectType.UserVm);
         }
         boolean result = super.remove(id);
         txn.commit();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/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 fa397ed..1eba98f 100755
--- a/server/src/com/cloud/api/ApiDBUtils.java
+++ b/server/src/com/cloud/api/ApiDBUtils.java
@@ -217,7 +217,7 @@ import com.cloud.resource.ResourceManager;
 import com.cloud.server.Criteria;
 import com.cloud.server.ManagementServer;
 import com.cloud.server.ResourceTag;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.server.StatsCollector;
 import com.cloud.server.TaggedResourceService;
 import com.cloud.service.ServiceOfferingVO;
@@ -1154,11 +1154,11 @@ public class ApiDBUtils {
         return vmSnapshot;
     }
 
-    public static String getUuid(String resourceId, TaggedResourceType resourceType) {
+    public static String getUuid(String resourceId, ResourceObjectType resourceType) {
         return _taggedResourceService.getUuid(resourceId, resourceType);
     }
 
-    public static List<? extends ResourceTag> listByResourceTypeAndId(TaggedResourceType type, long resourceId) {
+    public static List<? extends ResourceTag> listByResourceTypeAndId(ResourceObjectType type, long resourceId) {
         return _taggedResourceService.listByResourceTypeAndId(type, resourceId);
     }
     public static List<ConditionVO> getAutoScalePolicyConditions(long policyId)
@@ -1689,7 +1689,7 @@ public class ApiDBUtils {
         return _accountService.isAdmin(account.getType());
     }
     
-    public static List<ResourceTagJoinVO> listResourceTagViewByResourceUUID(String resourceUUID, TaggedResourceType resourceType){
+    public static List<ResourceTagJoinVO> listResourceTagViewByResourceUUID(String resourceUUID, ResourceObjectType resourceType){
         return  _tagJoinDao.listBy(resourceUUID, resourceType);
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index 77be43f..155a563 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -256,7 +256,7 @@ import com.cloud.projects.ProjectInvitation;
 import com.cloud.region.ha.GlobalLoadBalancerRule;
 import com.cloud.server.Criteria;
 import com.cloud.server.ResourceTag;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.service.ServiceOfferingVO;
 import com.cloud.storage.DataStoreRole;
 import com.cloud.storage.DiskOfferingVO;
@@ -466,7 +466,7 @@ public class ApiResponseHelper implements ResponseGenerator {
         snapshotResponse.setRevertable(snapshotInfo.isRevertable());
 
         // set tag information
-        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(TaggedResourceType.Snapshot, snapshot.getId());
+        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(ResourceObjectType.Snapshot, snapshot.getId());
         List<ResourceTagResponse> tagResponses = new ArrayList<ResourceTagResponse>();
         for (ResourceTag tag : tags) {
             ResourceTagResponse tagResponse = createResourceTagResponse(tag, true);
@@ -719,7 +719,7 @@ public class ApiResponseHelper implements ResponseGenerator {
         ipResponse.setPortable(ipAddr.isPortable());
 
         //set tag information
-        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(TaggedResourceType.PublicIpAddress, ipAddr.getId());
+        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(ResourceObjectType.PublicIpAddress, ipAddr.getId());
         List<ResourceTagResponse> tagResponses = new ArrayList<ResourceTagResponse>();
         for (ResourceTag tag : tags) {
             ResourceTagResponse tagResponse = createResourceTagResponse(tag, true);
@@ -759,7 +759,7 @@ public class ApiResponseHelper implements ResponseGenerator {
         }
 
         //set tag information
-        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(TaggedResourceType.LoadBalancer, loadBalancer.getId());
+        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(ResourceObjectType.LoadBalancer, loadBalancer.getId());
         List<ResourceTagResponse> tagResponses = new ArrayList<ResourceTagResponse>();
         for (ResourceTag tag : tags) {
             ResourceTagResponse tagResponse = createResourceTagResponse(tag, true);
@@ -1047,7 +1047,7 @@ public class ApiResponseHelper implements ResponseGenerator {
         }
 
         // set tag information
-        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(TaggedResourceType.PortForwardingRule, fwRule.getId());
+        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(ResourceObjectType.PortForwardingRule, fwRule.getId());
         List<ResourceTagResponse> tagResponses = new ArrayList<ResourceTagResponse>();
         for (ResourceTag tag : tags) {
             ResourceTagResponse tagResponse = createResourceTagResponse(tag, true);
@@ -2308,7 +2308,7 @@ public class ApiResponseHelper implements ResponseGenerator {
         response.setCanUseForDeploy(ApiDBUtils.canUseForDeploy(network));
 
         // set tag information
-        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(TaggedResourceType.Network, network.getId());
+        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(ResourceObjectType.Network, network.getId());
         List<ResourceTagResponse> tagResponses = new ArrayList<ResourceTagResponse>();
         for (ResourceTag tag : tags) {
             ResourceTagResponse tagResponse = createResourceTagResponse(tag, true);
@@ -2382,7 +2382,7 @@ public class ApiResponseHelper implements ResponseGenerator {
         response.setIcmpType(fwRule.getIcmpType());
 
         // set tag information
-        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(TaggedResourceType.FirewallRule, fwRule.getId());
+        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(ResourceObjectType.FirewallRule, fwRule.getId());
         List<ResourceTagResponse> tagResponses = new ArrayList<ResourceTagResponse>();
         for (ResourceTag tag : tags) {
             ResourceTagResponse tagResponse = createResourceTagResponse(tag, true);
@@ -2432,7 +2432,7 @@ public class ApiResponseHelper implements ResponseGenerator {
         }
 
         //set tag information
-        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(TaggedResourceType.NetworkACL, aclItem.getId());
+        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(ResourceObjectType.NetworkACL, aclItem.getId());
         List<ResourceTagResponse> tagResponses = new ArrayList<ResourceTagResponse>();
         for (ResourceTag tag : tags) {
             ResourceTagResponse tagResponse = createResourceTagResponse(tag, true);
@@ -2945,7 +2945,7 @@ public class ApiResponseHelper implements ResponseGenerator {
         populateOwner(response, vpc);
 
         // set tag information
-        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(TaggedResourceType.Vpc, vpc.getId());
+        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(ResourceObjectType.Vpc, vpc.getId());
         List<ResourceTagResponse> tagResponses = new ArrayList<ResourceTagResponse>();
         for (ResourceTag tag : tags) {
             ResourceTagResponse tagResponse = createResourceTagResponse(tag, true);
@@ -3136,7 +3136,7 @@ public class ApiResponseHelper implements ResponseGenerator {
         populateDomain(response, result.getDomainId());
 
         // set tag information
-        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(TaggedResourceType.StaticRoute, result.getId());
+        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(ResourceObjectType.StaticRoute, result.getId());
         List<ResourceTagResponse> tagResponses = new ArrayList<ResourceTagResponse>();
         for (ResourceTag tag : tags) {
             ResourceTagResponse tagResponse = createResourceTagResponse(tag, true);
@@ -3642,7 +3642,7 @@ public class ApiResponseHelper implements ResponseGenerator {
         lbResponse.setLbInstances(instanceResponses);
 
         //set tag information
-        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(TaggedResourceType.LoadBalancer, lb.getId());
+        List<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(ResourceObjectType.LoadBalancer, lb.getId());
         List<ResourceTagResponse> tagResponses = new ArrayList<ResourceTagResponse>();
         for (ResourceTag tag : tags) {
             ResourceTagResponse tagResponse = createResourceTagResponse(tag, true);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/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 eff5d38..79eb1b4 100644
--- a/server/src/com/cloud/api/query/QueryManagerImpl.java
+++ b/server/src/com/cloud/api/query/QueryManagerImpl.java
@@ -155,7 +155,7 @@ import com.cloud.resource.ResourceManager;
 import com.cloud.server.Criteria;
 import com.cloud.server.ResourceMetaDataService;
 import com.cloud.server.ResourceTag;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.server.TaggedResourceService;
 import com.cloud.service.ServiceOfferingVO;
 import com.cloud.service.dao.ServiceOfferingDao;
@@ -2690,7 +2690,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
         
         if (resourceTags != null && !resourceTags.isEmpty()) {
             int count = 0;
-            sc.setJoinParameters("tagSearch", "resourceType", TaggedResourceType.Zone.toString());
+            sc.setJoinParameters("tagSearch", "resourceType", ResourceObjectType.Zone.toString());
             for (String key : resourceTags.keySet()) {
                 sc.setJoinParameters("tagSearch", "key" + String.valueOf(count), key);
                 sc.setJoinParameters("tagSearch", "value" + String.valueOf(count), resourceTags.get(key));
@@ -2946,9 +2946,9 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
                     scTag.addAnd("tagKey", SearchCriteria.Op.EQ, key);
                     scTag.addAnd("tagValue", SearchCriteria.Op.EQ, tags.get(key));
                     if (isIso) {
-                        scTag.addAnd("tagResourceType", SearchCriteria.Op.EQ, TaggedResourceType.ISO);
+                        scTag.addAnd("tagResourceType", SearchCriteria.Op.EQ, ResourceObjectType.ISO);
                     } else {
-                        scTag.addAnd("tagResourceType", SearchCriteria.Op.EQ, TaggedResourceType.Template);
+                        scTag.addAnd("tagResourceType", SearchCriteria.Op.EQ, ResourceObjectType.Template);
                     }
                     scc.addOr("tagKey", SearchCriteria.Op.SC, scTag);
                     count++;
@@ -3263,39 +3263,39 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
     @Override
     public List<ResourceDetailResponse> listResource(ListResourceDetailsCmd cmd) {
         String key = cmd.getKey();
-        ResourceTag.TaggedResourceType resourceType = cmd.getResourceType();
+        ResourceTag.ResourceObjectType resourceType = cmd.getResourceType();
         String resourceId = cmd.getResourceId();
-        Long id = _taggedResourceMgr.getResourceId(resourceId, resourceType);
+        long id = _taggedResourceMgr.getResourceId(resourceId, resourceType);
         List<ResourceDetailResponse> responseList = new ArrayList<ResourceDetailResponse>();
         List<? extends ResourceDetail> detailList = new ArrayList<ResourceDetail>();
         ResourceDetail requestedDetail = null;
 
         
-        if (resourceType == ResourceTag.TaggedResourceType.Volume) {
+        if (resourceType == ResourceTag.ResourceObjectType.Volume) {
             if (key == null) {
                 detailList = _volumeDetailDao.findDetails(id);
             } else {
                 requestedDetail = _volumeDetailDao.findDetail(id, key);
             }
-        } else if (resourceType == ResourceTag.TaggedResourceType.Nic){
+        } else if (resourceType == ResourceTag.ResourceObjectType.Nic){
             if (key == null) {
                 detailList = _nicDetailDao.findDetails(id);
             } else {
                 requestedDetail = _nicDetailDao.findDetail(id, key);
             }
-        } else if (resourceType == ResourceTag.TaggedResourceType.UserVm){
+        } else if (resourceType == ResourceTag.ResourceObjectType.UserVm){
             if (key == null) {
                 detailList = _userVmDetailDao.findDetailsList(id);
             } else {
                 requestedDetail = _userVmDetailDao.findDetail(id, key);
             }
-        } else if (resourceType == ResourceTag.TaggedResourceType.Zone){
+        } else if (resourceType == ResourceTag.ResourceObjectType.Zone){
             if (key == null) {
                 detailList = _dcDetailsDao.findDetailsList(id);
             } else {
                 requestedDetail = _dcDetailsDao.findDetail(id, key);
             }
-        } else if (resourceType == TaggedResourceType.Network){
+        } else if (resourceType == ResourceObjectType.Network){
             if (key == null) {
                 detailList = _networkDetailsDao.findDetails(id);
             } else {
@@ -3321,7 +3321,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService {
     }
 
     
-    protected ResourceDetailResponse createResourceDetailsResponse(long resourceId, String key, String value, ResourceTag.TaggedResourceType type) {
+    protected ResourceDetailResponse createResourceDetailsResponse(long resourceId, String key, String value, ResourceTag.ResourceObjectType type) {
         ResourceDetailResponse resourceDetailResponse = new ResourceDetailResponse();
         resourceDetailResponse.setResourceId(String.valueOf(resourceId));
         resourceDetailResponse.setName(key);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/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 097824c..6e2649e 100644
--- a/server/src/com/cloud/api/query/dao/DataCenterJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/DataCenterJoinDaoImpl.java
@@ -31,7 +31,7 @@ import com.cloud.api.ApiResponseHelper;
 import com.cloud.api.query.vo.DataCenterJoinVO;
 import com.cloud.api.query.vo.ResourceTagJoinVO;
 import com.cloud.dc.DataCenter;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.user.Account;
 import com.cloud.utils.db.GenericDaoBase;
 import com.cloud.utils.db.SearchBuilder;
@@ -99,7 +99,7 @@ public class DataCenterJoinDaoImpl extends GenericDaoBase<DataCenterJoinVO, Long
         zoneResponse.setDhcpProvider(dataCenter.getDhcpProvider());
         
         // update tag information
-        List<ResourceTagJoinVO> resourceTags = ApiDBUtils.listResourceTagViewByResourceUUID(dataCenter.getUuid(), TaggedResourceType.Zone);
+        List<ResourceTagJoinVO> resourceTags = ApiDBUtils.listResourceTagViewByResourceUUID(dataCenter.getUuid(), ResourceObjectType.Zone);
         for (ResourceTagJoinVO resourceTag : resourceTags) {            
             ResourceTagResponse tagResponse = ApiDBUtils.newResourceTagResponse(resourceTag, false);
             zoneResponse.addTag(tagResponse);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/com/cloud/api/query/dao/ResourceTagJoinDao.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/ResourceTagJoinDao.java b/server/src/com/cloud/api/query/dao/ResourceTagJoinDao.java
index 627033c..769bc9b 100644
--- a/server/src/com/cloud/api/query/dao/ResourceTagJoinDao.java
+++ b/server/src/com/cloud/api/query/dao/ResourceTagJoinDao.java
@@ -22,7 +22,7 @@ import org.apache.cloudstack.api.response.ResourceTagResponse;
 
 import com.cloud.api.query.vo.ResourceTagJoinVO;
 import com.cloud.server.ResourceTag;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.utils.db.GenericDao;
 
 public interface ResourceTagJoinDao extends GenericDao<ResourceTagJoinVO, Long> {
@@ -33,5 +33,5 @@ public interface ResourceTagJoinDao extends GenericDao<ResourceTagJoinVO, Long>
 
     List<ResourceTagJoinVO> searchByIds(Long... ids);
     
-    List<ResourceTagJoinVO> listBy(String resourceUUID, TaggedResourceType resourceType);
+    List<ResourceTagJoinVO> listBy(String resourceUUID, ResourceObjectType resourceType);
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/com/cloud/api/query/dao/ResourceTagJoinDaoImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/dao/ResourceTagJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/ResourceTagJoinDaoImpl.java
index f0ddaa6..27a76af 100644
--- a/server/src/com/cloud/api/query/dao/ResourceTagJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/ResourceTagJoinDaoImpl.java
@@ -30,7 +30,7 @@ import org.springframework.stereotype.Component;
 import com.cloud.api.ApiResponseHelper;
 import com.cloud.api.query.vo.ResourceTagJoinVO;
 import com.cloud.server.ResourceTag;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.utils.db.GenericDaoBase;
 import com.cloud.utils.db.SearchBuilder;
 import com.cloud.utils.db.SearchCriteria;
@@ -95,7 +95,7 @@ public class ResourceTagJoinDaoImpl extends GenericDaoBase<ResourceTagJoinVO, Lo
     
     
     @Override
-    public List<ResourceTagJoinVO> listBy(String resourceUUID, TaggedResourceType resourceType) {
+    public List<ResourceTagJoinVO> listBy(String resourceUUID, ResourceObjectType resourceType) {
         SearchCriteria<ResourceTagJoinVO> sc = AllFieldsSearch.create();
         sc.setParameters("uuid", resourceUUID);
         sc.setParameters("resourceType", resourceType);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/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 52c2e27..1727034 100644
--- a/server/src/com/cloud/api/query/dao/ServiceOfferingJoinDaoImpl.java
+++ b/server/src/com/cloud/api/query/dao/ServiceOfferingJoinDaoImpl.java
@@ -20,16 +20,13 @@ import java.util.List;
 
 import javax.ejb.Local;
 
-import org.apache.cloudstack.api.response.ResourceTagResponse;
 import org.apache.cloudstack.api.response.ServiceOfferingResponse;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.api.ApiDBUtils;
-import com.cloud.api.query.vo.ResourceTagJoinVO;
 import com.cloud.api.query.vo.ServiceOfferingJoinVO;
 import com.cloud.offering.ServiceOffering;
-import com.cloud.server.ResourceTag.TaggedResourceType;
 import com.cloud.utils.db.GenericDaoBase;
 import com.cloud.utils.db.SearchBuilder;
 import com.cloud.utils.db.SearchCriteria;
@@ -84,13 +81,6 @@ public class ServiceOfferingJoinDaoImpl extends GenericDaoBase<ServiceOfferingJo
         offeringResponse.setIopsWriteRate(offering.getIopsWriteRate());
         offeringResponse.setDetails(ApiDBUtils.getServiceOfferingDetails(offering.getId()));
         offeringResponse.setObjectName("serviceoffering");
-        
-        // update tag information
-        List<ResourceTagJoinVO> resourceTags = ApiDBUtils.listResourceTagViewByResourceUUID(offering.getUuid(), TaggedResourceType.ServiceOffering);
-        for (ResourceTagJoinVO resourceTag : resourceTags) {            
-            ResourceTagResponse tagResponse = ApiDBUtils.newResourceTagResponse(resourceTag, false);
-            offeringResponse.addTag(tagResponse);
-        }
 
         return offeringResponse;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/com/cloud/api/query/vo/ProjectJoinVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/vo/ProjectJoinVO.java b/server/src/com/cloud/api/query/vo/ProjectJoinVO.java
index 77b0131..8addabe 100644
--- a/server/src/com/cloud/api/query/vo/ProjectJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/ProjectJoinVO.java
@@ -29,7 +29,7 @@ import org.apache.cloudstack.api.Identity;
 import org.apache.cloudstack.api.InternalIdentity;
 
 import com.cloud.projects.Project.State;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.utils.db.GenericDao;
 
 @Entity
@@ -103,7 +103,7 @@ public class ProjectJoinVO extends BaseViewVO implements InternalIdentity, Ident
 
     @Column(name="tag_resource_type")
     @Enumerated(value=EnumType.STRING)
-    private TaggedResourceType tagResourceType;
+    private ResourceObjectType tagResourceType;
 
     @Column(name="tag_customer")
     private String tagCustomer;
@@ -196,7 +196,7 @@ public class ProjectJoinVO extends BaseViewVO implements InternalIdentity, Ident
         return tagResourceUuid;
     }
 
-    public TaggedResourceType getTagResourceType() {
+    public ResourceObjectType getTagResourceType() {
         return tagResourceType;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/com/cloud/api/query/vo/ResourceTagJoinVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/vo/ResourceTagJoinVO.java b/server/src/com/cloud/api/query/vo/ResourceTagJoinVO.java
index a13d107..cd94ba5 100644
--- a/server/src/com/cloud/api/query/vo/ResourceTagJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/ResourceTagJoinVO.java
@@ -23,7 +23,7 @@ import javax.persistence.Enumerated;
 import javax.persistence.Id;
 import javax.persistence.Table;
 
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 
 @Entity
 @Table(name="resource_tag_view")
@@ -50,7 +50,7 @@ public class ResourceTagJoinVO extends BaseViewVO implements ControlledViewEntit
 
     @Column(name="resource_type")
     @Enumerated(value=EnumType.STRING)
-    private TaggedResourceType resourceType;
+    private ResourceObjectType resourceType;
 
     @Column(name="customer")
     String customer;
@@ -171,7 +171,7 @@ public class ResourceTagJoinVO extends BaseViewVO implements ControlledViewEntit
         return resourceUuid;
     }
 
-    public TaggedResourceType getResourceType() {
+    public ResourceObjectType getResourceType() {
         return resourceType;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/com/cloud/api/query/vo/SecurityGroupJoinVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/vo/SecurityGroupJoinVO.java b/server/src/com/cloud/api/query/vo/SecurityGroupJoinVO.java
index 50b30f3..ca1fa85 100644
--- a/server/src/com/cloud/api/query/vo/SecurityGroupJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/SecurityGroupJoinVO.java
@@ -24,7 +24,7 @@ import javax.persistence.Id;
 import javax.persistence.Table;
 
 import com.cloud.network.security.SecurityRule.SecurityRuleType;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 
 @Entity
 @Table(name="security_group_view")
@@ -135,7 +135,7 @@ public class SecurityGroupJoinVO extends BaseViewVO implements ControlledViewEnt
 
     @Column(name="tag_resource_type")
     @Enumerated(value=EnumType.STRING)
-    private TaggedResourceType tagResourceType;
+    private ResourceObjectType tagResourceType;
 
     @Column(name="tag_customer")
     private String tagCustomer;
@@ -295,7 +295,7 @@ public class SecurityGroupJoinVO extends BaseViewVO implements ControlledViewEnt
         return tagResourceUuid;
     }
 
-    public TaggedResourceType getTagResourceType() {
+    public ResourceObjectType getTagResourceType() {
         return tagResourceType;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/com/cloud/api/query/vo/TemplateJoinVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/vo/TemplateJoinVO.java b/server/src/com/cloud/api/query/vo/TemplateJoinVO.java
index 4cfdf6a..ca5963e 100644
--- a/server/src/com/cloud/api/query/vo/TemplateJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/TemplateJoinVO.java
@@ -30,7 +30,7 @@ import javax.persistence.TemporalType;
 import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine;
 
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.storage.ScopeType;
 import com.cloud.storage.Storage;
 import com.cloud.storage.VMTemplateStorageResourceAssoc.Status;
@@ -238,7 +238,7 @@ public class TemplateJoinVO extends BaseViewVO implements ControlledViewEntity {
 
     @Column(name="tag_resource_type")
     @Enumerated(value=EnumType.STRING)
-    private TaggedResourceType tagResourceType;
+    private ResourceObjectType tagResourceType;
 
     @Column(name="tag_customer")
     private String tagCustomer;
@@ -369,7 +369,7 @@ public class TemplateJoinVO extends BaseViewVO implements ControlledViewEntity {
         return tagResourceUuid;
     }
 
-    public TaggedResourceType getTagResourceType() {
+    public ResourceObjectType getTagResourceType() {
         return tagResourceType;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/com/cloud/api/query/vo/UserVmJoinVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/vo/UserVmJoinVO.java b/server/src/com/cloud/api/query/vo/UserVmJoinVO.java
index 0d00b47..5aae820 100644
--- a/server/src/com/cloud/api/query/vo/UserVmJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/UserVmJoinVO.java
@@ -31,7 +31,7 @@ import javax.persistence.Transient;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.network.Network.GuestType;
 import com.cloud.network.Networks.TrafficType;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.storage.Storage.StoragePoolType;
 import com.cloud.storage.Volume;
 import com.cloud.utils.db.Encrypt;
@@ -366,7 +366,7 @@ public class UserVmJoinVO extends BaseViewVO implements ControlledViewEntity {
 
     @Column(name="tag_resource_type")
     @Enumerated(value=EnumType.STRING)
-    private TaggedResourceType tagResourceType;
+    private ResourceObjectType tagResourceType;
 
     @Column(name="tag_customer")
     private String tagCustomer;
@@ -798,7 +798,7 @@ public class UserVmJoinVO extends BaseViewVO implements ControlledViewEntity {
         return tagResourceUuid;
     }
 
-    public TaggedResourceType getTagResourceType() {
+    public ResourceObjectType getTagResourceType() {
         return tagResourceType;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/com/cloud/api/query/vo/VolumeJoinVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/vo/VolumeJoinVO.java b/server/src/com/cloud/api/query/vo/VolumeJoinVO.java
index 066ed94..7c03cd7 100644
--- a/server/src/com/cloud/api/query/vo/VolumeJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/VolumeJoinVO.java
@@ -26,7 +26,7 @@ import javax.persistence.Table;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.storage.Storage;
 import com.cloud.storage.Volume;
 import com.cloud.storage.VMTemplateStorageResourceAssoc.Status;
@@ -255,7 +255,7 @@ public class VolumeJoinVO extends BaseViewVO implements ControlledViewEntity {
 
     @Column(name="tag_resource_type")
     @Enumerated(value=EnumType.STRING)
-    private TaggedResourceType tagResourceType;
+    private ResourceObjectType tagResourceType;
 
     @Column(name="tag_customer")
     private String tagCustomer;
@@ -649,7 +649,7 @@ public class VolumeJoinVO extends BaseViewVO implements ControlledViewEntity {
 
 
 
-    public TaggedResourceType getTagResourceType() {
+    public ResourceObjectType getTagResourceType() {
         return tagResourceType;
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/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 875bfac..58f2bf5 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.HashMap;
 import java.util.Map;
 
 import javax.ejb.Local;
@@ -26,112 +25,43 @@ import javax.naming.ConfigurationException;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
-import com.cloud.api.query.dao.ResourceTagJoinDao;
 import com.cloud.dc.DcDetailVO;
-import com.cloud.dc.dao.DataCenterDao;
 import com.cloud.dc.dao.DcDetailsDao;
 import com.cloud.event.ActionEvent;
 import com.cloud.event.EventTypes;
 import com.cloud.exception.InvalidParameterValueException;
-import com.cloud.network.dao.FirewallRulesDao;
-import com.cloud.network.dao.IPAddressDao;
-import com.cloud.network.dao.LoadBalancerDao;
-import com.cloud.network.dao.NetworkDao;
 import com.cloud.network.dao.NetworkDetailVO;
 import com.cloud.network.dao.NetworkDetailsDao;
-import com.cloud.network.dao.RemoteAccessVpnDao;
-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.dao.ProjectDao;
 import com.cloud.server.ResourceMetaDataService;
-import com.cloud.server.ResourceTag;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.server.TaggedResourceService;
+import com.cloud.service.ServiceOfferingDetailsVO;
+import com.cloud.service.dao.ServiceOfferingDetailsDao;
 import com.cloud.storage.VolumeDetailVO;
-import com.cloud.storage.dao.SnapshotDao;
-import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.storage.dao.VMTemplateDetailsDao;
-import com.cloud.storage.dao.VolumeDao;
 import com.cloud.storage.dao.VolumeDetailsDao;
-import com.cloud.tags.dao.ResourceTagDao;
-import com.cloud.user.AccountManager;
-import com.cloud.user.DomainManager;
 import com.cloud.utils.component.ManagerBase;
 import com.cloud.utils.db.DB;
-import com.cloud.utils.db.GenericDao;
 import com.cloud.utils.db.Transaction;
 import com.cloud.utils.db.TransactionCallback;
 import com.cloud.utils.db.TransactionStatus;
 import com.cloud.uuididentity.dao.IdentityDao;
 import com.cloud.vm.NicDetailVO;
-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;
 
 
 @Component
 @Local(value = { ResourceMetaDataService.class, ResourceMetaDataManager.class })
 public class ResourceMetaDataManagerImpl extends ManagerBase implements ResourceMetaDataService, ResourceMetaDataManager {
     public static final Logger s_logger = Logger.getLogger(ResourceMetaDataManagerImpl.class);
-
-
-    private static Map<TaggedResourceType, GenericDao<?, Long>> _daoMap=
-            new HashMap<TaggedResourceType, GenericDao<?, Long>>();
-    @Inject
-    AccountManager _accountMgr;
-    @Inject
-    ResourceTagDao _resourceTagDao;
-    @Inject
-    ResourceTagJoinDao _resourceTagJoinDao;
-    @Inject
-    IdentityDao _identityDao;
-    @Inject
-    DomainManager _domainMgr;
-    @Inject
-    UserVmDao _userVmDao;
-    @Inject
-    VolumeDao _volumeDao;
-    @Inject
-    VMTemplateDao _templateDao;
-    @Inject
-    SnapshotDao _snapshotDao;
-    @Inject
-    NetworkDao _networkDao;
-    @Inject
-    DataCenterDao _dataCenterDao;
-    @Inject
-    LoadBalancerDao _lbDao;
-    @Inject
-    PortForwardingRulesDao _pfDao;
-    @Inject
-    FirewallRulesDao _firewallDao;
-    @Inject
-    SecurityGroupDao _securityGroupDao;
-    @Inject
-    RemoteAccessVpnDao _vpnDao;
-    @Inject
-    IPAddressDao _publicIpDao;
-    @Inject
-    ProjectDao _projectDao;
-    @Inject
-    VpcDao _vpcDao;
-    @Inject
-    StaticRouteDao _staticRouteDao;
     @Inject
-    VMSnapshotDao _vmSnapshotDao;
-    @Inject
-    protected VolumeDetailsDao _volumeDetailDao;
+    VolumeDetailsDao _volumeDetailDao;
     @Inject
     NicDetailDao _nicDetailDao;
     @Inject
     UserVmDetailsDao _userVmDetailDao;
     @Inject
-    NicDao _nicDao;
-    @Inject
     DcDetailsDao _dcDetailsDao;
     @Inject
     NetworkDetailsDao _networkDetailsDao;
@@ -141,29 +71,12 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements Resource
     VMTemplateDetailsDao _templateDetailsDao;
     @Inject
     UserVmDetailsDao _userVmDetailsDao;
+    @Inject
+    ServiceOfferingDetailsDao _serviceOfferingDetailsDao;
+    
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
-
-        _daoMap.put(TaggedResourceType.UserVm, _userVmDao);
-        _daoMap.put(TaggedResourceType.Volume, _volumeDao);
-        _daoMap.put(TaggedResourceType.Template, _templateDao);
-        _daoMap.put(TaggedResourceType.ISO, _templateDao);
-        _daoMap.put(TaggedResourceType.Snapshot, _snapshotDao);
-        _daoMap.put(TaggedResourceType.Network, _networkDao);
-        _daoMap.put(TaggedResourceType.LoadBalancer, _lbDao);
-        _daoMap.put(TaggedResourceType.PortForwardingRule, _pfDao);
-        _daoMap.put(TaggedResourceType.FirewallRule, _firewallDao);
-        _daoMap.put(TaggedResourceType.SecurityGroup, _securityGroupDao);
-        _daoMap.put(TaggedResourceType.PublicIpAddress, _publicIpDao);
-        _daoMap.put(TaggedResourceType.Project, _projectDao);
-        _daoMap.put(TaggedResourceType.Vpc, _vpcDao);
-        _daoMap.put(TaggedResourceType.NetworkACL, _firewallDao);
-        _daoMap.put(TaggedResourceType.Nic, _nicDao);
-        _daoMap.put(TaggedResourceType.StaticRoute, _staticRouteDao);
-        _daoMap.put(TaggedResourceType.VMSnapshot, _vmSnapshotDao);
-        _daoMap.put(TaggedResourceType.RemoteAccessVpn, _vpnDao);
-        _daoMap.put(TaggedResourceType.Zone, _dataCenterDao);
         return true;
     }
 
@@ -176,66 +89,51 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements Resource
     public boolean stop() {
         return true;
     }
-
-
-
-
-    @Override
-    public TaggedResourceType getResourceType(String resourceTypeStr) {
-
-        for (TaggedResourceType type : ResourceTag.TaggedResourceType.values()) {
-            if (type.toString().equalsIgnoreCase(resourceTypeStr)) {
-                return type;
-            }
-        }
-        throw new InvalidParameterValueException("Invalid resource type " + resourceTypeStr);
-    }
+    
 
     @Override
     @DB
     @ActionEvent(eventType = EventTypes.EVENT_RESOURCE_DETAILS_CREATE, eventDescription = "creating resource meta data")
-    public boolean addResourceMetaData(final String resourceId, final TaggedResourceType resourceType, final Map<String, String> details){
+    public boolean addResourceMetaData(final String resourceId, final ResourceObjectType resourceType, final Map<String, String> details){
         return Transaction.execute(new TransactionCallback<Boolean>() {
             @Override
             public Boolean doInTransaction(TransactionStatus status) {
                 for (String key : details.keySet()) {
-                        Long id = _taggedResourceMgr.getResourceId(resourceId, resourceType);
-
-                        //check if object exists
-                        if (_daoMap.get(resourceType).findById(id) == null) {
-                            throw new InvalidParameterValueException("Unable to find resource by id " + resourceId +
-                                    " and type " + resourceType);
-                        }
-
                         String value = details.get(key);
 
                         if (value == null || value.isEmpty()) {
                             throw new InvalidParameterValueException("Value for the key " + key + " is either null or empty");
                         }
+                        
+                        if (!resourceType.resourceMetadataSupport())  {
+                            throw new InvalidParameterValueException("The resource type " + resourceType + " doesn't support metadata (resource details)");
+                        }
 
+                        long id = _taggedResourceMgr.getResourceId(resourceId, resourceType);
                         // TODO - Have a better design here.
-                        if(resourceType == TaggedResourceType.Volume){
+                        if(resourceType == ResourceObjectType.Volume){
                             VolumeDetailVO v = new VolumeDetailVO(id, key, value);
                             _volumeDetailDao.persist(v);
-                        } else if (resourceType == TaggedResourceType.Nic){
+                        } else if (resourceType == ResourceObjectType.Nic){
                             NicDetailVO n = new NicDetailVO(id, key, value);
                             _nicDetailDao.persist(n);
-                        } else if (resourceType == TaggedResourceType.Zone){
+                        } else if (resourceType == ResourceObjectType.Zone){
                              DcDetailVO dataCenterDetail = new DcDetailVO(id, key, value);
                              _dcDetailsDao.persist(dataCenterDetail);
-                        } else if (resourceType == TaggedResourceType.Network){
+                        } else if (resourceType == ResourceObjectType.Network){
                             NetworkDetailVO networkDetail = new NetworkDetailVO(id, key, value);
                             _networkDetailsDao.persist(networkDetail);
-                        } else if (resourceType == TaggedResourceType.UserVm) {
+                        } else if (resourceType == ResourceObjectType.UserVm) {
                             _userVmDetailsDao.addVmDetail(id, key, value);
-                        } else if (resourceType == TaggedResourceType.Template) {
+                        } else if (resourceType == ResourceObjectType.Template) {
                             _templateDetailsDao.addTemplateDetail(id, key, value);
-                        } else{
-                            throw new InvalidParameterValueException("The resource type " + resourceType + " is not supported by the API yet");
+                        } else if (resourceType == ResourceObjectType.ServiceOffering) {
+                            ServiceOfferingDetailsVO entity = new ServiceOfferingDetailsVO(id, key, value);
+                            _serviceOfferingDetailsDao.persist(entity);
                         }
-
                 }
-
+                
+                
                 return true;
             }
         });
@@ -245,22 +143,25 @@ public class ResourceMetaDataManagerImpl extends ManagerBase implements Resource
     @Override
     @DB
     @ActionEvent(eventType = EventTypes.EVENT_RESOURCE_DETAILS_DELETE, eventDescription = "deleting resource meta data")
-    public boolean deleteResourceMetaData(String resourceId, TaggedResourceType resourceType, String key){
+    public boolean deleteResourceMetaData(String resourceId, ResourceObjectType resourceType, String key){
 
-        Long id = _taggedResourceMgr.getResourceId(resourceId, resourceType);
+        long id = _taggedResourceMgr.getResourceId(resourceId, resourceType);
+        
+        if (!resourceType.resourceMetadataSupport()) {
+            throw new InvalidParameterValueException("The resource type " + resourceType + " is not supported by the API yet");
+        }
+        
         // TODO - Have a better design here.
-        if(resourceType == TaggedResourceType.Volume){
+        if(resourceType == ResourceObjectType.Volume){
            _volumeDetailDao.removeDetails(id, key);
-        } else if(resourceType == TaggedResourceType.Nic){
+        } else if(resourceType == ResourceObjectType.Nic){
             _nicDetailDao.removeDetails(id, key);
-        } else if(resourceType == TaggedResourceType.UserVm){
+        } else if(resourceType == ResourceObjectType.UserVm){
             _userVmDetailDao.removeDetails(id, key);
-        } else if (resourceType == TaggedResourceType.Zone){
+        } else if (resourceType == ResourceObjectType.Zone){
             _dcDetailsDao.removeDetails(id, key);
-        } else if (resourceType == TaggedResourceType.Network){
+        } else if (resourceType == ResourceObjectType.Network){
             _networkDetailsDao.removeDetails(id, key);
-        } else{
-            throw new InvalidParameterValueException("The resource type " + resourceType + " is not supported by the API yet");
         }
 
         return true;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/com/cloud/network/NetworkServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java
index c9a14cd..cf419f3 100755
--- a/server/src/com/cloud/network/NetworkServiceImpl.java
+++ b/server/src/com/cloud/network/NetworkServiceImpl.java
@@ -136,7 +136,7 @@ import com.cloud.offerings.dao.NetworkOfferingServiceMapDao;
 import com.cloud.org.Grouping;
 import com.cloud.projects.Project;
 import com.cloud.projects.ProjectManager;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.tags.ResourceTagVO;
 import com.cloud.tags.dao.ResourceTagDao;
 import com.cloud.user.Account;
@@ -1671,7 +1671,7 @@ public class NetworkServiceImpl extends ManagerBase implements  NetworkService {
 
         if (tags != null && !tags.isEmpty()) {
             int count = 0;
-            sc.setJoinParameters("tagSearch", "resourceType", TaggedResourceType.Network.toString());
+            sc.setJoinParameters("tagSearch", "resourceType", ResourceObjectType.Network.toString());
             for (String key : tags.keySet()) {
                 sc.setJoinParameters("tagSearch", "key" + String.valueOf(count), key);
                 sc.setJoinParameters("tagSearch", "value" + String.valueOf(count), tags.get(key));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/com/cloud/network/firewall/FirewallManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/firewall/FirewallManagerImpl.java b/server/src/com/cloud/network/firewall/FirewallManagerImpl.java
index 01504ab..bd9ead0 100644
--- a/server/src/com/cloud/network/firewall/FirewallManagerImpl.java
+++ b/server/src/com/cloud/network/firewall/FirewallManagerImpl.java
@@ -74,7 +74,7 @@ import com.cloud.network.rules.StaticNat;
 import com.cloud.network.rules.dao.PortForwardingRulesDao;
 import com.cloud.network.vpc.VpcManager;
 import com.cloud.projects.Project.ListProjectResourcesCriteria;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.tags.ResourceTagVO;
 import com.cloud.tags.dao.ResourceTagDao;
 import com.cloud.user.Account;
@@ -308,7 +308,7 @@ public class FirewallManagerImpl extends ManagerBase implements FirewallService,
 
         if (tags != null && !tags.isEmpty()) {
             int count = 0;
-            sc.setJoinParameters("tagSearch", "resourceType", TaggedResourceType.FirewallRule.toString());
+            sc.setJoinParameters("tagSearch", "resourceType", ResourceObjectType.FirewallRule.toString());
             for (String key : tags.keySet()) {
                 sc.setJoinParameters("tagSearch", "key" + String.valueOf(count), key);
                 sc.setJoinParameters("tagSearch", "value" + String.valueOf(count), tags.get(key));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
index 780a942..d49f309 100755
--- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
+++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java
@@ -130,7 +130,7 @@ import com.cloud.network.rules.StickinessPolicy;
 import com.cloud.network.vpc.VpcManager;
 import com.cloud.offering.NetworkOffering;
 import com.cloud.projects.Project.ListProjectResourcesCriteria;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.service.dao.ServiceOfferingDao;
 import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.tags.ResourceTagVO;
@@ -2055,7 +2055,7 @@ public class LoadBalancingRulesManagerImpl<Type> extends ManagerBase implements
 
         if (tags != null && !tags.isEmpty()) {
             int count = 0;
-            sc.setJoinParameters("tagSearch", "resourceType", TaggedResourceType.LoadBalancer.toString());
+            sc.setJoinParameters("tagSearch", "resourceType", ResourceObjectType.LoadBalancer.toString());
             for (String key : tags.keySet()) {
                 sc.setJoinParameters("tagSearch", "key" + String.valueOf(count), key);
                 sc.setJoinParameters("tagSearch", "value" + String.valueOf(count), tags.get(key));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/com/cloud/network/rules/RulesManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/rules/RulesManagerImpl.java b/server/src/com/cloud/network/rules/RulesManagerImpl.java
index d98dd29..2ea1021 100755
--- a/server/src/com/cloud/network/rules/RulesManagerImpl.java
+++ b/server/src/com/cloud/network/rules/RulesManagerImpl.java
@@ -59,7 +59,7 @@ import com.cloud.network.vpc.VpcManager;
 import com.cloud.network.vpc.VpcService;
 import com.cloud.offering.NetworkOffering;
 import com.cloud.projects.Project.ListProjectResourcesCriteria;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.tags.ResourceTagVO;
 import com.cloud.tags.dao.ResourceTagDao;
 import com.cloud.user.Account;
@@ -831,7 +831,7 @@ public class RulesManagerImpl extends ManagerBase implements RulesManager, Rules
 
         if (tags != null && !tags.isEmpty()) {
             int count = 0;
-            sc.setJoinParameters("tagSearch", "resourceType", TaggedResourceType.PortForwardingRule.toString());
+            sc.setJoinParameters("tagSearch", "resourceType", ResourceObjectType.PortForwardingRule.toString());
             for (String key : tags.keySet()) {
                 sc.setJoinParameters("tagSearch", "key" + String.valueOf(count), key);
                 sc.setJoinParameters("tagSearch", "value" + String.valueOf(count), tags.get(key));

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/2bb716ef/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
index 50dd8e3..d12e577 100644
--- a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
+++ b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java
@@ -43,7 +43,7 @@ import com.cloud.network.dao.NetworkVO;
 import com.cloud.network.vpc.dao.NetworkACLDao;
 import com.cloud.network.vpc.dao.VpcGatewayDao;
 import com.cloud.projects.Project.ListProjectResourcesCriteria;
-import com.cloud.server.ResourceTag.TaggedResourceType;
+import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.tags.ResourceTagVO;
 import com.cloud.tags.dao.ResourceTagDao;
 import com.cloud.user.Account;
@@ -484,7 +484,7 @@ public class NetworkACLServiceImpl extends ManagerBase implements NetworkACLServ
 
         if (tags != null && !tags.isEmpty()) {
             int count = 0;
-            sc.setJoinParameters("tagSearch", "resourceType", TaggedResourceType.NetworkACL.toString());
+            sc.setJoinParameters("tagSearch", "resourceType", ResourceObjectType.NetworkACL.toString());
             for (String key : tags.keySet()) {
                 sc.setJoinParameters("tagSearch", "key" + String.valueOf(count), key);
                 sc.setJoinParameters("tagSearch", "value" + String.valueOf(count), tags.get(key));


Mime
View raw message