Search in sources :

Example 1 with ListAccountsCmdByAdmin

use of org.apache.cloudstack.api.command.admin.account.ListAccountsCmdByAdmin in project cloudstack by apache.

the class QueryManagerImpl method searchForAccounts.

@Override
public ListResponse<AccountResponse> searchForAccounts(ListAccountsCmd cmd) {
    Pair<List<AccountJoinVO>, Integer> result = searchForAccountsInternal(cmd);
    ListResponse<AccountResponse> response = new ListResponse<AccountResponse>();
    ResponseView respView = ResponseView.Restricted;
    if (cmd instanceof ListAccountsCmdByAdmin) {
        respView = ResponseView.Full;
    }
    List<AccountResponse> accountResponses = ViewResponseHelper.createAccountResponse(respView, cmd.getDetails(), result.first().toArray(new AccountJoinVO[result.first().size()]));
    response.setResponses(accountResponses, result.second());
    return response;
}
Also used : ResponseView(org.apache.cloudstack.api.ResponseObject.ResponseView) ListResponse(org.apache.cloudstack.api.response.ListResponse) ArrayList(java.util.ArrayList) List(java.util.List) ProjectAccountResponse(org.apache.cloudstack.api.response.ProjectAccountResponse) AccountResponse(org.apache.cloudstack.api.response.AccountResponse) ListAccountsCmdByAdmin(org.apache.cloudstack.api.command.admin.account.ListAccountsCmdByAdmin) ProjectAccountJoinVO(com.cloud.api.query.vo.ProjectAccountJoinVO) UserAccountJoinVO(com.cloud.api.query.vo.UserAccountJoinVO) AccountJoinVO(com.cloud.api.query.vo.AccountJoinVO)

Aggregations

AccountJoinVO (com.cloud.api.query.vo.AccountJoinVO)1 ProjectAccountJoinVO (com.cloud.api.query.vo.ProjectAccountJoinVO)1 UserAccountJoinVO (com.cloud.api.query.vo.UserAccountJoinVO)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 ResponseView (org.apache.cloudstack.api.ResponseObject.ResponseView)1 ListAccountsCmdByAdmin (org.apache.cloudstack.api.command.admin.account.ListAccountsCmdByAdmin)1 AccountResponse (org.apache.cloudstack.api.response.AccountResponse)1 ListResponse (org.apache.cloudstack.api.response.ListResponse)1 ProjectAccountResponse (org.apache.cloudstack.api.response.ProjectAccountResponse)1