cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [36/50] [abbrv] CLOUDSTACK-5920:Add interface to ControlledEntity to return IAM entity type.
Date Thu, 06 Mar 2014 22:07:19 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/engine/schema/src/com/cloud/vm/snapshot/VMSnapshotVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/vm/snapshot/VMSnapshotVO.java b/engine/schema/src/com/cloud/vm/snapshot/VMSnapshotVO.java
index 79fd274..042b276 100644
--- a/engine/schema/src/com/cloud/vm/snapshot/VMSnapshotVO.java
+++ b/engine/schema/src/com/cloud/vm/snapshot/VMSnapshotVO.java
@@ -33,6 +33,7 @@ import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 import javax.persistence.Transient;
 
+import org.apache.cloudstack.acl.IAMEntityType;
 import org.apache.cloudstack.engine.subsystem.api.storage.VMSnapshotOptions;
 
 import com.cloud.utils.db.GenericDao;
@@ -133,10 +134,10 @@ public class VMSnapshotVO implements VMSnapshot {
         this.accountId = accountId;
         this.domainId = domainId;
         this.vmId = vmId;
-        this.state = State.Allocated;
+        state = State.Allocated;
         this.description = description;
-        this.name = vmSnapshotName;
-        this.displayName = vsDisplayName;
+        name = vmSnapshotName;
+        displayName = vsDisplayName;
         this.type = type;
         this.current = current;
     }
@@ -227,7 +228,7 @@ public class VMSnapshotVO implements VMSnapshot {
 
     @Override
     public void incrUpdatedCount() {
-        this.updatedCount++;
+        updatedCount++;
     }
 
     @Override
@@ -243,4 +244,9 @@ public class VMSnapshotVO implements VMSnapshot {
     public void setRemoved(Date removed) {
         this.removed = removed;
     }
+
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.VMSnapshot;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/engine/schema/src/org/apache/cloudstack/affinity/AffinityGroupVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/affinity/AffinityGroupVO.java b/engine/schema/src/org/apache/cloudstack/affinity/AffinityGroupVO.java
index 86a2e6a..b9fda8e 100644
--- a/engine/schema/src/org/apache/cloudstack/affinity/AffinityGroupVO.java
+++ b/engine/schema/src/org/apache/cloudstack/affinity/AffinityGroupVO.java
@@ -28,6 +28,7 @@ import javax.persistence.Id;
 import javax.persistence.Table;
 
 import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.acl.IAMEntityType;
 
 @Entity
 @Table(name = ("affinity_group"))
@@ -60,7 +61,7 @@ public class AffinityGroupVO implements AffinityGroup {
     ControlledEntity.ACLType aclType;
 
     public AffinityGroupVO() {
-        this.uuid = UUID.randomUUID().toString();
+        uuid = UUID.randomUUID().toString();
     }
 
     public AffinityGroupVO(String name, String type, String description, long domainId, long accountId, ACLType aclType) {
@@ -68,7 +69,7 @@ public class AffinityGroupVO implements AffinityGroup {
         this.description = description;
         this.domainId = domainId;
         this.accountId = accountId;
-        this.uuid = UUID.randomUUID().toString();
+        uuid = UUID.randomUUID().toString();
         this.type = type;
         this.aclType = aclType;
     }
@@ -100,7 +101,7 @@ public class AffinityGroupVO implements AffinityGroup {
 
     @Override
     public String getUuid() {
-        return this.uuid;
+        return uuid;
     }
 
     public void setUuid(String uuid) {
@@ -124,4 +125,9 @@ public class AffinityGroupVO implements AffinityGroup {
         return buf.toString();
     }
 
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.AffinityGroup;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java b/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java
index 19d608b..7403d62 100644
--- a/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java
+++ b/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java
@@ -37,6 +37,8 @@ import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 import javax.persistence.Transient;
 
+import org.apache.cloudstack.acl.IAMEntityType;
+
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.utils.db.Encrypt;
 import com.cloud.utils.db.GenericDao;
@@ -179,28 +181,28 @@ public class VMEntityVO implements VirtualMachine, FiniteStateObject<State, Virt
     public VMEntityVO(long id, long serviceOfferingId, String name, String instanceName, Type type, Long vmTemplateId, HypervisorType hypervisorType, long guestOSId,
             long domainId, long accountId, boolean haEnabled, Long diskOfferingId) {
         this.id = id;
-        this.hostName = name != null ? name : this.uuid;
+        hostName = name != null ? name : uuid;
         if (vmTemplateId != null) {
-            this.templateId = vmTemplateId;
+            templateId = vmTemplateId;
         }
         this.instanceName = instanceName;
         this.type = type;
         this.guestOSId = guestOSId;
         this.haEnabled = haEnabled;
-        this.vncPassword = Long.toHexString(new Random().nextLong());
-        this.state = State.Stopped;
+        vncPassword = Long.toHexString(new Random().nextLong());
+        state = State.Stopped;
         this.accountId = accountId;
         this.domainId = domainId;
         this.serviceOfferingId = serviceOfferingId;
         this.hypervisorType = hypervisorType;
-        this.limitCpuUse = false;
+        limitCpuUse = false;
         this.diskOfferingId = diskOfferingId;
     }
 
     public VMEntityVO(long id, long serviceOfferingId, String name, String instanceName, Type type, Long vmTemplateId, HypervisorType hypervisorType, long guestOSId,
             long domainId, long accountId, boolean haEnabled, boolean limitResourceUse) {
         this(id, serviceOfferingId, name, instanceName, type, vmTemplateId, hypervisorType, guestOSId, domainId, accountId, haEnabled, null);
-        this.limitCpuUse = limitResourceUse;
+        limitCpuUse = limitResourceUse;
     }
 
     protected VMEntityVO() {
@@ -316,11 +318,11 @@ public class VMEntityVO implements VirtualMachine, FiniteStateObject<State, Virt
     }
 
     public Date getProxyAssignTime() {
-        return this.proxyAssignTime;
+        return proxyAssignTime;
     }
 
     public void setProxyAssignTime(Date time) {
-        this.proxyAssignTime = time;
+        proxyAssignTime = time;
     }
 
     @Override
@@ -396,7 +398,7 @@ public class VMEntityVO implements VirtualMachine, FiniteStateObject<State, Virt
     }
 
     public void setPodId(long podId) {
-        this.podIdToDeployIn = podId;
+        podIdToDeployIn = podId;
     }
 
     public void setPrivateMacAddress(String privateMacAddress) {
@@ -404,7 +406,7 @@ public class VMEntityVO implements VirtualMachine, FiniteStateObject<State, Virt
     }
 
     public void setDataCenterId(long dataCenterId) {
-        this.dataCenterIdToDeployIn = dataCenterId;
+        dataCenterIdToDeployIn = dataCenterId;
     }
 
     public boolean isRemoved() {
@@ -420,7 +422,7 @@ public class VMEntityVO implements VirtualMachine, FiniteStateObject<State, Virt
     }
 
     public String getReservationId() {
-        return this.reservationId;
+        return reservationId;
     }
 
     @Override
@@ -535,4 +537,8 @@ public class VMEntityVO implements VirtualMachine, FiniteStateObject<State, Virt
         this.vmReservation = vmReservation;
     }
 
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.VirtualMachine;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/engine/schema/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancerRuleVO.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancerRuleVO.java b/engine/schema/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancerRuleVO.java
index b7b720d..a37fec2 100644
--- a/engine/schema/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancerRuleVO.java
+++ b/engine/schema/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancerRuleVO.java
@@ -28,6 +28,8 @@ import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.Table;
 
+import org.apache.cloudstack.acl.IAMEntityType;
+
 import com.cloud.region.ha.GlobalLoadBalancerRule;
 
 @Entity
@@ -74,21 +76,21 @@ public class GlobalLoadBalancerRuleVO implements GlobalLoadBalancerRule {
     GlobalLoadBalancerRule.State state;
 
     public GlobalLoadBalancerRuleVO() {
-        this.uuid = UUID.randomUUID().toString();
+        uuid = UUID.randomUUID().toString();
     }
 
     public GlobalLoadBalancerRuleVO(String name, String description, String gslbDomain, String algorithm, String persistence, String serviceType, int regionId,
             long accountId, long domainId, State state) {
         this.name = name;
         this.description = description;
-        this.region = regionId;
+        region = regionId;
         this.algorithm = algorithm;
         this.gslbDomain = gslbDomain;
         this.persistence = persistence;
         this.accountId = accountId;
         this.domainId = domainId;
         this.serviceType = serviceType;
-        this.uuid = UUID.randomUUID().toString();
+        uuid = UUID.randomUUID().toString();
         this.state = state;
     }
 
@@ -163,7 +165,7 @@ public class GlobalLoadBalancerRuleVO implements GlobalLoadBalancerRule {
 
     @Override
     public String getUuid() {
-        return this.uuid;
+        return uuid;
     }
 
     public void setUuid(String uuid) {
@@ -187,4 +189,9 @@ public class GlobalLoadBalancerRuleVO implements GlobalLoadBalancerRule {
     public GlobalLoadBalancerRule.State getState() {
         return state;
     }
+
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.GlobalLoadBalancerRule;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
----------------------------------------------------------------------
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
index 503d372..8db21cc 100644
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java
@@ -25,6 +25,7 @@ import javax.inject.Inject;
 
 import org.apache.log4j.Logger;
 
+import org.apache.cloudstack.acl.IAMEntityType;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine;
@@ -436,4 +437,8 @@ public class TemplateObject implements TemplateInfo {
         return true;
     }
 
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.VirtualMachineTemplate;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
index 669a075..2ff24ca 100644
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java
@@ -24,6 +24,7 @@ import javax.inject.Inject;
 
 import org.apache.log4j.Logger;
 
+import org.apache.cloudstack.acl.IAMEntityType;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine;
@@ -380,4 +381,9 @@ public class SnapshotObject implements SnapshotInfo {
         }
         return true;
     }
+
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.Snapshot;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/engine/storage/src/org/apache/cloudstack/storage/image/TemplateEntityImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/TemplateEntityImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/TemplateEntityImpl.java
index ed6b509..fd90ac9 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/image/TemplateEntityImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/image/TemplateEntityImpl.java
@@ -23,6 +23,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.cloudstack.acl.IAMEntityType;
 import org.apache.cloudstack.engine.cloud.entity.api.TemplateEntity;
 import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo;
 import org.apache.cloudstack.storage.image.datastore.ImageStoreInfo;
@@ -285,4 +286,8 @@ public class TemplateEntityImpl implements TemplateEntity {
         return 0;
     }
 
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.VirtualMachineTemplate;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotEntityImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotEntityImpl.java b/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotEntityImpl.java
index fb3ec48..848b165 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotEntityImpl.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotEntityImpl.java
@@ -21,6 +21,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.cloudstack.acl.IAMEntityType;
 import org.apache.cloudstack.engine.cloud.entity.api.SnapshotEntity;
 
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
@@ -183,4 +184,8 @@ public class SnapshotEntityImpl implements SnapshotEntity {
         return null;
     }
 
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.Snapshot;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
index 1653dcb..1f05be2 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
@@ -22,9 +22,7 @@ import javax.inject.Inject;
 
 import org.apache.log4j.Logger;
 
-import com.cloud.storage.DiskOfferingVO;
-import com.cloud.storage.dao.DiskOfferingDao;
-import com.cloud.vm.VirtualMachine;
+import org.apache.cloudstack.acl.IAMEntityType;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
 import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine;
@@ -43,9 +41,11 @@ import com.cloud.agent.api.to.DataTO;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.offering.DiskOffering.DiskCacheMode;
 import com.cloud.storage.DataStoreRole;
+import com.cloud.storage.DiskOfferingVO;
 import com.cloud.storage.Storage.ImageFormat;
 import com.cloud.storage.Volume;
 import com.cloud.storage.VolumeVO;
+import com.cloud.storage.dao.DiskOfferingDao;
 import com.cloud.storage.dao.VolumeDao;
 import com.cloud.utils.component.ComponentContext;
 import com.cloud.utils.exception.CloudRuntimeException;
@@ -53,6 +53,7 @@ import com.cloud.utils.fsm.NoTransitionException;
 import com.cloud.utils.fsm.StateMachine2;
 import com.cloud.utils.storage.encoding.EncodingType;
 import com.cloud.vm.VMInstanceVO;
+import com.cloud.vm.VirtualMachine;
 import com.cloud.vm.dao.VMInstanceDao;
 
 public class VolumeObject implements VolumeInfo {
@@ -89,7 +90,7 @@ public class VolumeObject implements VolumeInfo {
 
     @Override
     public String getAttachedVmName() {
-        Long vmId = this.volumeVO.getInstanceId();
+        Long vmId = volumeVO.getInstanceId();
         if (vmId != null) {
             VMInstanceVO vm = vmInstanceDao.findById(vmId);
 
@@ -103,7 +104,7 @@ public class VolumeObject implements VolumeInfo {
 
     @Override
     public VirtualMachine getAttachedVM() {
-        Long vmId = this.volumeVO.getInstanceId();
+        Long vmId = volumeVO.getInstanceId();
         if (vmId != null) {
             VMInstanceVO vm = vmInstanceDao.findById(vmId);
             return vm;
@@ -179,7 +180,7 @@ public class VolumeObject implements VolumeInfo {
             result = _volStateMachine.transitTo(volumeVO, event, null, volumeDao);
             volumeVO = volumeDao.findById(volumeVO.getId());
         } catch (NoTransitionException e) {
-            String errorMessage = "Failed to transit volume: " + this.getVolumeId() + ", due to: " + e.toString();
+            String errorMessage = "Failed to transit volume: " + getVolumeId() + ", due to: " + e.toString();
             s_logger.debug(errorMessage);
             throw new CloudRuntimeException(errorMessage);
         }
@@ -246,25 +247,25 @@ public class VolumeObject implements VolumeInfo {
 
     @Override
     public long getId() {
-        return this.volumeVO.getId();
+        return volumeVO.getId();
     }
 
     @Override
     public boolean isAttachedVM() {
-        return (this.volumeVO.getInstanceId() == null) ? false : true;
+        return (volumeVO.getInstanceId() == null) ? false : true;
     }
 
     @Override
     public String getUri() {
-        if (this.dataStore == null) {
+        if (dataStore == null) {
             throw new CloudRuntimeException("datastore must be set before using this object");
         }
-        DataObjectInStore obj = objectInStoreMgr.findObject(this.volumeVO.getId(), DataObjectType.VOLUME, this.dataStore.getId(), this.dataStore.getRole());
+        DataObjectInStore obj = objectInStoreMgr.findObject(volumeVO.getId(), DataObjectType.VOLUME, dataStore.getId(), dataStore.getRole());
         if (obj.getState() != ObjectInDataStoreStateMachine.State.Ready) {
-            return this.dataStore.getUri() + "&" + EncodingType.OBJTYPE + "=" + DataObjectType.VOLUME + "&" + EncodingType.SIZE + "=" + this.volumeVO.getSize() + "&" +
-                EncodingType.NAME + "=" + this.volumeVO.getName();
+            return dataStore.getUri() + "&" + EncodingType.OBJTYPE + "=" + DataObjectType.VOLUME + "&" + EncodingType.SIZE + "=" + volumeVO.getSize() + "&" +
+                EncodingType.NAME + "=" + volumeVO.getName();
         } else {
-            return this.dataStore.getUri() + "&" + EncodingType.OBJTYPE + "=" + DataObjectType.VOLUME + "&" + EncodingType.PATH + "=" + obj.getInstallPath();
+            return dataStore.getUri() + "&" + EncodingType.OBJTYPE + "=" + DataObjectType.VOLUME + "&" + EncodingType.PATH + "=" + obj.getInstallPath();
         }
     }
 
@@ -275,19 +276,19 @@ public class VolumeObject implements VolumeInfo {
 
     @Override
     public void processEvent(ObjectInDataStoreStateMachine.Event event) {
-        if (this.dataStore == null) {
+        if (dataStore == null) {
             return;
         }
         try {
             Volume.Event volEvent = null;
-            if (this.dataStore.getRole() == DataStoreRole.ImageCache) {
+            if (dataStore.getRole() == DataStoreRole.ImageCache) {
                 objectInStoreMgr.update(this, event);
                 return;
             }
-            if (this.dataStore.getRole() == DataStoreRole.Image) {
+            if (dataStore.getRole() == DataStoreRole.Image) {
                 objectInStoreMgr.update(this, event);
-                if (this.volumeVO.getState() == Volume.State.Migrating || this.volumeVO.getState() == Volume.State.Copying ||
-                    this.volumeVO.getState() == Volume.State.Uploaded || this.volumeVO.getState() == Volume.State.Expunged) {
+                if (volumeVO.getState() == Volume.State.Migrating || volumeVO.getState() == Volume.State.Copying ||
+                    volumeVO.getState() == Volume.State.Uploaded || volumeVO.getState() == Volume.State.Expunged) {
                     return;
                 }
                 if (event == ObjectInDataStoreStateMachine.Event.CreateOnlyRequested) {
@@ -316,14 +317,14 @@ public class VolumeObject implements VolumeInfo {
             } else if (event == ObjectInDataStoreStateMachine.Event.ResizeRequested) {
                 volEvent = Volume.Event.ResizeRequested;
             }
-            this.stateTransit(volEvent);
+            stateTransit(volEvent);
         } catch (Exception e) {
             s_logger.debug("Failed to update state", e);
             throw new CloudRuntimeException("Failed to update state:" + e.toString());
         } finally {
             // in case of OperationFailed, expunge the entry
             if (event == ObjectInDataStoreStateMachine.Event.OperationFailed &&
-                (this.volumeVO.getState() != Volume.State.Copying && this.volumeVO.getState() != Volume.State.Uploaded)) {
+                (volumeVO.getState() != Volume.State.Copying && volumeVO.getState() != Volume.State.Uploaded)) {
                 objectInStoreMgr.deleteIfNotReady(this);
             }
         }
@@ -347,25 +348,25 @@ public class VolumeObject implements VolumeInfo {
 
     @Override
     public String getName() {
-        return this.volumeVO.getName();
+        return volumeVO.getName();
     }
 
     @Override
     public Long getInstanceId() {
-        return this.volumeVO.getInstanceId();
+        return volumeVO.getInstanceId();
     }
 
     @Override
     public String getFolder() {
-        return this.volumeVO.getFolder();
+        return volumeVO.getFolder();
     }
 
     @Override
     public String getPath() {
-        if (this.dataStore.getRole() == DataStoreRole.Primary) {
-            return this.volumeVO.getPath();
+        if (dataStore.getRole() == DataStoreRole.Primary) {
+            return volumeVO.getPath();
         } else {
-            DataObjectInStore objInStore = this.objectInStoreMgr.findObject(this, dataStore);
+            DataObjectInStore objInStore = objectInStoreMgr.findObject(this, dataStore);
             if (objInStore != null) {
                 return objInStore.getInstallPath();
             } else {
@@ -376,121 +377,121 @@ public class VolumeObject implements VolumeInfo {
 
     @Override
     public Long getPodId() {
-        return this.volumeVO.getPodId();
+        return volumeVO.getPodId();
     }
 
     @Override
     public long getDataCenterId() {
-        return this.volumeVO.getDataCenterId();
+        return volumeVO.getDataCenterId();
     }
 
     @Override
     public Type getVolumeType() {
-        return this.volumeVO.getVolumeType();
+        return volumeVO.getVolumeType();
     }
 
     @Override
     public Long getPoolId() {
-        return this.volumeVO.getPoolId();
+        return volumeVO.getPoolId();
     }
 
     @Override
     public Date getAttached() {
-        return this.volumeVO.getAttached();
+        return volumeVO.getAttached();
     }
 
     @Override
     public Long getDeviceId() {
-        return this.volumeVO.getDeviceId();
+        return volumeVO.getDeviceId();
     }
 
     @Override
     public Date getCreated() {
-        return this.volumeVO.getCreated();
+        return volumeVO.getCreated();
     }
 
     @Override
     public Long getDiskOfferingId() {
-        return this.volumeVO.getDiskOfferingId();
+        return volumeVO.getDiskOfferingId();
     }
 
     @Override
     public String getChainInfo() {
-        return this.volumeVO.getChainInfo();
+        return volumeVO.getChainInfo();
     }
 
     @Override
     public boolean isRecreatable() {
-        return this.volumeVO.isRecreatable();
+        return volumeVO.isRecreatable();
     }
 
     @Override
     public long getUpdatedCount() {
-        return this.volumeVO.getUpdatedCount();
+        return volumeVO.getUpdatedCount();
     }
 
     @Override
     public void incrUpdatedCount() {
-        this.volumeVO.incrUpdatedCount();
+        volumeVO.incrUpdatedCount();
     }
 
     @Override
     public Date getUpdated() {
-        return this.volumeVO.getUpdated();
+        return volumeVO.getUpdated();
     }
 
     @Override
     public String getReservationId() {
-        return this.volumeVO.getReservationId();
+        return volumeVO.getReservationId();
     }
 
     @Override
     public void setReservationId(String reserv) {
-        this.volumeVO.setReservationId(reserv);
+        volumeVO.setReservationId(reserv);
     }
 
     @Override
     public long getAccountId() {
-        return this.volumeVO.getAccountId();
+        return volumeVO.getAccountId();
     }
 
     @Override
     public long getDomainId() {
-        return this.volumeVO.getDomainId();
+        return volumeVO.getDomainId();
     }
 
     @Override
     public Long getTemplateId() {
-        return this.volumeVO.getTemplateId();
+        return volumeVO.getTemplateId();
     }
 
     @Override
     public void addPayload(Object data) {
-        this.payload = data;
+        payload = data;
     }
 
     @Override
     public Object getpayload() {
-        return this.payload;
+        return payload;
     }
 
     public VolumeVO getVolume() {
-        return this.volumeVO;
+        return volumeVO;
     }
 
     @Override
     public HypervisorType getHypervisorType() {
-        return this.volumeDao.getHypervisorType(this.volumeVO.getId());
+        return volumeDao.getHypervisorType(volumeVO.getId());
     }
 
     @Override
     public Long getLastPoolId() {
-        return this.volumeVO.getLastPoolId();
+        return volumeVO.getLastPoolId();
     }
 
     @Override
     public DataTO getTO() {
-        DataTO to = this.getDataStore().getDriver().getTO(this);
+        DataTO to = getDataStore().getDriver().getTO(this);
         if (to == null) {
             to = new VolumeObjectTO(this);
         }
@@ -500,10 +501,10 @@ public class VolumeObject implements VolumeInfo {
     @Override
     public void processEvent(ObjectInDataStoreStateMachine.Event event, Answer answer) {
         try {
-            if (this.dataStore.getRole() == DataStoreRole.Primary) {
+            if (dataStore.getRole() == DataStoreRole.Primary) {
                 if (answer instanceof CopyCmdAnswer) {
                     CopyCmdAnswer cpyAnswer = (CopyCmdAnswer)answer;
-                    VolumeVO vol = this.volumeDao.findById(this.getId());
+                    VolumeVO vol = volumeDao.findById(getId());
                     VolumeObjectTO newVol = (VolumeObjectTO)cpyAnswer.getNewData();
                     vol.setPath(newVol.getPath());
                     if (newVol.getSize() != null) {
@@ -512,17 +513,17 @@ public class VolumeObject implements VolumeInfo {
                     if (newVol.getFormat() != null) {
                         vol.setFormat(newVol.getFormat());
                     }
-                    vol.setPoolId(this.getDataStore().getId());
+                    vol.setPoolId(getDataStore().getId());
                     volumeDao.update(vol.getId(), vol);
                 } else if (answer instanceof CreateObjectAnswer) {
                     CreateObjectAnswer createAnswer = (CreateObjectAnswer)answer;
                     VolumeObjectTO newVol = (VolumeObjectTO)createAnswer.getData();
-                    VolumeVO vol = this.volumeDao.findById(this.getId());
+                    VolumeVO vol = volumeDao.findById(getId());
                     vol.setPath(newVol.getPath());
                     if (newVol.getSize() != null) {
                         vol.setSize(newVol.getSize());
                     }
-                    vol.setPoolId(this.getDataStore().getId());
+                    vol.setPoolId(getDataStore().getId());
                     if (newVol.getFormat() != null) {
                         vol.setFormat(newVol.getFormat());
                     }
@@ -532,19 +533,19 @@ public class VolumeObject implements VolumeInfo {
                 // image store or imageCache store
                 if (answer instanceof DownloadAnswer) {
                     DownloadAnswer dwdAnswer = (DownloadAnswer)answer;
-                    VolumeDataStoreVO volStore = this.volumeStoreDao.findByStoreVolume(this.dataStore.getId(), this.getId());
+                    VolumeDataStoreVO volStore = volumeStoreDao.findByStoreVolume(dataStore.getId(), getId());
                     volStore.setInstallPath(dwdAnswer.getInstallPath());
                     volStore.setChecksum(dwdAnswer.getCheckSum());
-                    this.volumeStoreDao.update(volStore.getId(), volStore);
+                    volumeStoreDao.update(volStore.getId(), volStore);
                 } else if (answer instanceof CopyCmdAnswer) {
                     CopyCmdAnswer cpyAnswer = (CopyCmdAnswer)answer;
-                    VolumeDataStoreVO volStore = this.volumeStoreDao.findByStoreVolume(this.dataStore.getId(), this.getId());
+                    VolumeDataStoreVO volStore = volumeStoreDao.findByStoreVolume(dataStore.getId(), getId());
                     VolumeObjectTO newVol = (VolumeObjectTO)cpyAnswer.getNewData();
                     volStore.setInstallPath(newVol.getPath());
                     if (newVol.getSize() != null) {
                         volStore.setSize(newVol.getSize());
                     }
-                    this.volumeStoreDao.update(volStore.getId(), volStore);
+                    volumeStoreDao.update(volStore.getId(), volStore);
                 }
             }
         } catch (RuntimeException ex) {
@@ -559,12 +560,12 @@ public class VolumeObject implements VolumeInfo {
 
     @Override
     public void incRefCount() {
-        if (this.dataStore == null) {
+        if (dataStore == null) {
             return;
         }
 
-        if (this.dataStore.getRole() == DataStoreRole.Image || this.dataStore.getRole() == DataStoreRole.ImageCache) {
-            VolumeDataStoreVO store = volumeStoreDao.findByStoreVolume(this.dataStore.getId(), this.getId());
+        if (dataStore.getRole() == DataStoreRole.Image || dataStore.getRole() == DataStoreRole.ImageCache) {
+            VolumeDataStoreVO store = volumeStoreDao.findByStoreVolume(dataStore.getId(), getId());
             store.incrRefCnt();
             store.setLastUpdated(new Date());
             volumeStoreDao.update(store.getId(), store);
@@ -573,11 +574,11 @@ public class VolumeObject implements VolumeInfo {
 
     @Override
     public void decRefCount() {
-        if (this.dataStore == null) {
+        if (dataStore == null) {
             return;
         }
-        if (this.dataStore.getRole() == DataStoreRole.Image || this.dataStore.getRole() == DataStoreRole.ImageCache) {
-            VolumeDataStoreVO store = volumeStoreDao.findByStoreVolume(this.dataStore.getId(), this.getId());
+        if (dataStore.getRole() == DataStoreRole.Image || dataStore.getRole() == DataStoreRole.ImageCache) {
+            VolumeDataStoreVO store = volumeStoreDao.findByStoreVolume(dataStore.getId(), getId());
             store.decrRefCnt();
             store.setLastUpdated(new Date());
             volumeStoreDao.update(store.getId(), store);
@@ -586,11 +587,11 @@ public class VolumeObject implements VolumeInfo {
 
     @Override
     public Long getRefCount() {
-        if (this.dataStore == null) {
+        if (dataStore == null) {
             return null;
         }
-        if (this.dataStore.getRole() == DataStoreRole.Image || this.dataStore.getRole() == DataStoreRole.ImageCache) {
-            VolumeDataStoreVO store = volumeStoreDao.findByStoreVolume(this.dataStore.getId(), this.getId());
+        if (dataStore.getRole() == DataStoreRole.Image || dataStore.getRole() == DataStoreRole.ImageCache) {
+            VolumeDataStoreVO store = volumeStoreDao.findByStoreVolume(dataStore.getId(), getId());
             return store.getRefCnt();
         }
         return null;
@@ -599,45 +600,45 @@ public class VolumeObject implements VolumeInfo {
     @Override
     public void processEventOnly(ObjectInDataStoreStateMachine.Event event, Answer answer) {
         try {
-            if (this.dataStore.getRole() == DataStoreRole.Primary) {
+            if (dataStore.getRole() == DataStoreRole.Primary) {
                 if (answer instanceof CopyCmdAnswer) {
                     CopyCmdAnswer cpyAnswer = (CopyCmdAnswer)answer;
-                    VolumeVO vol = this.volumeDao.findById(this.getId());
+                    VolumeVO vol = volumeDao.findById(getId());
                     VolumeObjectTO newVol = (VolumeObjectTO)cpyAnswer.getNewData();
                     vol.setPath(newVol.getPath());
                     if (newVol.getSize() != null) {
                         vol.setSize(newVol.getSize());
                     }
-                    vol.setPoolId(this.getDataStore().getId());
+                    vol.setPoolId(getDataStore().getId());
                     volumeDao.update(vol.getId(), vol);
                 } else if (answer instanceof CreateObjectAnswer) {
                     CreateObjectAnswer createAnswer = (CreateObjectAnswer)answer;
                     VolumeObjectTO newVol = (VolumeObjectTO)createAnswer.getData();
-                    VolumeVO vol = this.volumeDao.findById(this.getId());
+                    VolumeVO vol = volumeDao.findById(getId());
                     vol.setPath(newVol.getPath());
                     if (newVol.getSize() != null) {
                         vol.setSize(newVol.getSize());
                     }
-                    vol.setPoolId(this.getDataStore().getId());
+                    vol.setPoolId(getDataStore().getId());
                     volumeDao.update(vol.getId(), vol);
                 }
             } else {
                 // image store or imageCache store
                 if (answer instanceof DownloadAnswer) {
                     DownloadAnswer dwdAnswer = (DownloadAnswer)answer;
-                    VolumeDataStoreVO volStore = this.volumeStoreDao.findByStoreVolume(this.dataStore.getId(), this.getId());
+                    VolumeDataStoreVO volStore = volumeStoreDao.findByStoreVolume(dataStore.getId(), getId());
                     volStore.setInstallPath(dwdAnswer.getInstallPath());
                     volStore.setChecksum(dwdAnswer.getCheckSum());
-                    this.volumeStoreDao.update(volStore.getId(), volStore);
+                    volumeStoreDao.update(volStore.getId(), volStore);
                 } else if (answer instanceof CopyCmdAnswer) {
                     CopyCmdAnswer cpyAnswer = (CopyCmdAnswer)answer;
-                    VolumeDataStoreVO volStore = this.volumeStoreDao.findByStoreVolume(this.dataStore.getId(), this.getId());
+                    VolumeDataStoreVO volStore = volumeStoreDao.findByStoreVolume(dataStore.getId(), getId());
                     VolumeObjectTO newVol = (VolumeObjectTO)cpyAnswer.getNewData();
                     volStore.setInstallPath(newVol.getPath());
                     if (newVol.getSize() != null) {
                         volStore.setSize(newVol.getSize());
                     }
-                    this.volumeStoreDao.update(volStore.getId(), volStore);
+                    volumeStoreDao.update(volStore.getId(), volStore);
                 }
             }
         } catch (RuntimeException ex) {
@@ -652,7 +653,7 @@ public class VolumeObject implements VolumeInfo {
 
     @Override
     public ImageFormat getFormat() {
-        return this.volumeVO.getFormat();
+        return volumeVO.getFormat();
     }
 
     @Override
@@ -665,6 +666,11 @@ public class VolumeObject implements VolumeInfo {
 
     @Override
     public Long getVmSnapshotChainSize() {
-        return this.volumeVO.getVmSnapshotChainSize();
+        return volumeVO.getVmSnapshotChainSize();
+    }
+
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.Volume;
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/server/src/com/cloud/api/query/vo/AffinityGroupJoinVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/vo/AffinityGroupJoinVO.java b/server/src/com/cloud/api/query/vo/AffinityGroupJoinVO.java
index 047d1b3..f659ed9 100644
--- a/server/src/com/cloud/api/query/vo/AffinityGroupJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/AffinityGroupJoinVO.java
@@ -24,6 +24,7 @@ import javax.persistence.Id;
 import javax.persistence.Table;
 
 import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.acl.IAMEntityType;
 
 import com.cloud.vm.VirtualMachine;
 
@@ -192,4 +193,9 @@ public class AffinityGroupJoinVO extends BaseViewVO implements ControlledViewEnt
         return aclType;
     }
 
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.AffinityGroup;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/server/src/com/cloud/api/query/vo/DomainRouterJoinVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/vo/DomainRouterJoinVO.java b/server/src/com/cloud/api/query/vo/DomainRouterJoinVO.java
index 72c7222..c0c07eb 100644
--- a/server/src/com/cloud/api/query/vo/DomainRouterJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/DomainRouterJoinVO.java
@@ -26,6 +26,8 @@ import javax.persistence.Enumerated;
 import javax.persistence.Id;
 import javax.persistence.Table;
 
+import org.apache.cloudstack.acl.IAMEntityType;
+
 import com.cloud.network.Network.GuestType;
 import com.cloud.network.Networks.TrafficType;
 import com.cloud.network.router.VirtualRouter;
@@ -510,4 +512,10 @@ public class DomainRouterJoinVO extends BaseViewVO implements ControlledViewEnti
     public VirtualRouter.Role getRole() {
         return role;
     }
+
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.VirtualMachine;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/server/src/com/cloud/api/query/vo/EventJoinVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/vo/EventJoinVO.java b/server/src/com/cloud/api/query/vo/EventJoinVO.java
index 6571269..696221d 100644
--- a/server/src/com/cloud/api/query/vo/EventJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/EventJoinVO.java
@@ -25,6 +25,8 @@ import javax.persistence.Enumerated;
 import javax.persistence.Id;
 import javax.persistence.Table;
 
+import org.apache.cloudstack.acl.IAMEntityType;
+
 import com.cloud.event.Event.State;
 import com.cloud.utils.db.GenericDao;
 
@@ -223,4 +225,10 @@ public class EventJoinVO extends BaseViewVO implements ControlledViewEntity {
     public boolean getDisplayEvent() {
         return displayEvent;
     }
+
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.Event;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/server/src/com/cloud/api/query/vo/InstanceGroupJoinVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/vo/InstanceGroupJoinVO.java b/server/src/com/cloud/api/query/vo/InstanceGroupJoinVO.java
index cd1ba12..38b7229 100644
--- a/server/src/com/cloud/api/query/vo/InstanceGroupJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/InstanceGroupJoinVO.java
@@ -23,6 +23,8 @@ import javax.persistence.Entity;
 import javax.persistence.Id;
 import javax.persistence.Table;
 
+import org.apache.cloudstack.acl.IAMEntityType;
+
 import com.cloud.utils.db.GenericDao;
 
 @Entity
@@ -156,4 +158,10 @@ public class InstanceGroupJoinVO extends BaseViewVO implements ControlledViewEnt
     public Date getCreated() {
         return created;
     }
+
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.InstanceGroup;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/server/src/com/cloud/api/query/vo/ProjectInvitationJoinVO.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/query/vo/ProjectInvitationJoinVO.java b/server/src/com/cloud/api/query/vo/ProjectInvitationJoinVO.java
index 34f3929..7ff1779 100644
--- a/server/src/com/cloud/api/query/vo/ProjectInvitationJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/ProjectInvitationJoinVO.java
@@ -25,6 +25,8 @@ import javax.persistence.Enumerated;
 import javax.persistence.Id;
 import javax.persistence.Table;
 
+import org.apache.cloudstack.acl.IAMEntityType;
+
 import com.cloud.projects.ProjectInvitation.State;
 import com.cloud.utils.db.GenericDao;
 
@@ -160,4 +162,10 @@ public class ProjectInvitationJoinVO extends BaseViewVO implements ControlledVie
     public String getDomainPath() {
         return domainPath;
     }
+
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.ProjectInvitation;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/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 72f9b77..1dca46b 100644
--- a/server/src/com/cloud/api/query/vo/ResourceTagJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/ResourceTagJoinVO.java
@@ -23,6 +23,8 @@ import javax.persistence.Enumerated;
 import javax.persistence.Id;
 import javax.persistence.Table;
 
+import org.apache.cloudstack.acl.IAMEntityType;
+
 import com.cloud.server.ResourceTag.ResourceObjectType;
 
 @Entity
@@ -178,4 +180,10 @@ public class ResourceTagJoinVO extends BaseViewVO implements ControlledViewEntit
     public String getCustomer() {
         return customer;
     }
+
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.ResourceTag;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/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 d51d111..cf2df98 100644
--- a/server/src/com/cloud/api/query/vo/SecurityGroupJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/SecurityGroupJoinVO.java
@@ -23,6 +23,8 @@ import javax.persistence.Enumerated;
 import javax.persistence.Id;
 import javax.persistence.Table;
 
+import org.apache.cloudstack.acl.IAMEntityType;
+
 import com.cloud.network.security.SecurityRule.SecurityRuleType;
 import com.cloud.server.ResourceTag.ResourceObjectType;
 
@@ -302,4 +304,10 @@ public class SecurityGroupJoinVO extends BaseViewVO implements ControlledViewEnt
     public String getTagCustomer() {
         return tagCustomer;
     }
+
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.SecurityGroup;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/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 c096279..21c0a2e 100644
--- a/server/src/com/cloud/api/query/vo/TemplateJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/TemplateJoinVO.java
@@ -27,7 +27,7 @@ import javax.persistence.Table;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 
-import com.cloud.template.VirtualMachineTemplate.State;
+import org.apache.cloudstack.acl.IAMEntityType;
 import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine;
 
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
@@ -35,6 +35,7 @@ import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.storage.ScopeType;
 import com.cloud.storage.Storage;
 import com.cloud.storage.VMTemplateStorageResourceAssoc.Status;
+import com.cloud.template.VirtualMachineTemplate.State;
 import com.cloud.utils.db.GenericDao;
 
 @Entity
@@ -539,4 +540,10 @@ public class TemplateJoinVO extends BaseViewVO implements ControlledViewEntity {
     }
 
     public State getTemplateState() { return templateState; }
+
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.VirtualMachineTemplate;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/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 2df49ec..302b4ec 100644
--- a/server/src/com/cloud/api/query/vo/UserVmJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/UserVmJoinVO.java
@@ -28,6 +28,8 @@ import javax.persistence.Id;
 import javax.persistence.Table;
 import javax.persistence.Transient;
 
+import org.apache.cloudstack.acl.IAMEntityType;
+
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.network.Network.GuestType;
 import com.cloud.network.Networks.TrafficType;
@@ -909,4 +911,10 @@ public class UserVmJoinVO extends BaseViewVO implements ControlledViewEntity {
     public String getDetailValue() {
         return detailValue;
     }
+
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.VirtualMachine;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/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 1d1b37d..ce26c1f 100644
--- a/server/src/com/cloud/api/query/vo/VolumeJoinVO.java
+++ b/server/src/com/cloud/api/query/vo/VolumeJoinVO.java
@@ -27,6 +27,8 @@ import javax.persistence.Table;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 
+import org.apache.cloudstack.acl.IAMEntityType;
+
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.server.ResourceTag.ResourceObjectType;
 import com.cloud.storage.Storage;
@@ -573,4 +575,10 @@ public class VolumeJoinVO extends BaseViewVO implements ControlledViewEntity {
     public String getChainInfo() {
         return chainInfo;
     }
+
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.Volume;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/server/src/com/cloud/api/response/SecurityGroupResultObject.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/response/SecurityGroupResultObject.java b/server/src/com/cloud/api/response/SecurityGroupResultObject.java
index 9697495..66ba487 100644
--- a/server/src/com/cloud/api/response/SecurityGroupResultObject.java
+++ b/server/src/com/cloud/api/response/SecurityGroupResultObject.java
@@ -22,6 +22,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.cloudstack.acl.ControlledEntity;
+import org.apache.cloudstack.acl.IAMEntityType;
 import org.apache.cloudstack.api.InternalIdentity;
 
 import com.cloud.api.ApiDBUtils;
@@ -63,7 +64,7 @@ public class SecurityGroupResultObject implements ControlledEntity, InternalIden
         this.domainId = domainId;
         this.accountId = accountId;
         this.accountName = accountName;
-        this.securityGroupRules = ingressRules;
+        securityGroupRules = ingressRules;
     }
 
     @Override
@@ -209,4 +210,9 @@ public class SecurityGroupResultObject implements ControlledEntity, InternalIden
         }
         return resultObjects;
     }
+
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.SecurityGroup;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/d0ae4d9a/server/src/com/cloud/network/vpc/PrivateGatewayProfile.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/vpc/PrivateGatewayProfile.java b/server/src/com/cloud/network/vpc/PrivateGatewayProfile.java
index e183cdb..b912e22 100644
--- a/server/src/com/cloud/network/vpc/PrivateGatewayProfile.java
+++ b/server/src/com/cloud/network/vpc/PrivateGatewayProfile.java
@@ -16,6 +16,8 @@
 // under the License.
 package com.cloud.network.vpc;
 
+import org.apache.cloudstack.acl.IAMEntityType;
+
 public class PrivateGatewayProfile implements PrivateGateway {
     VpcGateway vpcGateway;
     long physicalNetworkId;
@@ -110,4 +112,8 @@ public class PrivateGatewayProfile implements PrivateGateway {
         return vpcGateway.getNetworkACLId();
     }
 
+    @Override
+    public IAMEntityType getEntityType() {
+        return IAMEntityType.VpcGateway;
+    }
 }


Mime
View raw message