api: Fix BaseList Cmd classes to use UUID CommandType and entityType 
appropriately

- Get rid of IdentityMapper
- Use entityType which is an array of Response.class
- Use UUID CommandType for params which will receive UUID string from over the
  wire requests

Signed-off-by: Rohit Yadav <[email protected]>


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

Branch: refs/heads/api_refactoring
Commit: dc33a8d1458fd767ce7da2f38ff35f4be74caa3a
Parents: b008f31
Author: Rohit Yadav <[email protected]>
Authored: Tue Dec 18 04:20:50 2012 -0800
Committer: Rohit Yadav <[email protected]>
Committed: Tue Dec 18 04:20:50 2012 -0800

----------------------------------------------------------------------
 .../cloudstack/api/BaseListDomainResourcesCmd.java |    7 ++++---
 .../api/BaseListProjectAndAccountResourcesCmd.java |    6 ++++--
 2 files changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/dc33a8d1/api/src/org/apache/cloudstack/api/BaseListDomainResourcesCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/BaseListDomainResourcesCmd.java 
b/api/src/org/apache/cloudstack/api/BaseListDomainResourcesCmd.java
index 709d107..6e50a15 100644
--- a/api/src/org/apache/cloudstack/api/BaseListDomainResourcesCmd.java
+++ b/api/src/org/apache/cloudstack/api/BaseListDomainResourcesCmd.java
@@ -16,15 +16,16 @@
 // under the License.
 package org.apache.cloudstack.api;
 
+import org.apache.cloudstack.api.response.DomainResponse;
+
 public abstract class BaseListDomainResourcesCmd extends BaseListCmd {
 
     @Parameter(name = ApiConstants.LIST_ALL, type = CommandType.BOOLEAN, 
description = "If set to false, " +
             "list only resources belonging to the command's caller; if set to 
true - list resources that the caller is authorized to see. Default value is 
false")
     private Boolean listAll;
 
-    @IdentityMapper(entityTableName = "domain")
-    @Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.LONG, 
description = "list only resources" +
-            " belonging to the domain specified")
+    @Parameter(name=ApiConstants.DOMAIN_ID, type=CommandType.UUID, 
entityType=DomainResponse.class,
+            description="list only resources belonging to the domain 
specified")
     private Long domainId;
 
     @Parameter(name = ApiConstants.IS_RECURSIVE, type = CommandType.BOOLEAN, 
description = "defaults to false," +

http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/dc33a8d1/api/src/org/apache/cloudstack/api/BaseListProjectAndAccountResourcesCmd.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/BaseListProjectAndAccountResourcesCmd.java 
b/api/src/org/apache/cloudstack/api/BaseListProjectAndAccountResourcesCmd.java
index d5232bc..836527f 100644
--- 
a/api/src/org/apache/cloudstack/api/BaseListProjectAndAccountResourcesCmd.java
+++ 
b/api/src/org/apache/cloudstack/api/BaseListProjectAndAccountResourcesCmd.java
@@ -16,10 +16,12 @@
 // under the License.
 package org.apache.cloudstack.api;
 
+import org.apache.cloudstack.api.response.ProjectResponse;
+
 public abstract class BaseListProjectAndAccountResourcesCmd extends 
BaseListAccountResourcesCmd {
 
-    @IdentityMapper(entityTableName = "projects")
-    @Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.LONG, 
description = "list objects by project")
+    @Parameter(name=ApiConstants.PROJECT_ID, type=CommandType.UUID, 
entityType=ProjectResponse.class,
+            description="list objects by project")
     private Long projectId;
 
     public Long getProjectId() {

Reply via email to