Search in sources :

Example 1 with PowerIqSummary

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;
}
Also used : PowerIqSummary(com.vmware.flowgate.common.model.PowerIqSummary) HashMap(java.util.HashMap)

Example 2 with 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;
}
Also used : PowerIqSummary(com.vmware.flowgate.common.model.PowerIqSummary) ArrayList(java.util.ArrayList) FacilitySoftwareConfig(com.vmware.flowgate.common.model.FacilitySoftwareConfig)

Aggregations

PowerIqSummary (com.vmware.flowgate.common.model.PowerIqSummary)2 FacilitySoftwareConfig (com.vmware.flowgate.common.model.FacilitySoftwareConfig)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1