findTModel.setName(name); CategoryBag categoryBag = new CategoryBag();
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) {
/** * Builds a finder to find the portType tModels for a portType. * * @param portTypeName * @param namespace * @return tModel info */ public static FindTModel createFindPortTypeTModelForPortType(String portTypeName, String namespace) { FindTModel findTModel = new FindTModel(); Name name = new Name(); name.setLang("en"); name.setValue(portTypeName); findTModel.setName(name); CategoryBag categoryBag = new CategoryBag(); if (namespace != null && namespace.length() != 0) { KeyedReference namespaceReference = newKeyedReference( "uddi:uddi.org:xml:namespace", "uddi-org:xml:namespace", namespace); categoryBag.getKeyedReference().add(namespaceReference); } KeyedReference bindingReference = newKeyedReference( "uddi:uddi.org:wsdl:types", "uddi-org:wsdl:types", "portType"); categoryBag.getKeyedReference().add(bindingReference); findTModel.setCategoryBag(categoryBag); if (log.isDebugEnabled()) { log.debug(new PrintUDDI<FindTModel>().print(findTModel)); } return findTModel; }
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()); } }
request.setName(jaxbName);
public static FindTModel MapFindTModel(org.uddi.api_v2.FindTModel body) { if (body == null) { return null; } FindTModel r = new FindTModel(); r.setCategoryBag(MapCategoryBag(body.getCategoryBag())); r.setFindQualifiers(MapFindQualifiers(body.getFindQualifiers(),false)); r.setMaxRows(body.getMaxRows()); if (body.getName() != null) { r.setName(new Name(body.getName().getValue(), body.getName().getLang())); } if (ContainsWildCardSingle(r.getName())) { r.setFindQualifiers(AddApproximateMatch(r.getFindQualifiers())); } return r; }