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()); } }
rootBusinessEntity.setBusinessKey(rootbizkey); installBusinessEntity(true, em, rootBusinessEntity, rootPublisher, rootPartition, config, nodeId); installReplicationConfiguration(em, replicationCfg, config, nodeId);
rootBusinessEntity.setBusinessKey(rootbizkey); installBusinessEntity(true, em, rootBusinessEntity, rootPublisher, rootPartition, config, nodeId); installReplicationConfiguration(em, replicationCfg, config, nodeId);
if (entityKey == null || entityKey.length() == 0) { entityKey = rootPartition + KeyGenerator.PARTITION_SEPARATOR + UUID.randomUUID(); businessEntity.setBusinessKey(entityKey); } else { businessEntity.setBusinessKey(entityKey);
if (entityKey == null || entityKey.length() == 0) { entityKey = rootPartition + KeyGenerator.PARTITION_SEPARATOR + UUID.randomUUID(); businessEntity.setBusinessKey(entityKey); } else { businessEntity.setBusinessKey(entityKey);
biz.setBusinessKey(key.getId()); } else { biz.setBusinessKey("");
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; } } ///
biz.setBusinessKey(key.getId()); } else { biz.setBusinessKey("");
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; }
KeyGenerator keyGen = KeyGeneratorFactory.getKeyGenerator(); entityKey = keyGen.generate(publisher); businessEntity.setBusinessKey(entityKey); } else { businessEntity.setBusinessKey(entityKey); validateKeyLength(entityKey); Object obj = em.find(org.apache.juddi.model.BusinessEntity.class, entityKey);
KeyGenerator keyGen = KeyGeneratorFactory.getKeyGenerator(); entityKey = keyGen.generate(publisher); businessEntity.setBusinessKey(entityKey); } else { businessEntity.setBusinessKey(entityKey); validateKeyLength(entityKey); Object obj = em.find(org.apache.juddi.model.BusinessEntity.class, entityKey);
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()); }