Examples of TModelList


Examples of org.uddi.api_v3.TModelList

 
  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

Examples of org.uddi.api_v3.TModelList

      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.nanoTime() - startTime;
                        serviceCounter.update(InquiryQuery.FIND_TMODEL, QueryStatus.SUCCESS, procTime);                     
View Full Code Here

Examples of org.uddi.api_v3.TModelList

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

Examples of org.uddi.api_v3.TModelList

  public TModelList findTModel(FindTModel findTModel, Node node) throws RemoteException,
  TransportException, ConfigurationException  {
   
    findTModel.setAuthInfo(getAuthToken(node.getSecurityUrl()));
    try {
      TModelList tModelList = getUDDINode().getTransport().getUDDIInquiryService(node.getInquiryUrl()).findTModel(findTModel);
      return tModelList;
    } catch (DispositionReportFaultMessage dr) {
      DispositionReport report = DispositionReportFaultMessage.getDispositionReport(dr);
      checkForErrorInDispositionReport(report, null, null);
    } catch (SOAPFaultException sfe) {
View Full Code Here

Examples of org.uddi.api_v3.TModelList

                FindTModel fb = new FindTModel();
                fb.setMaxRows(1);
                fb.setName(new Name(UDDIConstants.WILDCARD, null));
                fb.setFindQualifiers(new FindQualifiers());
                fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                TModelList findTModel = inquiry.findTModel(fb);
                Assume.assumeTrue(findTModel != null);
                Assume.assumeTrue(findTModel.getTModelInfos() != null);
                Assume.assumeTrue(!findTModel.getTModelInfos().getTModelInfo().isEmpty());

                String url = manager.getClientConfig().getHomeNode().getInquiry_REST_Url();

                Assume.assumeNotNull(url);
               
                HttpClient client = new DefaultHttpClient();
               
                HttpGet httpGet = new HttpGet(url + "?tModelKey=" + findTModel.getTModelInfos().getTModelInfo().get(0).getTModelKey());
                logger.info("Fetching " + httpGet.getURI());
                HttpResponse response = client.execute(httpGet);
               
                Assert.assertTrue(response.getStatusLine().getStatusCode() == 200);
                logger.info("Response content: " + response.getEntity().getContent());
                TModel unmarshal = JAXB.unmarshal(response.getEntity().getContent(), TModel.class);
                client.getConnectionManager().shutdown();
                Assert.assertNotNull(unmarshal);
                Assert.assertEquals(unmarshal.getTModelKey(), findTModel.getTModelInfos().getTModelInfo().get(0).getTModelKey());


        }
View Full Code Here

Examples of org.uddi.api_v3.TModelList

        n.setValue("%JUDDI_571_Part3_Test%");
        fb.setName(n);
        fb.setFindQualifiers(new FindQualifiers());
        fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
        try {
            TModelList findTModel = inquiry.findTModel(fb);
            if (findTModel.getTModelInfos() != null) {
                for (int i = 0; i < findTModel.getTModelInfos().getTModelInfo().size(); i++) {
                    if (businesskeysToDelete.contains(findTModel.getTModelInfos().getTModelInfo().get(i).getTModelKey())) {
                        found1++;
                    }
                }
            }
        } catch (Exception ex) {
            HandleException(ex);
            Assert.fail("unexpected failure");
        }
        if (found1 != 2) {
            failuremsg += "No lang defined, " + found1 + " records found instead of 2";
        }



        found1 = 0;
        fb = new FindTModel();
        fb.setAuthInfo(authInfoJoe);
        n = new Name();
        n.setLang("en");
        n.setValue("%JUDDI_571_Part3_Test%");
        fb.setName(n);
        fb.setFindQualifiers(new FindQualifiers());
        fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
        try {
            TModelList findTModel = inquiry.findTModel(fb);
            if (findTModel.getTModelInfos() != null) {
                for (int i = 0; i < findTModel.getTModelInfos().getTModelInfo().size(); i++) {
                    if (businesskeysToDelete.contains(findTModel.getTModelInfos().getTModelInfo().get(i).getTModelKey())) {
                        found1++;
                    }
                }
            }
        } catch (Exception ex) {
View Full Code Here

Examples of org.uddi.api_v3.TModelList

        n.setValue("JUDDI_574");
        fb.setName(n);
        fb.setFindQualifiers(new FindQualifiers());
        fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
        try {
            TModelList findTModel = inquiry.findTModel(fb);
            if (findTModel.getTModelInfos() != null) {
                for (int i = 0; i < findTModel.getTModelInfos().getTModelInfo().size(); i++) {
                    if (businesskeysToDelete.contains(findTModel.getTModelInfos().getTModelInfo().get(i).getTModelKey())) {
                        found1++;
                        if (findTModel.getTModelInfos().getTModelInfo().get(i).getName() == null
                                || findTModel.getTModelInfos().getTModelInfo().get(i).getName().getLang() == null
                                || findTModel.getTModelInfos().getTModelInfo().get(i).getName().getLang().length() == 0) {
                            failuremsg += "Tmodel key " + findTModel.getTModelInfos().getTModelInfo().get(i).getTModelKey()
                                    + " has a null or empty lang";
                        }
                    }

                }
View Full Code Here

Examples of org.uddi.api_v3.TModelList

  @Test
  public void testJoePublisherTmodel() {
    tckTModel.saveJoePublisherTmodel(authInfoJoe, true);
   
    //Now if we use a finder it should be found.
    TModelList tModelList = tckTModel.findJoeTModelDetail();
    Assert.assertNotNull(tModelList.getTModelInfos());
   
    tckTModel.deleteJoePublisherTmodel(authInfoJoe);
   
    //Even if it deleted you should still be able to access it through a getTModelDetail
    TModelDetail detail = tckTModel.getJoePublisherTmodel(authInfoJoe);
    Assert.assertNotNull(detail.getTModel());
   
    //However if we use a finder it should not be found.
    TModelList tModelList2 = tckTModel.findJoeTModelDetail();
    Assert.assertNull(tModelList2.getTModelInfos());
   
    //Make sure none of the found key generators is Joe's key generator
    TModelList tModelList3 = tckTModel.findJoeTModelDetailByCategoryBag();
    for (TModelInfo tModelInfo : tModelList3.getTModelInfos().getTModelInfo()) {
      Assert.assertFalse("uddi:uddi.joepublisher.com:keygenerator".equals(tModelInfo.getTModelKey()));
    }
  }
View Full Code Here

Examples of org.uddi.api_v3.TModelList

        //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

Examples of org.uddi.api_v3.TModelList

        @Test
        public void testJoePublisherTmodel() {
                tckTModelJoe.saveJoePublisherTmodel(authInfoJoe, true);

                //Now if we use a finder it should be found.
                TModelList tModelList = tckTModelJoe.findJoeTModelDetail();
                Assert.assertNotNull(tModelList.getTModelInfos());

                tckTModelJoe.deleteJoePublisherTmodel(authInfoJoe);

                //Even if it deleted you should still be able to access it through a getTModelDetail
                TModelDetail detail = tckTModelJoe.getJoePublisherTmodel(authInfoJoe);
                Assert.assertNotNull(detail.getTModel());

                //However if we use a finder it should not be found.
                TModelList tModelList2 = tckTModelJoe.findJoeTModelDetail();
                Assert.assertNull(tModelList2.getTModelInfos());

                //Make sure none of the found key generators is Joe's key generator
                TModelList tModelList3 = tckTModelJoe.findJoeTModelDetailByCategoryBag();
                for (TModelInfo tModelInfo : tModelList3.getTModelInfos().getTModelInfo()) {
                        Assert.assertFalse("uddi:uddi.joepublisher.com:keygenerator".equals(tModelInfo.getTModelKey()));
                }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.