You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2013/11/08 00:19:28 UTC

git commit: updated refs/heads/master to dc3d279

Updated Branches:
  refs/heads/master c233492bf -> dc3d27927


CLOUDSTACK-4833:[Automation][BVT] Template and ISO test cases failing
from BVT suite, during LIST api call.


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

Branch: refs/heads/master
Commit: dc3d279272d8499fc590e4fbe5b5d115ef704c5d
Parents: c233492
Author: Min Chen <mi...@citrix.com>
Authored: Thu Nov 7 15:12:43 2013 -0800
Committer: Min Chen <mi...@citrix.com>
Committed: Thu Nov 7 15:19:19 2013 -0800

----------------------------------------------------------------------
 framework/db/src/com/cloud/dao/EntityManagerImpl.java | 3 ++-
 server/src/com/cloud/api/ApiDispatcher.java           | 6 +++---
 utils/src/com/cloud/utils/db/EntityManager.java       | 9 +++++++++
 3 files changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc3d2792/framework/db/src/com/cloud/dao/EntityManagerImpl.java
----------------------------------------------------------------------
diff --git a/framework/db/src/com/cloud/dao/EntityManagerImpl.java b/framework/db/src/com/cloud/dao/EntityManagerImpl.java
index bb493c0..74be13c 100644
--- a/framework/db/src/com/cloud/dao/EntityManagerImpl.java
+++ b/framework/db/src/com/cloud/dao/EntityManagerImpl.java
@@ -57,6 +57,7 @@ public class EntityManagerImpl extends ManagerBase implements EntityManager {
         return dao.findByUuid(uuid);
     }
 
+    @Override
     public <T> T findByUuidIncludingRemoved(Class<T> entityType, String uuid) {
         // Finds and returns a unique VO using uuid, null if entity not found in db
         GenericDao<? extends T, String> dao = (GenericDao<? extends T, String>)GenericDaoBase.getDao(entityType);
@@ -94,7 +95,7 @@ public class EntityManagerImpl extends ManagerBase implements EntityManager {
         _name = name;
         
         return true;
-    } 
+    }
 
     @Override
     public boolean start() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc3d2792/server/src/com/cloud/api/ApiDispatcher.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiDispatcher.java b/server/src/com/cloud/api/ApiDispatcher.java
index 9672ef1..44fb676 100755
--- a/server/src/com/cloud/api/ApiDispatcher.java
+++ b/server/src/com/cloud/api/ApiDispatcher.java
@@ -33,6 +33,8 @@ import java.util.regex.Matcher;
 import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 
+import org.apache.log4j.Logger;
+
 import org.apache.cloudstack.acl.ControlledEntity;
 import org.apache.cloudstack.acl.InfrastructureEntity;
 import org.apache.cloudstack.acl.RoleType;
@@ -49,7 +51,6 @@ import org.apache.cloudstack.api.EntityReference;
 import org.apache.cloudstack.api.InternalIdentity;
 import org.apache.cloudstack.api.Parameter;
 import org.apache.cloudstack.api.ServerApiException;
-import org.apache.cloudstack.api.Validate;
 import org.apache.cloudstack.api.command.admin.resource.ArchiveAlertsCmd;
 import org.apache.cloudstack.api.command.admin.resource.DeleteAlertsCmd;
 import org.apache.cloudstack.api.command.user.event.ArchiveEventsCmd;
@@ -58,7 +59,6 @@ import org.apache.cloudstack.api.command.user.event.ListEventsCmd;
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.framework.jobs.AsyncJob;
 import org.apache.cloudstack.framework.jobs.AsyncJobManager;
-import org.apache.log4j.Logger;
 
 import com.cloud.exception.InvalidParameterValueException;
 import com.cloud.user.Account;
@@ -369,7 +369,7 @@ public class ApiDispatcher {
         for (Class<?> entity : entities) {
             // For backward compatibility, we search within removed entities and let service layer deal
             // with removed ones, return empty response or error
-            Object objVO = s_instance._entityMgr.findByUuid(entity, uuid);
+            Object objVO = s_instance._entityMgr.findByUuidIncludingRemoved(entity, uuid);
             if (objVO == null) {
                 continue;
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc3d2792/utils/src/com/cloud/utils/db/EntityManager.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/db/EntityManager.java b/utils/src/com/cloud/utils/db/EntityManager.java
index 49f4f72..d613d7d 100644
--- a/utils/src/com/cloud/utils/db/EntityManager.java
+++ b/utils/src/com/cloud/utils/db/EntityManager.java
@@ -44,6 +44,15 @@ public interface EntityManager {
     public <T> T findByUuid(Class<T> entityType, String uuid);
 
     /**
+     * Finds a unique entity by uuid string, including those removed entries
+     * @param <T> entity class
+     * @param entityType type of entity you're looking for.
+     * @param uuid the unique id
+     * @return T if found, null if not.
+     */
+    public <T> T findByUuidIncludingRemoved(Class<T> entityType, String uuid);
+
+    /**
      * Finds an entity by external id which is always String
      * @param <T> entity class
      * @param entityType type of entity you're looking for.