Host addStatistics(Host model, VDS entity, UriInfo ui, HttpHeaders httpHeaders) {
   if (DetailHelper.include(httpHeaders, "statistics")) {
     model.setStatistics(new Statistics());
     HostStatisticalQuery query = new HostStatisticalQuery(newModel(model.getId()));
     List<Statistic> statistics = query.getStatistics(entity);
     for (Statistic statistic : statistics) {
       LinkHelper.addLinks(ui, statistic, query.getParentType());
     }
     model.getStatistics().getStatistics().addAll(statistics);
   }
   return model;
 }
예제 #2
0
 @Override
 protected VM deprecatedPopulate(
     VM model, org.ovirt.engine.core.common.businessentities.VM entity) {
   Set<String> details = DetailHelper.getDetails(httpHeaders, uriInfo);
   parent.addInlineDetails(details, model);
   if (details.contains("statistics")) {
     addStatistics(model, entity, uriInfo);
   }
   parent.setPayload(model);
   parent.setBallooning(model);
   parent.setCertificateInfo(model);
   return model;
 }
 Disk addStatistics(
     Disk model,
     org.ovirt.engine.core.common.businessentities.Disk entity,
     UriInfo ui,
     HttpHeaders httpHeaders) {
   if (DetailHelper.include(httpHeaders, "statistics")) {
     model.setStatistics(new Statistics());
     DiskStatisticalQuery query = new DiskStatisticalQuery(newModel(model.getId()));
     List<Statistic> statistics = query.getStatistics(entity);
     for (Statistic statistic : statistics) {
       LinkHelper.addLinks(ui, statistic, query.getParentType());
     }
     model.getStatistics().getStatistics().addAll(statistics);
   }
   return model;
 }