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 <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2012-12-18 04:20:50 -08:00
parent b008f31fd5
commit dc33a8d145
2 changed files with 8 additions and 5 deletions

View File

@ -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," +

View File

@ -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() {