public TModelList findJoeTModelDetail() { try { FindTModel body = (FindTModel) EntityCreator.buildFromDoc(FIND_TMODEL_XML, "org.uddi.api_v3"); TModelList result = inquiry.findTModel(body); return result; } catch (Exception e) { logger.error(e.getMessage(), e); Assert.fail("No exception should be thrown"); } Assert.fail("We should already have returned"); return null; }
public TModelList findJoeTModelDetailByCategoryBag() { try { FindTModel body = (FindTModel) EntityCreator.buildFromDoc(FIND_TMODEL_XML_BY_CAT, "org.uddi.api_v3"); TModelList result = inquiry.findTModel(body); return result; } catch (Exception e) { logger.error(e.getMessage(), e); Assert.fail("No exception should be thrown"); } Assert.fail("We should already have returned"); return null; }
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 static void DumpAllTModelsOpInfo(String authInfoJoe, UDDIInquiryPortType uddiInquiryImpl) throws Exception { FindTModel ftm = new FindTModel(); ftm.setAuthInfo(authInfoJoe); //org.apache.juddi.v3.client.UDDIConstants.WILDCARD ftm.setName(new Name("%", null)); ftm.setFindQualifiers(new FindQualifiers()); ftm.getFindQualifiers().getFindQualifier().add("approximateMatch"); TModelList findTModel = uddiInquiryImpl.findTModel(ftm); GetOperationalInfo req = new GetOperationalInfo(); req.setAuthInfo(authInfoJoe); for (int i = 0; i < findTModel.getTModelInfos().getTModelInfo().size(); i++) { req.getEntityKey().add( findTModel.getTModelInfos().getTModelInfo().get(i).getTModelKey()); } OperationalInfos operationalInfo = uddiInquiryImpl.getOperationalInfo(req); for (int i = 0; i < operationalInfo.getOperationalInfo().size(); i++) { System.out.println(operationalInfo.getOperationalInfo().get(i).getEntityKey() + " on node " + operationalInfo.getOperationalInfo().get(i).getNodeID() + " is owned by " + operationalInfo.getOperationalInfo().get(i).getAuthorizedName()); } }
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."); } } }
ftm.setCategoryBag(new CategoryBag()); ftm.getCategoryBag().getKeyedReference().add(new KeyedReference("uddi:uddi.org:categorization:types", "uddi-org:types:findQualifier", "findQualifier")); TModelList findTModel = inquiry.findTModel(ftm);
/** * finds a tModel * * @param findTModel * @param node * @return null if not found or error * @throws RemoteException * @throws TransportException * @throws ConfigurationException */ public TModelList findTModel(FindTModel findTModel, Node node) throws RemoteException, TransportException, ConfigurationException { findTModel.setAuthInfo(getAuthToken(node.getSecurityUrl())); try { TModelList tModelList = getUDDINode(node).getTransport().getUDDIInquiryService(node.getInquiryUrl()).findTModel(findTModel); return tModelList; } catch (DispositionReportFaultMessage dr) { DispositionReport report = DispositionReportFaultMessage.getDispositionReport(dr); checkForErrorInDispositionReport(report, null, null); } catch (SOAPFaultException sfe) { DispositionReport report = DispositionReportFaultMessage.getDispositionReport(sfe); checkForErrorInDispositionReport(report, null, null); } catch (UndeclaredThrowableException ute) { DispositionReport report = DispositionReportFaultMessage.getDispositionReport(ute); checkForErrorInDispositionReport(report, null, null); }catch (Throwable t){ throw new RemoteException("Unhandled exception", t); } return null; }