/** * Helper routine to take a jUDDI business service and turn into a useful * Service. Needs to go back to the registry to get the organization to * properly hydrate the Service * * @param bs BusinessService object to turn in to a Service * @param lcm manager to use * @return new Service object * @throws JAXRException */ protected Service getServiceFromBusinessService(BusinessService bs, LifeCycleManager lcm) throws JAXRException { ServiceImpl service = (ServiceImpl) ScoutUddiV3JaxrHelper.getService(bs, lcm); service.setSubmittingOrganizationKey(bs.getBusinessKey()); return service; }
if (apiBusinessService.getBusinessKey() != null && apiBusinessService.getBusinessKey().length() > 0 && !modelBusinessEntity.getEntityKey().equalsIgnoreCase(apiBusinessService.getBusinessKey())) {
if (apiBusinessService.getBusinessKey() != null && apiBusinessService.getBusinessKey().length() > 0 && !modelBusinessEntity.getEntityKey().equalsIgnoreCase(apiBusinessService.getBusinessKey())) {
if (serviceDetail != null) { if (!serviceDetail.getBusinessService().isEmpty()) { bizkey = serviceDetail.getBusinessService().get(0).getBusinessKey(); if (!serviceDetail.getBusinessService().get(0).getSignature().isEmpty()) { log.info("the service with key=" + serviceKey + " exists and is digitally signed");
String parentKey = businessService.getBusinessKey(); if (parentKey != null && parentKey.length() > 0) { if (!parentKey.equalsIgnoreCase(parent.getBusinessKey())) { throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.ParentBusinessNotFound", parentKey + " " + businessService.getBusinessKey() + " " + businessService.getBusinessKey().length() + " " + parentKey.length()));
String parentKey = businessService.getBusinessKey(); if (parentKey != null && parentKey.length() > 0) { if (!parentKey.equalsIgnoreCase(parent.getBusinessKey())) { throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.ParentBusinessNotFound", parentKey + " " + businessService.getBusinessKey() + " " + businessService.getBusinessKey().length() + " " + parentKey.length()));
modelBusinessEntity.setEntityKey(apiBusinessService.getBusinessKey());
modelBusinessEntity.setEntityKey(apiBusinessService.getBusinessKey());
void validateNotSigned(org.uddi.api_v3.BusinessService item) throws ValueNotAllowedException { if (item == null) { return; } if (item.getBusinessKey() == null && !item.getSignature().isEmpty()) { throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "businessKey")); } if (item.getServiceKey() == null && !item.getSignature().isEmpty()) { throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "serviceKey")); } //if i'm signed and a key isn't defined in a bt if (item.getBindingTemplates() != null && !item.getSignature().isEmpty()) { for (int i = 0; i < item.getBindingTemplates().getBindingTemplate().size(); i++) { if (item.getBindingTemplates().getBindingTemplate().get(i).getBindingKey() == null || item.getBindingTemplates().getBindingTemplate().get(i).getBindingKey().length() == 0) { throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "businessService/bindingTemplate(" + i + ")/bindingKey")); } } } }
void validateNotSigned(org.uddi.api_v3.BusinessService item) throws ValueNotAllowedException { if (item == null) { return; } if (item.getBusinessKey() == null && !item.getSignature().isEmpty()) { throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "businessKey")); } if (item.getServiceKey() == null && !item.getSignature().isEmpty()) { throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "serviceKey")); } //if i'm signed and a key isn't defined in a bt if (item.getBindingTemplates() != null && !item.getSignature().isEmpty()) { for (int i = 0; i < item.getBindingTemplates().getBindingTemplate().size(); i++) { if (item.getBindingTemplates().getBindingTemplate().get(i).getBindingKey() == null || item.getBindingTemplates().getBindingTemplate().get(i).getBindingKey().length() == 0) { throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "businessService/bindingTemplate(" + i + ")/bindingKey")); } } } }
void validateNotSigned(org.uddi.api_v3.BusinessEntity item) throws ValueNotAllowedException { if (item == null) { return; } if (item.getBusinessKey() == null && !item.getSignature().isEmpty()) { throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "businessKey")); } if (item.getBusinessServices() != null && !item.getSignature().isEmpty()) { for (int i = 0; i < item.getBusinessServices().getBusinessService().size(); i++) { if (item.getBusinessServices().getBusinessService().get(i).getBusinessKey() == null || item.getBusinessServices().getBusinessService().get(i).getBusinessKey().length() == 0) { throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "business/Service(" + i + ")/businessKey")); } if (item.getBusinessServices().getBusinessService().get(i).getServiceKey() == null || item.getBusinessServices().getBusinessService().get(i).getServiceKey().length() == 0) { throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "business/Service(" + i + ")/serviceKey")); } if (item.getBusinessServices().getBusinessService().get(i).getBindingTemplates() != null) { for (int k = 0; k < item.getBusinessServices().getBusinessService().get(i).getBindingTemplates().getBindingTemplate().size(); k++) { if (item.getBusinessServices().getBusinessService().get(i).getBindingTemplates().getBindingTemplate().get(k).getBindingKey() == null || item.getBusinessServices().getBusinessService().get(i).getBindingTemplates().getBindingTemplate().get(k).getBindingKey().length() == 0) { throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "business/Service(" + i + ")/bindingTemplate)" + k + ")/bindingKey")); } } } } } }
void validateNotSigned(org.uddi.api_v3.BusinessEntity item) throws ValueNotAllowedException { if (item == null) { return; } if (item.getBusinessKey() == null && !item.getSignature().isEmpty()) { throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "businessKey")); } if (item.getBusinessServices() != null && !item.getSignature().isEmpty()) { for (int i = 0; i < item.getBusinessServices().getBusinessService().size(); i++) { if (item.getBusinessServices().getBusinessService().get(i).getBusinessKey() == null || item.getBusinessServices().getBusinessService().get(i).getBusinessKey().length() == 0) { throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "business/Service(" + i + ")/businessKey")); } if (item.getBusinessServices().getBusinessService().get(i).getServiceKey() == null || item.getBusinessServices().getBusinessService().get(i).getServiceKey().length() == 0) { throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "business/Service(" + i + ")/serviceKey")); } if (item.getBusinessServices().getBusinessService().get(i).getBindingTemplates() != null) { for (int k = 0; k < item.getBusinessServices().getBusinessService().get(i).getBindingTemplates().getBindingTemplate().size(); k++) { if (item.getBusinessServices().getBusinessService().get(i).getBindingTemplates().getBindingTemplate().get(k).getBindingKey() == null || item.getBusinessServices().getBusinessService().get(i).getBindingTemplates().getBindingTemplate().get(k).getBindingKey().length() == 0) { throw new ValueNotAllowedException(new ErrorMessage("errors.entity.SignedButNoKey", "business/Service(" + i + ")/bindingTemplate)" + k + ")/bindingKey")); } } } } } }
.append(Utility.encodeHTML(descirptionToString(serviceDetail.getBusinessService().get(i).getDescription()))) .append("</td>"); ret.append("<td>").append(Utility.encodeHTML(serviceDetail.getBusinessService().get(i).getBusinessKey())) .append("</td>"); ret.append("<td>"); //binding info
ServiceDetail bsOut = publication.saveService(ss); Assert.assertNotNull(bsOut); Assert.assertEquals(bsOut.getBusinessService().get(0).getBusinessKey(), bsIn.getBusinessKey()); if (bsIn.getBindingTemplates() != null) { Assert.assertNotNull(bsOut.getBusinessService().get(0).getBindingTemplates());
public static org.uddi.api_v2.BusinessService MapService(org.uddi.api_v3.BusinessService be) { if (be == null) { return null; } BusinessService item = new org.uddi.api_v2.BusinessService(); item.setCategoryBag(MapCategoryBag(be.getCategoryBag())); item.getDescription().addAll(MapDescription(be.getDescription())); item.setBusinessKey(be.getBusinessKey()); item.setServiceKey(be.getServiceKey()); item.getName().addAll(MapName(be.getName())); if (be.getBindingTemplates() != null && !be.getBindingTemplates().getBindingTemplate().isEmpty()) { item.setBindingTemplates(new BindingTemplates()); item.getBindingTemplates().getBindingTemplate().addAll(MapBinding(be.getBindingTemplates().getBindingTemplate())); } return item; }
String parentKey = businessService.getBusinessKey(); if (parentKey != null && parentKey.length() > 0) { if (!businessService.getBusinessKey().equalsIgnoreCase(bs.getBusinessEntity().getEntityKey())) { throw new InvalidProjectionException(new ErrorMessage("errors.invalidprojection.ParentMismatch", businessService.getBusinessKey() + ", " + bs.getBusinessEntity().getEntityKey())); } else { if (log.isDebugEnabled()) { log.debug("Services moved from business " + bs.getBusinessEntity() + " to " + businessService.getBusinessKey());
try { if (existingBusinessEntity==null) { existingBusinessEntity = uddiToClerk.findBusiness(service.getBusinessKey(), toClerk.getNode()); log.info("Business was not found in the destination UDDI " + toClerk.getNode().getName() + ", going to add it in."); new XRegistration(service.getBusinessKey(), new UDDIClerk(fromClerk), new UDDIClerk(toClerk)).xRegisterBusiness(); BusinessService fromService = uddiFromClerk.findService(bindingTemplate.getServiceKey(), fromClerk.getNode()); 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"); 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();
try { if (existingBusinessEntity==null) { existingBusinessEntity = uddiToClerk.findBusiness(service.getBusinessKey(), toClerk.getNode()); log.info("Business was not found in the destination UDDI " + toClerk.getNode().getName() + ", going to add it in."); new XRegistration(service.getBusinessKey(), new UDDIClerk(fromClerk), new UDDIClerk(toClerk)).xRegisterBusiness(); BusinessService fromService = uddiFromClerk.findService(bindingTemplate.getServiceKey(), fromClerk.getNode()); 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"); 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();
if (parentKey != null && parentKey.length() > 0) { if (!parentKey.equalsIgnoreCase(parent.getServiceKey())) { throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.bindingtemplate.ParentMismatch", parentKey + ", " + parent.getBusinessKey()));
if (parentKey != null && parentKey.length() > 0) { if (!parentKey.equalsIgnoreCase(parent.getServiceKey())) { throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.bindingtemplate.ParentMismatch", parentKey + ", " + parent.getBusinessKey()));