Search in sources :

Example 1 with ListDomainsCmdByAdmin

use of com.cloud.api.command.admin.domain.ListDomainsCmdByAdmin in project cosmic by MissionCriticalCloud.

the class QueryManagerImpl method searchForDomains.

@Override
public ListResponse<DomainResponse> searchForDomains(final ListDomainsCmd cmd) {
    final Pair<List<DomainJoinVO>, Integer> result = searchForDomainsInternal(cmd);
    final ListResponse<DomainResponse> response = new ListResponse<>();
    ResponseView respView = ResponseView.Restricted;
    if (cmd instanceof ListDomainsCmdByAdmin) {
        respView = ResponseView.Full;
    }
    final List<DomainResponse> domainResponses = ViewResponseHelper.createDomainResponse(respView, result.first().toArray(new DomainJoinVO[result.first().size()]));
    response.setResponses(domainResponses, result.second());
    return response;
}
Also used : ResponseView(com.cloud.api.ResponseObject.ResponseView) ListResponse(com.cloud.api.response.ListResponse) ListDomainsCmdByAdmin(com.cloud.api.command.admin.domain.ListDomainsCmdByAdmin) DomainResponse(com.cloud.api.response.DomainResponse) ArrayList(java.util.ArrayList) List(java.util.List) DomainJoinVO(com.cloud.api.query.vo.DomainJoinVO)

Aggregations

ResponseView (com.cloud.api.ResponseObject.ResponseView)1 ListDomainsCmdByAdmin (com.cloud.api.command.admin.domain.ListDomainsCmdByAdmin)1 DomainJoinVO (com.cloud.api.query.vo.DomainJoinVO)1 DomainResponse (com.cloud.api.response.DomainResponse)1 ListResponse (com.cloud.api.response.ListResponse)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1