Search in sources :

Example 1 with ListDomainsCmdByAdmin

use of org.apache.cloudstack.api.command.admin.domain.ListDomainsCmdByAdmin in project cloudstack by apache.

the class QueryManagerImpl method searchForDomains.

@Override
public ListResponse<DomainResponse> searchForDomains(ListDomainsCmd cmd) {
    Pair<List<DomainJoinVO>, Integer> result = searchForDomainsInternal(cmd);
    ListResponse<DomainResponse> response = new ListResponse<DomainResponse>();
    ResponseView respView = ResponseView.Restricted;
    if (cmd instanceof ListDomainsCmdByAdmin) {
        respView = ResponseView.Full;
    }
    List<DomainResponse> domainResponses = ViewResponseHelper.createDomainResponse(respView, cmd.getDetails(), result.first());
    response.setResponses(domainResponses, result.second());
    return response;
}
Also used : ResponseView(org.apache.cloudstack.api.ResponseObject.ResponseView) ListResponse(org.apache.cloudstack.api.response.ListResponse) ListDomainsCmdByAdmin(org.apache.cloudstack.api.command.admin.domain.ListDomainsCmdByAdmin) DomainResponse(org.apache.cloudstack.api.response.DomainResponse) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 ResponseView (org.apache.cloudstack.api.ResponseObject.ResponseView)1 ListDomainsCmdByAdmin (org.apache.cloudstack.api.command.admin.domain.ListDomainsCmdByAdmin)1 DomainResponse (org.apache.cloudstack.api.response.DomainResponse)1 ListResponse (org.apache.cloudstack.api.response.ListResponse)1