private static List<TModelInfo> MapTModelInfo(List<org.uddi.api_v3.TModelInfo> tModelInfo) { List<TModelInfo> r = new ArrayList<TModelInfo>(); if (tModelInfo == null) { return r; } for (int i = 0; i < tModelInfo.size(); i++) { TModelInfo x = new TModelInfo(); x.setTModelKey(tModelInfo.get(i).getTModelKey()); x.setName(new Name(tModelInfo.get(i).getName().getValue(), tModelInfo.get(i).getName().getLang())); r.add(x); } return r; }
public static Concept getConcept(TModelInfo tModelInfo, LifeCycleManager lifeCycleManager) throws JAXRException { Concept concept = new ConceptImpl(lifeCycleManager); concept.setKey(lifeCycleManager.createKey(tModelInfo.getTModelKey())); concept.setName(lifeCycleManager.createInternationalString(getLocale(tModelInfo.getName().getLang()), tModelInfo.getName().getValue())); return concept; }
public static String DumpAllTModels(String authinfo, UDDIInquiryPortType inquriy) { StringBuilder sb = new StringBuilder(); FindTModel fs = new FindTModel(); fs.setAuthInfo(authinfo); fs.setFindQualifiers(new FindQualifiers()); fs.getFindQualifiers().getFindQualifier().add("approximateMatch"); fs.setName(new Name("%", null)); try { TModelList findService = inquriy.findTModel(fs); if (findService.getTModelInfos()== null) { return ("NO TMODELS RETURNED!"); } else { for (int i = 0; i < findService.getTModelInfos().getTModelInfo().size(); i++) { sb.append(findService.getTModelInfos().getTModelInfo().get(i).getName().getValue()). append(" lang=").append(findService.getTModelInfos().getTModelInfo().get(i).getName().getLang()). append(" ").append(findService.getTModelInfos().getTModelInfo().get(i).getTModelKey()) .append(System.getProperty("line.separator")); } } } catch (Exception ex) { return ex.getMessage(); } return sb.toString(); } public static String DumpAllBusinesses(String authinfo, UDDIInquiryPortType inquriy) {
public void findTModel(String findQualifier) { try { FindTModel body = (FindTModel)EntityCreator.buildFromDoc(FIND_TMODEL_XML, "org.uddi.api_v3"); if (findQualifier!=null) body.getFindQualifiers().getFindQualifier().add(findQualifier); TModelList result = inquiry.findTModel(body); if (result == null) Assert.fail("Null result from find tModel operation"); TModelInfos tInfos = result.getTModelInfos(); if (tInfos == null) Assert.fail("No result from find tModel operation"); List<TModelInfo> tiList = tInfos.getTModelInfo(); if (tiList == null || tiList.size() == 0) Assert.fail("No result from find tModel operation"); TModelInfo tiOut = tiList.get(0); TModel tmIn = (TModel)EntityCreator.buildFromDoc(TckTModel.JOE_PUBLISHER_TMODEL_XML, "org.uddi.api_v3"); assertEquals(tmIn.getTModelKey(), tiOut.getTModelKey()); assertEquals(tmIn.getName().getLang(), tiOut.getName().getLang()); assertEquals(tmIn.getName().getValue(), tiOut.getName().getValue()); TckValidator.checkDescriptions(tmIn.getDescription(), tiOut.getDescription()); } catch(Exception e) { logger.error(e.getMessage(), e); Assert.fail("No exception should be thrown."); } } }
TModelInfo info = tmodelInfoList.get(0); scheme = new ClassificationSchemeImpl(registryService.getLifeCycleManagerImpl()); scheme.setName(new InternationalStringImpl(info.getName().getValue())); scheme.setKey(new KeyImpl(info.getTModelKey()));