use of com.vmware.flowgate.common.model.PowerIqSummary in project flowgate by vmware.
the class SummaryService method getPowerIQSummary.
public PowerIqSummary getPowerIQSummary(FacilitySoftwareConfig powerIQ) {
PowerIqSummary powerIQSummary = new PowerIqSummary();
powerIQSummary.setName(powerIQ.getName());
powerIQSummary.setUrl(powerIQ.getServerURL());
List<HashMap<String, Object>> results = summaryRepository.countAssetGroupByTypeAndSource("%" + powerIQ.getId() + "%");
if (!results.isEmpty()) {
for (HashMap<String, Object> map : results) {
if ((String) map.get("category") == null) {
continue;
}
switch((String) map.get("category")) {
case "PDU":
powerIQSummary.setPduNum((Integer) map.get("count"));
break;
case "Sensors":
powerIQSummary.setSensorNum((Integer) map.get("count"));
break;
default:
break;
}
}
}
return powerIQSummary;
}
use of com.vmware.flowgate.common.model.PowerIqSummary in project flowgate by vmware.
the class SummaryService method getPowerIQSummaryList.
public List<PowerIqSummary> getPowerIQSummaryList() {
List<PowerIqSummary> powerIqSummarys = new ArrayList<PowerIqSummary>();
List<FacilitySoftwareConfig> facility = facilityRepo.findAllByType(com.vmware.flowgate.common.model.FacilitySoftwareConfig.SoftwareType.PowerIQ.name());
for (FacilitySoftwareConfig powerIq : facility) {
PowerIqSummary powerIQSummary = getPowerIQSummary(powerIq);
powerIqSummarys.add(powerIQSummary);
}
return powerIqSummarys;
}
Aggregations