use of com.cloud.api.ResponseObject.ResponseView 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;
}
use of com.cloud.api.ResponseObject.ResponseView in project cosmic by MissionCriticalCloud.
the class QueryManagerImpl method listDataCenters.
@Override
public ListResponse<ZoneResponse> listDataCenters(final ListZonesCmd cmd) {
final Pair<List<DataCenterJoinVO>, Integer> result = listDataCentersInternal(cmd);
final ListResponse<ZoneResponse> response = new ListResponse<>();
ResponseView respView = ResponseView.Restricted;
if (cmd instanceof ListZonesCmdByAdmin) {
respView = ResponseView.Full;
}
final List<ZoneResponse> dcResponses = ViewResponseHelper.createDataCenterResponse(respView, cmd.getShowCapacities(), result.first().toArray(new DataCenterJoinVO[result.first().size()]));
response.setResponses(dcResponses, result.second());
return response;
}
use of com.cloud.api.ResponseObject.ResponseView 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;
}
use of com.cloud.api.ResponseObject.ResponseView in project cosmic by MissionCriticalCloud.
the class QueryManagerImpl method searchForUserVMs.
@Override
public ListResponse<UserVmResponse> searchForUserVMs(final ListVMsCmd cmd) {
final Pair<List<UserVmJoinVO>, Integer> result = searchForUserVMsInternal(cmd);
final ListResponse<UserVmResponse> response = new ListResponse<>();
ResponseView respView = ResponseView.Restricted;
if (cmd instanceof ListVMsCmdByAdmin) {
respView = ResponseView.Full;
}
final List<UserVmResponse> vmResponses = ViewResponseHelper.createUserVmResponse(respView, "virtualmachine", cmd.getDetails(), result.first().toArray(new UserVmJoinVO[result.first().size()]));
response.setResponses(vmResponses, result.second());
return response;
}
use of com.cloud.api.ResponseObject.ResponseView 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