public void index(Map<String, Object> context) { final String service = StringUtils.trimToNull((String) context.get("service")); String address = (String) context.get("address"); address = Tool.getIP(address); List<Weight> weights; if (service != null && service.length() > 0) { weights = OverrideUtils.overridesToWeights(overrideService.findByService(service)); } else if (address != null && address.length() > 0) { weights = OverrideUtils.overridesToWeights(overrideService.findByAddress(address)); } else { weights = OverrideUtils.overridesToWeights(overrideService.findAll()); } context.put("weights", weights); }
public List<Owner> findAll() { List<Provider> pList = providerService.findAll(); List<Override> cList = overrideService.findAll(); return toOverrideLiset(pList, cList); }