public static void mapBusinessNames(List<org.apache.juddi.model.BusinessName> modelNameList, List<org.uddi.api_v3.Name> apiNameList) throws DispositionReportFaultMessage { apiNameList.clear(); for (org.apache.juddi.model.BusinessName modelName : modelNameList) { org.uddi.api_v3.Name apiName = new org.uddi.api_v3.Name(); apiName.setLang(modelName.getLangCode()); apiName.setValue(modelName.getName()); apiNameList.add(apiName); } }
private static boolean ContainsWildCardSingle(Name name) { if (name != null) { if (name.getValue() != null && name.getValue().contains(UDDIConstants.WILDCARD)) { return true; } if (name.getValue() != null && name.getValue().contains(UDDIConstants.WILDCARD_CHAR)) { return true; } if (name.getLang() != null && name.getLang().contains(UDDIConstants.WILDCARD)) { return true; } if (name.getLang() != null && name.getLang().contains(UDDIConstants.WILDCARD_CHAR)) { return true; } } return false; }
public static Name getName(List<Name> entityList, String lang) { if (entityList.size()==0) { Name name = new Name(); name.setValue(""); name.setLang(lang); entityList.add(name); } if (lang==null) return entityList.get(0); for (Name entity : entityList) { if (lang.equalsIgnoreCase(entity.getLang())) { return entity; } } return entityList.get(0); }
binding.setTModelKey(keyDomainURI + "binding"); Name sName = new Name(); sName.setLang(lang); if (!app.getDoc().isEmpty()) { sName.setValue(app.getDoc().get(0).getTitle()); if (sName.getValue() == null) { sName.setValue(keyDomainURI + " Binding tModel"); binding.setTModelKey(keyDomainURI + "rest"); sName = new Name(); sName.setLang(lang); if (!app.getDoc().isEmpty()) { sName.setValue(app.getDoc().get(0).getTitle()); if (sName.getValue() == null) { sName.setValue(keyDomainURI + " Rest tModel");
static Name[] mapNamePatterns(Collection namePatterns) throws JAXRException { if (namePatterns == null) return null; Name[] result = new Name[namePatterns.size()]; int currLoc = 0; for (Iterator i = namePatterns.iterator(); i.hasNext();) { Object obj = i.next(); Name name = objectFactory.createName(); if (obj instanceof String) { name.setValue((String)obj); } else if (obj instanceof LocalizedString) { LocalizedString ls = (LocalizedString)obj; name.setValue(ls.getValue()); name.setLang(ls.getLocale().getLanguage()); } result[currLoc] = name; currLoc++; } return result; }
public static String DumpAllServices(String authinfo, UDDIInquiryPortType inquiry) { StringBuilder sb = new StringBuilder(); FindService fs = new FindService(); fs.setAuthInfo(authinfo); fs.setFindQualifiers(new FindQualifiers()); fs.getFindQualifiers().getFindQualifier().add("approximateMatch"); fs.getName().add(new Name("%", null)); try { ServiceList findService = inquiry.findService(fs); if (findService.getServiceInfos() == null) { return ("NO SERVICES RETURNED!"); } else { for (int i = 0; i < findService.getServiceInfos().getServiceInfo().size(); i++) { sb.append(findService.getServiceInfos().getServiceInfo().get(i).getName().get(0).getValue()).append(" lang=").append(findService.getServiceInfos().getServiceInfo().get(i).getName().get(0).getLang()).append(" ").append(findService.getServiceInfos().getServiceInfo().get(i).getServiceKey()).append(" ").append(findService.getServiceInfos().getServiceInfo().get(i).getBusinessKey()).append( System.getProperty("line.separator")); } } } catch (Exception ex) { sb.append(ex.getMessage()); } return sb.toString(); }
Name environmentName = new Name(); environmentName.setValue(environment); tModel.setName(environmentName); tModelDetail = UDDIUtil.saveTModel(tModel); if (log.isDebugEnabled()) { log.debug("Endpoint: " + environmentName.getValue() + " TModel has been successfully published to UDDI."); log.error("Failed to publish endpoint: " + environmentName.getValue() + " TModel",e);
/** * Create an instance of {@link Name } * */ public Name createName() { return new Name(); }
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()); } }
private String nameListToString(List<Name> name) { StringBuilder ret = new StringBuilder(); if (name == null || name.isEmpty()) { return ""; } for (int i = 0; i < name.size(); i++) { ret.append(StringEscapeUtils.escapeHtml4(name.get(i).getValue())).append(" "); } return ret.toString().trim(); }
jaxbName.setValue(name);
public static Name getName(List<Name> entityList, String lang) { if (lang==null) return entityList.get(0); for (Name entity : entityList) { if (lang.equalsIgnoreCase(entity.getLang())) { return entity; } } return entityList.get(0); }
private static void addNames(List<Name> names, InternationalString iname) throws JAXRException { for (Object o : iname.getLocalizedStrings()) { LocalizedString locName = (LocalizedString) o; Name name = objectFactory.createName(); name.setValue(locName.getValue()); name.setLang(locName.getLocale().getLanguage()); names.add(name); } }
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(); }
Name documentName = new Name(); documentName.setValue(document.getDocumentType()); tModel.setName(documentName); tModelDetail = UDDIUtil.saveTModel(tModel); if (log.isDebugEnabled()) { log.debug("Document: " + documentName.getValue() + " TModel has been successfully published to UDDI."); log.error("Failed to publish document: " + documentName.getValue() + " TModel",e);
private static List<Name> MapName(List<org.uddi.api_v2.Name> name) { List<Name> items = new ArrayList<Name>(); for (int i = 0; i < name.size(); i++) { Name n = new Name(name.get(i).getValue(), name.get(i).getLang()); items.add(n); } return items; }
try { org.uddi.api_v3.BusinessService bsIn = (org.uddi.api_v3.BusinessService)EntityCreator.buildFromDoc(serviceXML, "org.uddi.api_v3"); String serviceName = bsIn.getName().get(0).getValue(); String bindingKey = bsIn.getBindingTemplates().getBindingTemplate().get(0).getBindingKey(); for (int i=0; i<numberOfCopies; i++) { bsIn.getName().get(0).setValue(serviceName + "-" + i); bsIn.setBusinessKey(parentBusinessKey +"-" + businessInt); bsIn.setServiceKey(serviceKey + "-" + businessInt + "-" + i);