public static void PrintBusinessDetails(List<BusinessEntity> businessDetail) { for (int i = 0; i < businessDetail.size(); i++) { System.out.println("Business Detail - key: " + businessDetail.get(i).getBusinessKey()); System.out.println("Name: " + ListToString(businessDetail.get(i).getName())); System.out.println("CategoryBag: " + CatBagToString(businessDetail.get(i).getCategoryBag())); PrintContacts(businessDetail.get(i).getContacts()); } }
if (business.getName().get(0) == null) { log.error("Unable to register business because no Name elements have been added."); return null; log.info("Registering business " + business.getName().get(0).getValue() + " with key " + business.getBusinessKey()); try { businessEntity = businessDetail.getBusinessEntity().get(0); if (log.isDebugEnabled()) { log.debug("Registering businessEntity " + businessEntity.getName().get(0).getValue() + " completed."); log.error("Unable to register business " + business.getName().get(0).getValue() + " ." + e.getMessage(), e); } catch (Throwable t) { log.error("Unable to register business " + business.getName().get(0).getValue() + " ." + t.getMessage(), t);
public void saveBusinesses(String authInfo, String businessXML, String businessKey, int numberOfCopies) { try { BusinessEntity beIn = (BusinessEntity) EntityCreator.buildFromDoc(businessXML, "org.uddi.api_v3"); String businessName = beIn.getName().get(0).getValue(); for (int i = 0; i < numberOfCopies; i++) { SaveBusiness sb = new SaveBusiness(); sb.setAuthInfo(authInfo); beIn.getName().get(0).setValue(businessName + "-" + i); beIn.setBusinessKey(businessKey + "-" + i); sb.getBusinessEntity().add(beIn); /* if (beIn.getBusinessServices()!=null){ for (int x=0; x < beIn.getBusinessServices().getBusinessService().size(); x++){ beIn.getBusinessServices().getBusinessService().get(x).setBusinessKey(businessKey + "-" + i); if (beIn.getBusinessServices().getBusinessService().get(x).getBindingTemplates()!=null){ for (int y=0; y < beIn.getBusinessServices().getBusinessService().get(x).getBindingTemplates().getBindingTemplate().size(); y++){ beIn.getBusinessServices().getBusinessService().get(x).getBindingTemplates().getBindingTemplate().get(y). } } } }*/ publication.saveBusiness(sb); logger.info("Saved business with key " + businessName + "-" + i); } } catch (Throwable e) { logger.error(e.getMessage(), e); Assert.fail("No exception should be thrown " + e.getMessage()); } }
/** * Copies the BusinessInformation from one UDDI to another UDDI. */ public void xRegisterBusinessAndServices() { BusinessEntity businessEntity; try { businessEntity = fromClerk.getBusinessDetail(entityKey,fromClerk.getUDDINode().getApiNode()); log.info("xregister business " + businessEntity.getName().get(0).getValue() + " + from " + fromClerk.getName() + " to " + toClerk.getName() + " including all services owned by this business."); toClerk.register(businessEntity,toClerk.getUDDINode().getApiNode()); } catch (Exception e) { log.error("Could not " + toString() + ". " + e.getMessage() + " " + e.getCause(),e); } } /**
/** * Copies the BusinessInformation from one UDDI to another UDDI. Note that no services are being * copied over by this service. Use xRegisterService to copy over services. */ public void xRegisterBusiness() { BusinessEntity businessEntity; try { businessEntity = fromClerk.getBusinessDetail(entityKey,fromClerk.getUDDINode().getApiNode()); log.info("xregister business " + businessEntity.getName().get(0).getValue() + " + from " + fromClerk.getName() + " to " + toClerk.getName() + "."); //not bringing over the services. They need to be explicitly copied using xRegisterService. businessEntity.setBusinessServices(null); toClerk.register(businessEntity,toClerk.getUDDINode().getApiNode()); } catch (Exception e) { log.error("Could not " + toString() + ". " + e.getMessage() + " " + e.getCause(),e); } }
businessEntityName.setValue(businessName); businessEntityName.setLang(UDDIConstants.ENGLISH); businessEntity.getName().add(businessEntityName);
public void findBusiness() { try { FindBusiness body = (FindBusiness)EntityCreator.buildFromDoc(FIND_BUSINESS_XML, "org.uddi.api_v3"); BusinessList result = inquiry.findBusiness(body); if (result == null) Assert.fail("Null result from find business operation"); BusinessInfos bInfos = result.getBusinessInfos(); if (bInfos == null) Assert.fail("No result from find business operation"); List<BusinessInfo> biList = bInfos.getBusinessInfo(); if (biList == null || biList.size() == 0) Assert.fail("No result from find business operation"); BusinessInfo biOut = biList.get(0); BusinessEntity beIn = (BusinessEntity)EntityCreator.buildFromDoc(TckBusiness.JOE_BUSINESS_XML, "org.uddi.api_v3"); assertEquals(beIn.getBusinessKey(), biOut.getBusinessKey()); TckValidator.checkNames(beIn.getName(), biOut.getName()); TckValidator.checkDescriptions(beIn.getDescription(), biOut.getDescription()); } catch(Exception e) { logger.error(e.getMessage(), e); Assert.fail("No exception should be thrown."); } }
validatePublish.validateNames(businessEntity.getName()); validatePublish.validateDiscoveryUrls(businessEntity.getDiscoveryURLs()); validatePublish.validateContacts(businessEntity.getContacts(), config);
validatePublish.validateNames(businessEntity.getName()); validatePublish.validateDiscoveryUrls(businessEntity.getDiscoveryURLs()); validatePublish.validateContacts(businessEntity.getContacts(), config);
protected boolean publishTestBusiness() { try { SaveBusiness sb1 = new SaveBusiness(); //List<BusinessEntity> biz = new ArrayList<BusinessEntity>(); BusinessEntity e = new BusinessEntity(); e.setBusinessKey("uddi:org:miloss:fgsms:test"); Name n = new Name(); n.setValue("Test Business Entity"); n.setLang(PublicationConstants.lang); e.getName().add(n); // biz.add(e); sb1.getBusinessEntity().add(e); sb1.setAuthInfo(loginWrapper()); publication.saveBusiness(sb1); return true; } catch (DispositionReportFaultMessage ex) { log.log(Level.ERROR, "error publising test business entity", ex); log.log(Level.ERROR, "error publising test business entity" + dispositionReportFaultMessageToString(ex), ex); return false; } catch (Exception ex) { log.log(Level.ERROR, "error publising test business entity", ex); return false; } } ///
protected boolean publishTestPublisher() { try { SaveBusiness sb1 = new SaveBusiness(); //List<BusinessEntity> biz = new ArrayList<BusinessEntity>(); BusinessEntity e = new BusinessEntity(); e.setBusinessKey("uddi:org.miloss.fgsms:test"); Name n = new Name(); n.setValue("Test Business Entity"); n.setLang(PublicationConstants.lang); e.getName().add(n); // biz.add(e); sb1.getBusinessEntity().add(e); sb1.setAuthInfo(loginWrapper()); publication.saveBusiness(sb1); return true; } catch (DispositionReportFaultMessage ex) { log.log(Level.ERROR, "error publising test business entity", ex); log.log(Level.ERROR, "error publising test business entity" + dispositionReportFaultMessageToString(ex), ex); return false; } catch (Exception ex) { log.log(Level.ERROR, "error publising test business entity", ex); return false; } }
public static org.uddi.api_v3.BusinessEntity MapBusiness(org.uddi.api_v2.BusinessEntity be) { if (be == null) { return null; } BusinessEntity item = new org.uddi.api_v3.BusinessEntity(); item.setBusinessKey(be.getBusinessKey()); item.getName().addAll(MapName(be.getName())); item.setCategoryBag(MapCategoryBag(be.getCategoryBag())); item.setDiscoveryURLs(MapDiscoveryURLs(be.getDiscoveryURLs())); item.getDescription().addAll(MapDescription(be.getDescription())); item.setContacts(MapContacts(be.getContacts())); item.setIdentifierBag(MapIdentBag(be.getIdentifierBag())); if (be.getBusinessServices() != null && !be.getBusinessServices().getBusinessService().isEmpty()) { item.setBusinessServices(new BusinessServices()); item.getBusinessServices().getBusinessService().addAll(MapService(be.getBusinessServices().getBusinessService())); } return item; }
public static org.uddi.api_v2.BusinessEntity MapBusiness(org.uddi.api_v3.BusinessEntity be, String operator) { if (be == null) { return null; } BusinessEntity item = new org.uddi.api_v2.BusinessEntity(); item.setBusinessKey(be.getBusinessKey()); if (item.getBusinessKey()==null) item.setBusinessKey(""); item.setCategoryBag(MapCategoryBag(be.getCategoryBag())); item.setContacts(MapContacts(be.getContacts())); item.setDiscoveryURLs(MapDiscoveryURLs(be.getDiscoveryURLs())); item.setIdentifierBag(MapIdentBag(be.getIdentifierBag())); item.setOperator(operator); item.getDescription().addAll(MapDescription(be.getDescription())); item.getName().addAll(MapName(be.getName())); if (be.getBusinessServices() != null && !be.getBusinessServices().getBusinessService().isEmpty()) { item.setBusinessServices(new BusinessServices()); item.getBusinessServices().getBusinessService().addAll(MapService(be.getBusinessServices().getBusinessService())); } return item; }
validateNames(businessEntity.getName()); validateDiscoveryUrls(businessEntity.getDiscoveryURLs()); validateContacts(businessEntity.getContacts(), config);
public static void mapBusinessEntity(org.apache.juddi.model.BusinessEntity modelBusinessEntity, org.uddi.api_v3.BusinessEntity apiBusinessEntity) throws DispositionReportFaultMessage { apiBusinessEntity.setBusinessKey(modelBusinessEntity.getEntityKey()); mapBusinessNames(modelBusinessEntity.getBusinessNames(), apiBusinessEntity.getName()); mapBusinessDescriptions(modelBusinessEntity.getBusinessDescrs(), apiBusinessEntity.getDescription()); mapDiscoveryUrls(modelBusinessEntity.getDiscoveryUrls(), apiBusinessEntity.getDiscoveryURLs(), apiBusinessEntity); mapContacts(modelBusinessEntity.getContacts(), apiBusinessEntity.getContacts(), apiBusinessEntity); mapBusinessIdentifiers(modelBusinessEntity.getBusinessIdentifiers(), apiBusinessEntity.getIdentifierBag(), apiBusinessEntity); apiBusinessEntity.setCategoryBag(mapCategoryBag(modelBusinessEntity.getCategoryBag(), apiBusinessEntity.getCategoryBag())); mapBusinessServices(modelBusinessEntity.getBusinessServices(), modelBusinessEntity.getServiceProjections(), apiBusinessEntity.getBusinessServices(), apiBusinessEntity); mapSignature(modelBusinessEntity.getSignatures(), apiBusinessEntity.getSignature()); }
public static void mapBusinessEntity(org.apache.juddi.model.BusinessEntity modelBusinessEntity, org.uddi.api_v3.BusinessEntity apiBusinessEntity) throws DispositionReportFaultMessage { apiBusinessEntity.setBusinessKey(modelBusinessEntity.getEntityKey()); mapBusinessNames(modelBusinessEntity.getBusinessNames(), apiBusinessEntity.getName()); mapBusinessDescriptions(modelBusinessEntity.getBusinessDescrs(), apiBusinessEntity.getDescription()); mapDiscoveryUrls(modelBusinessEntity.getDiscoveryUrls(), apiBusinessEntity.getDiscoveryURLs(), apiBusinessEntity); mapContacts(modelBusinessEntity.getContacts(), apiBusinessEntity.getContacts(), apiBusinessEntity); mapBusinessIdentifiers(modelBusinessEntity.getBusinessIdentifiers(), apiBusinessEntity.getIdentifierBag(), apiBusinessEntity); apiBusinessEntity.setCategoryBag(mapCategoryBag(modelBusinessEntity.getCategoryBag(), apiBusinessEntity.getCategoryBag())); mapBusinessServices(modelBusinessEntity.getBusinessServices(), modelBusinessEntity.getServiceProjections(), apiBusinessEntity.getBusinessServices(), apiBusinessEntity); mapSignature(modelBusinessEntity.getSignatures(), apiBusinessEntity.getSignature()); }
/** * * @param apiBusinessEntity * @param modelBusinessEntity * @throws DispositionReportFaultMessage */ public static void mapBusinessEntity(org.uddi.api_v3.BusinessEntity apiBusinessEntity, org.apache.juddi.model.BusinessEntity modelBusinessEntity) throws DispositionReportFaultMessage { modelBusinessEntity.setEntityKey(apiBusinessEntity.getBusinessKey()); mapBusinessNames(apiBusinessEntity.getName(), modelBusinessEntity.getBusinessNames(), modelBusinessEntity); mapBusinessDescriptions(apiBusinessEntity.getDescription(), modelBusinessEntity.getBusinessDescrs(), modelBusinessEntity); mapDiscoveryUrls(apiBusinessEntity.getDiscoveryURLs(), modelBusinessEntity.getDiscoveryUrls(), modelBusinessEntity); mapContacts(apiBusinessEntity.getContacts(), modelBusinessEntity.getContacts(), modelBusinessEntity); mapBusinessIdentifiers(apiBusinessEntity.getIdentifierBag(), modelBusinessEntity.getBusinessIdentifiers(), modelBusinessEntity); if (apiBusinessEntity.getCategoryBag() != null) { modelBusinessEntity.setCategoryBag(new org.apache.juddi.model.BusinessCategoryBag(modelBusinessEntity)); mapCategoryBag(apiBusinessEntity.getCategoryBag(), modelBusinessEntity.getCategoryBag()); } mapBusinessServices(apiBusinessEntity.getBusinessServices(), modelBusinessEntity.getBusinessServices(), modelBusinessEntity.getServiceProjections(), modelBusinessEntity); mapBusinessSignature(apiBusinessEntity.getSignature(), modelBusinessEntity); }
/** * * @param apiBusinessEntity * @param modelBusinessEntity * @throws DispositionReportFaultMessage */ public static void mapBusinessEntity(org.uddi.api_v3.BusinessEntity apiBusinessEntity, org.apache.juddi.model.BusinessEntity modelBusinessEntity) throws DispositionReportFaultMessage { modelBusinessEntity.setEntityKey(apiBusinessEntity.getBusinessKey()); mapBusinessNames(apiBusinessEntity.getName(), modelBusinessEntity.getBusinessNames(), modelBusinessEntity); mapBusinessDescriptions(apiBusinessEntity.getDescription(), modelBusinessEntity.getBusinessDescrs(), modelBusinessEntity); mapDiscoveryUrls(apiBusinessEntity.getDiscoveryURLs(), modelBusinessEntity.getDiscoveryUrls(), modelBusinessEntity); mapContacts(apiBusinessEntity.getContacts(), modelBusinessEntity.getContacts(), modelBusinessEntity); mapBusinessIdentifiers(apiBusinessEntity.getIdentifierBag(), modelBusinessEntity.getBusinessIdentifiers(), modelBusinessEntity); if (apiBusinessEntity.getCategoryBag() != null) { modelBusinessEntity.setCategoryBag(new org.apache.juddi.model.BusinessCategoryBag(modelBusinessEntity)); mapCategoryBag(apiBusinessEntity.getCategoryBag(), modelBusinessEntity.getCategoryBag()); } mapBusinessServices(apiBusinessEntity.getBusinessServices(), modelBusinessEntity.getBusinessServices(), modelBusinessEntity.getServiceProjections(), modelBusinessEntity); mapBusinessSignature(apiBusinessEntity.getSignature(), modelBusinessEntity); }