use of com.vmware.flowgate.common.model.NlyteSummary in project flowgate by vmware.
the class SummaryService method getNlyteSummary.
public NlyteSummary getNlyteSummary(FacilitySoftwareConfig nlyte) {
NlyteSummary nlyteSummary = new NlyteSummary();
nlyteSummary.setName(nlyte.getName());
nlyteSummary.setUrl(nlyte.getServerURL());
List<HashMap<String, Object>> results = summaryRepository.countAssetGroupByTypeAndSource("%" + nlyte.getId() + "%");
if (!results.isEmpty()) {
for (HashMap<String, Object> map : results) {
if ((String) map.get("category") == null) {
continue;
}
switch((String) map.get("category")) {
case "Server":
nlyteSummary.setServerNum((Integer) map.get("count"));
break;
case "PDU":
nlyteSummary.setPduNum((Integer) map.get("count"));
break;
case "Sensors":
nlyteSummary.setSensorNum((Integer) map.get("count"));
break;
case "Cabinet":
nlyteSummary.setCabinetNum((Integer) map.get("count"));
break;
case "Networks":
nlyteSummary.setSwitchNum((Integer) map.get("count"));
break;
default:
break;
}
}
}
return nlyteSummary;
}
use of com.vmware.flowgate.common.model.NlyteSummary in project flowgate by vmware.
the class SummaryService method getNlyteSummaryList.
public List<NlyteSummary> getNlyteSummaryList() {
List<NlyteSummary> nlyteSummarys = new ArrayList<>();
List<FacilitySoftwareConfig> facility = facilityRepo.findAllByType(com.vmware.flowgate.common.model.FacilitySoftwareConfig.SoftwareType.Nlyte.name());
for (FacilitySoftwareConfig nlyte : facility) {
NlyteSummary nlyteSummary = getNlyteSummary(nlyte);
nlyteSummarys.add(nlyteSummary);
}
return nlyteSummarys;
}
Aggregations