@Override
public CapSummaryDTO loadCapSummary() {
CapabilitiesService service = CapabilitiesServiceFactory.getCapabilitiesService();
CapSummaryDTO result = new CapSummaryDTO();
for (Capability cap : caps) {
CapabilityStatus status = service.getStatus(cap).getStatus();
switch(status) {
case ENABLED:
result.setStatus(cap.getPackageName(), cap.getName(), Status.ENABLED);
break;
case SCHEDULED_MAINTENANCE:
result.setStatus(cap.getPackageName(), cap.getName(), Status.SCHEDULED_MAINTENANCE);
break;
case DISABLED:
result.setStatus(cap.getPackageName(), cap.getName(), Status.DISABLED);
break;
case UNKNOWN:
result.setStatus(cap.getPackageName(), cap.getName(), Status.UNKNOWN);
break;
}
}
return result;