Search in sources :

Example 1 with ProjectAccountResponse

use of com.cloud.api.response.ProjectAccountResponse in project CloudStack-archive by CloudStack-extras.

the class ListProjectAccountsCmd method execute.

/////////////////////////////////////////////////////
/////////////// API Implementation///////////////////
/////////////////////////////////////////////////////
@Override
public void execute() {
    List<? extends ProjectAccount> projectAccounts = _projectService.listProjectAccounts(projectId, accountName, role, this.getStartIndex(), this.getPageSizeVal());
    ListResponse<ProjectAccountResponse> response = new ListResponse<ProjectAccountResponse>();
    List<ProjectAccountResponse> projectResponses = new ArrayList<ProjectAccountResponse>();
    for (ProjectAccount projectAccount : projectAccounts) {
        ProjectAccountResponse projectAccountResponse = _responseGenerator.createProjectAccountResponse(projectAccount);
        projectResponses.add(projectAccountResponse);
    }
    response.setResponses(projectResponses);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
}
Also used : ProjectAccount(com.cloud.projects.ProjectAccount) ListResponse(com.cloud.api.response.ListResponse) ArrayList(java.util.ArrayList) ProjectAccountResponse(com.cloud.api.response.ProjectAccountResponse)

Aggregations

ListResponse (com.cloud.api.response.ListResponse)1 ProjectAccountResponse (com.cloud.api.response.ProjectAccountResponse)1 ProjectAccount (com.cloud.projects.ProjectAccount)1 ArrayList (java.util.ArrayList)1