use of com.cloud.api.command.admin.template.ListTemplatesCmdByAdmin in project cosmic by MissionCriticalCloud.
the class QueryManagerImpl method listTemplates.
@Override
public ListResponse<TemplateResponse> listTemplates(final ListTemplatesCmd cmd) {
final Pair<List<TemplateJoinVO>, Integer> result = searchForTemplatesInternal(cmd);
final ListResponse<TemplateResponse> response = new ListResponse<>();
ResponseView respView = ResponseView.Restricted;
if (cmd instanceof ListTemplatesCmdByAdmin) {
respView = ResponseView.Full;
}
final List<TemplateResponse> templateResponses = ViewResponseHelper.createTemplateResponse(respView, result.first().toArray(new TemplateJoinVO[result.first().size()]));
response.setResponses(templateResponses, result.second());
return response;
}
Aggregations