for (Provider p : providers) {
serviceUrls.put(p.getUrl(), p.getParameters());
}
}
if(StringUtils.isNotEmpty(consumerid)) {
Consumer consumer = consumerService.findConsumer(Long.valueOf(consumerid));
if(null == consumer) {
context.put("message", getMessage("NoSuchRecord"));
}
Map<String, String> result = RouteUtils.previewRoute(consumer.getService(), consumer.getAddress(), consumer.getParameters(), serviceUrls,
route, null, null);
context.put("route", route);
context.put("consumer", consumer);
context.put("result", result);
}
else {
String address = (String)context.get("address");
String service = (String)context.get("service");
Map<String, String> result = RouteUtils.previewRoute(service, address, null, serviceUrls,
route, null, null);
context.put("route", route);
Consumer consumer = new Consumer();
consumer.setService(service);
consumer.setAddress(address);
context.put("consumer", consumer);
context.put("result", result);
}
}