Package org.uddi.api_v2

Examples of org.uddi.api_v2.FindTModel


                System.out.println("Done with businesses. Export count: " + sb.getBusinessEntity().size());
        }

        private void ExportTmodels() throws Exception {
                FileOutputStream fos = new FileOutputStream(tmodelfile);
                FindTModel req = new FindTModel();
                req.setName(new Name(UDDIConstants.WILDCARD, null));
                req.setAuthInfo(token);
                req.setFindQualifiers(new FindQualifiers());
                req.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                int offset = 0;
                int maxrows = 100;

                req.setMaxRows(maxrows);
                req.setListHead(offset);
                TModelList findTModel = null;
                SaveTModel stm = new SaveTModel();
                do {
                        findTModel = inquiry.findTModel(req);
                        if (findTModel.getTModelInfos() != null) {
                                for (int i = 0; i < findTModel.getTModelInfos().getTModelInfo().size(); i++) {
                                        boolean go = true;
                                        String owner = Common.GetOwner(findTModel.getTModelInfos().getTModelInfo().get(i).getTModelKey(), token, inquiry);
                                        if (owner!=null && !usernames.contains(owner)) {
                                                usernames.add(owner);
                                        }
                                        if (myitemsonly) {
                                                if (owner == null || !owner.equalsIgnoreCase(username)) {
                                                        go = false;
                                                }
                                        }
                                        if (go) {
                                                if (owner!=null)
                                                      mapping.setProperty(findTModel.getTModelInfos().getTModelInfo().get(i).getTModelKey(), owner);
                                                System.out.println("Exporting " + findTModel.getTModelInfos().getTModelInfo().get(i).getTModelKey() + " owner " + owner);
                                                stm.getTModel().add(GetTmodel(findTModel.getTModelInfos().getTModelInfo().get(i), token));
                                        }
                                }
                        }
                        offset = offset + maxrows;
                        req.setListHead(offset);
                } while (false);//findTModel.getListDescription().getIncludeCount() > 0);
               
                if (stripSig) {
                        int x=0;
                        for (int i = 0; i < stm.getTModel().size(); i++) {
View Full Code Here


   * @exception RegistryV3Exception;
   */
  public TModelList findTModel(String name, CategoryBag categoryBag,
      IdentifierBag identifierBag, FindQualifiers findQualifiers,
      int maxRows) throws RegistryV3Exception {
    FindTModel request = this.objectFactory.createFindTModel();

    Name jaxbName = this.objectFactory.createName();

    if (name != null) {
      jaxbName.setValue(name);
    }

    request.setName(jaxbName);

    if (categoryBag != null) {
      request.setCategoryBag(categoryBag);
    }

    if (identifierBag != null) {
      request.setIdentifierBag(identifierBag);
    }

    if (findQualifiers != null) {
      request.setFindQualifiers(findQualifiers);
    }

    request.setMaxRows(maxRows);

        TModelList tml = null;
        JAXBElement<?> o = execute(this.objectFactory.createFindTModel(request),
            this.getInquiryURI());
        if (o !=null) tml = (TModelList) o.getValue();
View Full Code Here

  }
 
  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) {
View Full Code Here

    }
  }
 
  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)
View Full Code Here

  }
 
  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) {
View Full Code Here

     * @param processName
     * @return
     */
    public static FindTModel createFindBindingTModelForPortType(String portType, String namespace) {

        FindTModel findTModel = new FindTModel();
        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", "binding");
        categoryBag.getKeyedReference().add(bindingReference);

        KeyedReference portTypeReference = newKeyedReference(
                "uddi:uddi.org:wsdl:porttypereference", "uddi-org:wsdl:portTypeReference", portType);
        categoryBag.getKeyedReference().add(portTypeReference);

        findTModel.setCategoryBag(categoryBag);

        if (log.isDebugEnabled()) {
            log.debug(new PrintUDDI<FindTModel>().print(findTModel));
        }
        return findTModel;
View Full Code Here

     * @param processName
     * @return
     */
    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;
View Full Code Here

            resultsKeyBag.getTModelKey().add(key);
         
          result.getKeyBag().add(resultsKeyBag);
        }
        else {
          FindTModel ft = subscriptionFilter.getFindTModel();
          org.apache.juddi.query.util.FindQualifiers findQualifiers = new org.apache.juddi.query.util.FindQualifiers();
          findQualifiers.mapApiFindQualifiers(ft.getFindQualifiers());
 
          // To do subscription "chunking", the listHead and maxRows are nulled which will set them to system default.  User settings for
          // these values don't make sense with the "chunking" feature.
          ft.setListHead(null);
          ft.setMaxRows(null);
          // Setting the start index to the chunkData
          Holder<Integer> subscriptionStartIndex = new Holder<Integer>(chunkData);
         
          // If more results are to be had, chunkData will come out with a value and a new token will be generated below.  Otherwise, it will
          // be null and no token will be generated.
View Full Code Here

        clerk.unRegisterBinding(bindingKey);
        //if this is the last binding for this service, and
        if (service.getBindingTemplates().getBindingTemplate().size()==1 && isRemoveServiceIfNoTemplates) {
          clerk.unRegisterService(serviceKey);
         
          FindTModel findTmodelForProcessName = createFindTModelForProcessName(serviceName);
          TModelList tModelList = clerk.findTModel(findTmodelForProcessName);
          if (tModelList!=null && tModelList.getTModelInfos()!=null && tModelList.getTModelInfos().getTModelInfo()!=null) {
            TModelInfo tModelInfo = tModelList.getTModelInfos().getTModelInfo().get(0);
            String bpel4WSTModelKey = tModelInfo.getTModelKey();
            clerk.unRegisterTModel(bpel4WSTModelKey);
            // now use this key to find the portType TModels
            GetTModelDetail findAllPortTypesForProcess = createFindAllPortTypesForProcess_1(bpel4WSTModelKey);
            TModelDetail tModelDetail = clerk.getTModelDetail(findAllPortTypesForProcess);
            if (tModelDetail!=null) {
              List<TModel> tModelPortTypeList = tModelDetail.getTModel();
              if (tModelPortTypeList!=null && tModelPortTypeList.size()>0) {
                TModel bpel4WSTModel = tModelPortTypeList.get(0);
                CategoryBag categoryBag = bpel4WSTModel.getCategoryBag();
                if (categoryBag!=null && categoryBag.getKeyedReference()!=null) {
                  List<KeyedReference> portTypeTModelKeys = new ArrayList<KeyedReference>();
                  KeyedReference namespaceRef = null;
                  for (KeyedReference keyedReference : categoryBag.getKeyedReference()) {
                    if ("uddi:uddi.org:wsdl:porttypereference".equals(keyedReference.getTModelKey()) ) {
                      portTypeTModelKeys.add(keyedReference);
                    }
                    if ("uddi:uddi.org:xml:namespace".equals(keyedReference.getTModelKey()) ) {
                      namespaceRef = keyedReference;
                    }
                  }
                  String namespace = null;
                  if (namespaceRef!=null) namespace = namespaceRef.getKeyValue();
                  //find the bindingTModel
                  for (KeyedReference keyedReference : portTypeTModelKeys) {
                    FindTModel findBindingTModel = WSDL2UDDI.createFindBindingTModelForPortType(keyedReference.getKeyValue(), namespace);
                    TModelList bindingTmodels = clerk.findTModel(findBindingTModel);
                    if (bindingTmodels!=null && bindingTmodels.getTModelInfos()!=null && bindingTmodels.getTModelInfos().getTModelInfo()!=null) {
                      for (TModelInfo bindingTModelInfo : bindingTmodels.getTModelInfos().getTModelInfo()) {
                        //delete the Binding TModel
                        clerk.unRegisterTModel(bindingTModelInfo.getTModelKey());
View Full Code Here

     * @param processName
     * @return
     */
    public FindTModel createFindTModelForProcessName (QName serviceName) {
     
      FindTModel findTModel = new FindTModel();
      Name name = new Name();
      //name.setLang(lang);
      name.setValue(serviceName.getLocalPart());
      findTModel.setName(name);
      CategoryBag categoryBag = new CategoryBag();
     
      String namespace = serviceName.getNamespaceURI();
      if (namespace!=null && namespace!="") {
        KeyedReference namespaceReference = WSDL2UDDI.newKeyedReference(
          "uddi:uddi.org:xml:namespace", "uddi-org:xml:namespace", namespace);
        categoryBag.getKeyedReference().add(namespaceReference);
      }
      KeyedReference typesReference = WSDL2UDDI.newKeyedReference(
          "uddi:uddi.org:bpel:types", "uddi-org:bpel:types", "process");
      categoryBag.getKeyedReference().add(typesReference);
      findTModel.setCategoryBag(categoryBag);
     
      if (log.isDebugEnabled()) {
        log.debug(new PrintUDDI<FindTModel>().print(findTModel));
      }
      return findTModel;
View Full Code Here

TOP

Related Classes of org.uddi.api_v2.FindTModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.