Package org.uddi.api_v2

Examples of org.uddi.api_v2.TModelList


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


      org.apache.juddi.query.util.FindQualifiers findQualifiers = new org.apache.juddi.query.util.FindQualifiers();
      findQualifiers.mapApiFindQualifiers(body.getFindQualifiers());

      List<?> keysFound = InquiryHelper.findTModel(body, findQualifiers, em);

      TModelList result = InquiryHelper.getTModelListFromKeys(body, findQualifiers, em, keysFound);

      tx.rollback();
                        long procTime = System.currentTimeMillis() - startTime;
                        serviceCounter.update(InquiryQuery.FIND_TMODEL, QueryStatus.SUCCESS, procTime);                     
View Full Code Here

          // 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.
          TModelList tmodelList = InquiryHelper.getTModelListFromKeys(ft, findQualifiers, em, currentMatchingKeys,
                                        startPointDate, endPointDate, subscriptionStartIndex, modelSubscription.getMaxEntities());
 
          // Upon exiting above function, if more results are to be had, the subscriptionStartIndex will contain the latest value (or null
          // if no more results)
          chunkData = subscriptionStartIndex.value;
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)
        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");
View Full Code Here

  }
 
  public static TModelList getTModelListFromKeys(FindTModel body, FindQualifiers findQualifiers, EntityManager em, List<?> keysFound,
                           Date modifiedAfter, Date modifiedBefore, Holder<Integer> subscriptionStartIndex, Integer subscriptionMaxRows)
           throws DispositionReportFaultMessage {
    TModelList result = new TModelList();
    ListDescription listDesc = new ListDescription();
    result.setListDescription(listDesc);

    // Sort and retrieve the final results taking paging into account
    List<?> queryResults = FetchTModelsQuery.select(em, findQualifiers, keysFound, body.getMaxRows(), body.getListHead(), listDesc);
    if (queryResults != null && queryResults.size() > 0)
      result.setTModelInfos(new org.uddi.api_v3.TModelInfos());
   
    // Set the currentIndex to 0 or the value of the subscriptionStartIndex
    int currentIndex = 0;
    if (subscriptionStartIndex != null && subscriptionStartIndex.value != null)
      currentIndex = subscriptionStartIndex.value;

    int returnedRowCount = 0;
   
    while (queryResults!=null && currentIndex < queryResults.size()) {
      Object item = queryResults.get(currentIndex);
     
      org.apache.juddi.model.Tmodel modelTModel = (org.apache.juddi.model.Tmodel)item;
      org.uddi.api_v3.TModelInfo apiTModelInfo = new org.uddi.api_v3.TModelInfo();
     
      if (modifiedAfter != null && modifiedAfter.after(modelTModel.getModifiedIncludingChildren())) {
        currentIndex++;
        continue;
      }
     
      if (modifiedBefore != null && modifiedBefore.before(modelTModel.getModifiedIncludingChildren())) {
        currentIndex++;
        continue;
      }
     
      MappingModelToApi.mapTModelInfo(modelTModel, apiTModelInfo);
     
      result.getTModelInfos().getTModelInfo().add(apiTModelInfo);
     
      returnedRowCount++;
      // If the returned rows equals the max allowed, we can end the loop (applies to subscription calls only)
      if (subscriptionMaxRows != null) {
        if (returnedRowCount == subscriptionMaxRows)
          break;
      }
     
      currentIndex++;
    }
   
    // If the loop was broken prematurely (max row count hit) we set the subscriptionStartIndex to the next index to start with.
    // Otherwise, set it to null so the subscription call won't trigger chunk token generation.
    if (queryResults!=null && currentIndex < (queryResults.size() - 1)) {
      if (subscriptionStartIndex != null)
        subscriptionStartIndex.value = currentIndex + 1;
      result.setTruncated(Boolean.TRUE);
    }
    else {
      if (subscriptionStartIndex != null)
        subscriptionStartIndex.value = null;
      result.setTruncated(Boolean.FALSE);
    }
   
    return result;
  }
View Full Code Here

      getSubResultsIn.setAuthInfo(authInfoSam);
                        FindTModel ftm = new FindTModel();
                        ftm.setAuthInfo(authInfoSam);
                        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);
     
                        FINDQUALIFIER_TMODEL_TOTAL = findTModel.getListDescription().getActualCount();
                       
      Subscription subIn = (Subscription)EntityCreator.buildFromDoc(SAM_SUBSCRIPTION2_XML, "org.uddi.sub_v3");
     
      int expectedIterations = FINDQUALIFIER_TMODEL_TOTAL / subIn.getMaxEntities();
      if (FINDQUALIFIER_TMODEL_TOTAL % subIn.getMaxEntities() >0)
        expectedIterations++;
     
                       
                        logger.info("getSamSyndicatorSubscriptionResultsWithChunkingOnFind loading from " + SAM_SUBSCRIPTION2_XML + " expecting " + FINDQUALIFIER_TMODEL_TOTAL + " find qualifier tmodels. Fetching "
                        + subIn.getMaxEntities() + " at a time, expected iterations " + expectedIterations);
     
      String chunkToken = "";
      int iterations = 0;
                        //JUDDI-655
      while (chunkToken != null && !chunkToken.equalsIgnoreCase("0")) {
        iterations++;
                               
        getSubResultsIn.setChunkToken(chunkToken);
        SubscriptionResultsList result = subscription.getSubscriptionResults(getSubResultsIn);
        if (result == null)
          Assert.fail("Null result from getSubscriptionResults operation");
        Assert.assertNotNull("Chunk token should either be not null or '0'",result.getChunkToken());
        TModelList tmodelList = result.getTModelList();
        if (tmodelList == null || tmodelList.getTModelInfos()==null)
          Assert.fail("No result from getSubscriptionResults operation on chunk attempt " + iterations);

        int resultSize = tmodelList.getTModelInfos().getTModelInfo().size();
       
        if (iterations < expectedIterations)
          assertEquals(resultSize, subIn.getMaxEntities().intValue());
        else {
          if (FINDQUALIFIER_TMODEL_TOTAL % subIn.getMaxEntities() > 0)
View Full Code Here

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

      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();

        return tml;
View Full Code Here

        //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());
                      }
                    }
                    //delete the PortType TModel
View Full Code Here

          // 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.
          TModelList tmodelList = InquiryHelper.getTModelListFromKeys(ft, findQualifiers, em, currentMatchingKeys,
                                        startPointDate, endPointDate, subscriptionStartIndex, modelSubscription.getMaxEntities());
 
          // Upon exiting above function, if more results are to be had, the subscriptionStartIndex will contain the latest value (or null
          // if no more results)
          chunkData = subscriptionStartIndex.value;
View Full Code Here

TOP

Related Classes of org.uddi.api_v2.TModelList

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.