Search in sources :

Example 1 with ListIsosCmdByAdmin

use of com.cloud.api.command.admin.iso.ListIsosCmdByAdmin in project cosmic by MissionCriticalCloud.

the class QueryManagerImpl method listIsos.

@Override
public ListResponse<TemplateResponse> listIsos(final ListIsosCmd cmd) {
    final Pair<List<TemplateJoinVO>, Integer> result = searchForIsosInternal(cmd);
    final ListResponse<TemplateResponse> response = new ListResponse<>();
    ResponseView respView = ResponseView.Restricted;
    if (cmd instanceof ListIsosCmdByAdmin) {
        respView = ResponseView.Full;
    }
    final List<TemplateResponse> templateResponses = ViewResponseHelper.createIsoResponse(respView, result.first().toArray(new TemplateJoinVO[result.first().size()]));
    response.setResponses(templateResponses, result.second());
    return response;
}
Also used : ResponseView(com.cloud.api.ResponseObject.ResponseView) ListResponse(com.cloud.api.response.ListResponse) TemplateJoinVO(com.cloud.api.query.vo.TemplateJoinVO) ArrayList(java.util.ArrayList) List(java.util.List) TemplateResponse(com.cloud.api.response.TemplateResponse) ListIsosCmdByAdmin(com.cloud.api.command.admin.iso.ListIsosCmdByAdmin)

Aggregations

ResponseView (com.cloud.api.ResponseObject.ResponseView)1 ListIsosCmdByAdmin (com.cloud.api.command.admin.iso.ListIsosCmdByAdmin)1 TemplateJoinVO (com.cloud.api.query.vo.TemplateJoinVO)1 ListResponse (com.cloud.api.response.ListResponse)1 TemplateResponse (com.cloud.api.response.TemplateResponse)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1