log.info("The bindingDetail is truncated, the maxEntries must have been hit. The number of bindings is " + bindingDetail.getBindingTemplate().size());
}
for (BindingTemplate bindingTemplate : bindingDetail.getBindingTemplate()) {
try {
//check if the service exist
BusinessService existingToService = uddiToClerk.findService(bindingTemplate.getServiceKey(), toClerk.getNode());
if (existingToService!=null) {
log.debug("Found service with key " + existingToService.getServiceKey() + ". No need to add it again");
} else {
BusinessService fromService = uddiFromClerk.findService(bindingTemplate.getServiceKey(), fromClerk.getNode());
fromService.getBusinessKey();
//check if the business exist
BusinessEntity existingBusinessEntity = uddiToClerk.findBusiness(fromService.getBusinessKey(), toClerk.getNode());
if (existingBusinessEntity!=null) {
log.debug("Found business with key " + existingBusinessEntity.getBusinessKey() + ". No need to add it again");
} else {
log.info("Business was not found in the destination UDDI " + toClerk.getNode().getName()
+ ", going to add it in.");
new XRegistration(fromService.getBusinessKey(), new UDDIClerk(fromClerk), new UDDIClerk(toClerk)).xRegisterBusiness();
}
log.info("Service was not found in the destination UDDI " + toClerk.getNode().getName()
+ ", going to add it in.");
new XRegistration(fromService.getServiceKey(), new UDDIClerk(fromClerk), new UDDIClerk(toClerk)).xRegisterService();
}
//now the service exists in the toNode and we can add this binding
new XRegistration(bindingTemplate.getBindingKey(), new UDDIClerk(fromClerk), new UDDIClerk(toClerk)).xRegisterServiceBinding();
} catch (Exception e) {
log.error(e.getMessage(),e);