public static void PrintBusinessInfo(BusinessInfos businessInfos) { if (businessInfos == null) { System.out.println("No data returned"); } else { for (int i = 0; i < businessInfos.getBusinessInfo().size(); i++) { System.out.println("==============================================="); System.out.println("Business Key: " + businessInfos.getBusinessInfo().get(i).getBusinessKey()); System.out.println("Name: " + ListToString(businessInfos.getBusinessInfo().get(i).getName())); System.out.println("Name: " + ListToDescString(businessInfos.getBusinessInfo().get(i).getDescription())); System.out.println("Services:"); PrintServiceInfo(businessInfos.getBusinessInfo().get(i).getServiceInfos()); } } }
private static BusinessInfos MapBusinessInfos(org.uddi.api_v3.BusinessInfos businessInfos) { BusinessInfos r = new BusinessInfos(); if (businessInfos == null || businessInfos.getBusinessInfo().isEmpty()) { return r; } for (int i = 0; i < businessInfos.getBusinessInfo().size(); i++) { BusinessInfo x = new BusinessInfo(); x.setBusinessKey(businessInfos.getBusinessInfo().get(i).getBusinessKey()); x.setServiceInfos(MapServiceInfos(businessInfos.getBusinessInfo().get(i).getServiceInfos())); x.getDescription().addAll(MapDescription(businessInfos.getBusinessInfo().get(i).getDescription())); x.getName().addAll(MapName(businessInfos.getBusinessInfo().get(i).getName())); r.getBusinessInfo().add(x); } return r; }
public static String DumpAllBusinesses(String authinfo, UDDIInquiryPortType inquriy) { StringBuilder sb = new StringBuilder(); FindBusiness fs = new FindBusiness(); fs.setAuthInfo(authinfo); fs.setFindQualifiers(new FindQualifiers()); fs.getFindQualifiers().getFindQualifier().add("approximateMatch"); fs.getName().add(new Name("%", null)); try { BusinessList findService = inquriy.findBusiness(fs); if (findService.getBusinessInfos() == null) { return ("NO BUSINESSES RETURNED!"); } else { for (int i = 0; i < findService.getBusinessInfos().getBusinessInfo().size(); i++) { sb.append(findService.getBusinessInfos().getBusinessInfo().get(i).getName().get(0).getValue()). append(" lang=").append(findService.getBusinessInfos().getBusinessInfo().get(i).getName().get(0).getLang()). append(" ").append(findService.getBusinessInfos().getBusinessInfo().get(i).getBusinessKey()) .append(System.getProperty("line.separator")); } } } catch (Exception ex) { return ex.getMessage(); } return sb.toString(); }
public void findAllBusiness() { try { FindBusiness body = (FindBusiness)EntityCreator.buildFromDoc(FIND_ALL_BUSINESSES_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"); //expecting more than 2 businesses Assert.assertTrue(biList.size()>1); } catch(Exception e) { logger.error(e.getMessage(), e); Assert.fail("No exception should be thrown." + e.getMessage()); } }
public List<BusinessInfo> findAllSignedBusiness() { List<BusinessInfo> biList = null; try { FindBusiness body = (FindBusiness)EntityCreator.buildFromDoc(FIND_ALL_SIGNED_BUSINESSES_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"); biList = bInfos.getBusinessInfo(); if (biList == null || biList.size() == 0) Assert.fail("No result from find business operation"); //expecting at one business Assert.assertTrue(biList.size()==1); return biList; } catch(Exception e) { logger.error(e.getMessage(), e); Assert.fail("No exception should be thrown."); } return biList; }
req.getName().add(n); BusinessList serviceDetail = config.inquiry.findBusiness(req); if (serviceDetail == null || serviceDetail.getBusinessInfos() == null || serviceDetail.getBusinessInfos().getBusinessInfo().isEmpty()) { ret.append("No Businesses are defined in the UDDI registry. Endpoints cannot be published"); } else { ret.append("<select name=uddibusinesskey>"); for (int i = 0; i < serviceDetail.getBusinessInfos().getBusinessInfo().size(); i++) { ret.append("<option value=\"").append(Utility.encodeHTML(serviceDetail.getBusinessInfos().getBusinessInfo().get(i).getBusinessKey())) .append("\">") .append(nameListToString(serviceDetail.getBusinessInfos().getBusinessInfo().get(i).getName())) .append(" ").append(Utility.encodeHTML(serviceDetail.getBusinessInfos().getBusinessInfo().get(i).getBusinessKey())) .append("</option>");
RegisteredInfo registeredInfo = publish.getRegisteredInfo(r); BusinessInfos businessInfos = registeredInfo.getBusinessInfos(); if (businessInfos != null && businessInfos.getBusinessInfo() != null) { Iterator<BusinessInfo> iter = businessInfos.getBusinessInfo().iterator(); while (iter.hasNext()) { BusinessInfo businessInfo = iter.next();
RegisteredInfo registeredInfo = publish.getRegisteredInfo(r); BusinessInfos businessInfos = registeredInfo.getBusinessInfos(); if (businessInfos != null && businessInfos.getBusinessInfo() != null) { Iterator<BusinessInfo> iter = businessInfos.getBusinessInfo().iterator(); while (iter.hasNext()) { BusinessInfo businessInfo = iter.next();
public static RegisteredInfo MapRegisteredInfo(org.uddi.api_v3.RegisteredInfo registeredInfo, String operator) { if (registeredInfo == null) { return null; } RegisteredInfo r = new RegisteredInfo(); r.setGeneric(VERSION); r.setOperator(operator); if (registeredInfo.isTruncated() != null && registeredInfo.isTruncated()) { r.setTruncated(Truncated.TRUE); } else { r.setTruncated(Truncated.FALSE); } if (registeredInfo.getBusinessInfos() != null) { r.setBusinessInfos(new BusinessInfos()); for (int i = 0; i < registeredInfo.getBusinessInfos().getBusinessInfo().size(); i++) { BusinessInfo x = new BusinessInfo(); x.setBusinessKey(registeredInfo.getBusinessInfos().getBusinessInfo().get(i).getBusinessKey()); x.getName().addAll(MapName(registeredInfo.getBusinessInfos().getBusinessInfo().get(i).getName())); x.getDescription().addAll(MapDescription(registeredInfo.getBusinessInfos().getBusinessInfo().get(i).getDescription())); x.setServiceInfos(MapServiceInfos(registeredInfo.getBusinessInfos().getBusinessInfo().get(i).getServiceInfos())); } } if (registeredInfo.getTModelInfos() != null) { r.setTModelInfos(new TModelInfos()); r.getTModelInfos().getTModelInfo().addAll(MapTModelInfo(registeredInfo.getTModelInfos().getTModelInfo())); } return r; }
businessInfo = businessList.getBusinessInfos().getBusinessInfo().iterator().next();
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."); } }
result.getBusinessInfos().getBusinessInfo().add(apiBusinessInfo);
if(bizInfos != null) List<BusinessInfo> bizInfoList = bizInfos.getBusinessInfo(); for (BusinessInfo businessInfo : bizInfoList) {
result.getBusinessInfos().getBusinessInfo().add(apiBusinessInfo);
List<BusinessInfo> bizInfoList = ri.getBusinessInfos().getBusinessInfo(); orgs = new LinkedHashSet<Organization>(); for (BusinessInfo businessInfo : bizInfoList) {
result.getBusinessInfos().getBusinessInfo().add(apiBusinessInfo);
public static RegisteredInfo MapListRegisteredInfo(org.uddi.api_v2.RegisteredInfo registeredInfo) { if (registeredInfo == null) { return null; } RegisteredInfo r = new RegisteredInfo(); if (registeredInfo.getBusinessInfos() != null) { r.setBusinessInfos(new BusinessInfos()); r.getBusinessInfos().getBusinessInfo().addAll(MapBusinessInfo(registeredInfo.getBusinessInfos().getBusinessInfo())); } if (registeredInfo.getTModelInfos() != null) { r.setTModelInfos(new TModelInfos()); for (int i = 0; i < registeredInfo.getTModelInfos().getTModelInfo().size(); i++) { TModelInfo x = new TModelInfo(); x.setTModelKey(registeredInfo.getTModelInfos().getTModelInfo().get(i).getTModelKey()); x.setName(new Name(registeredInfo.getTModelInfos().getTModelInfo().get(i).getName().getValue(), registeredInfo.getTModelInfos().getTModelInfo().get(i).getName().getValue())); r.getTModelInfos().getTModelInfo().add(x); } } r.setTruncated(registeredInfo.getTruncated() == Truncated.TRUE); return r; }
public static BusinessList MapBusinessList(org.uddi.api_v2.BusinessList findBinding) { org.uddi.api_v3.BusinessList r = new org.uddi.api_v3.BusinessList(); r.setListDescription(new ListDescription()); r.getListDescription().setActualCount(0); r.getListDescription().setIncludeCount(0); r.getListDescription().setListHead(0); if (findBinding.getBusinessInfos() != null) { r.getListDescription().setIncludeCount(findBinding.getBusinessInfos().getBusinessInfo().size()); r.getListDescription().setActualCount(findBinding.getBusinessInfos().getBusinessInfo().size()); r.setBusinessInfos(new BusinessInfos()); r.getBusinessInfos().getBusinessInfo().addAll(MapBusinessInfo(findBinding.getBusinessInfos().getBusinessInfo())); } r.setTruncated(findBinding.getTruncated() == Truncated.TRUE); return r; }
for (BusinessInfo businessInfo : list.getBusinessList().getBusinessInfos().getBusinessInfo()) { new XRegistration(businessInfo.getBusinessKey(), new UDDIClerk(fromClerk), new UDDIClerk(toClerk)).xRegisterBusinessAndServices();
for (BusinessInfo businessInfo : list.getBusinessList().getBusinessInfos().getBusinessInfo()) { new XRegistration(businessInfo.getBusinessKey(), new UDDIClerk(fromClerk), new UDDIClerk(toClerk)).xRegisterBusinessAndServices();