Package org.uddi.api_v2

Examples of org.uddi.api_v2.BusinessList


          fb.setListHead(null);
          fb.setMaxRows(null);
          // Setting the start index to the chunkData
          Holder<Integer> subscriptionStartIndex = new Holder<Integer>(chunkData);
         
          BusinessList businessList = InquiryHelper.getBusinessListFromKeys(fb, 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 findBusiness() {
    try {
      FindBusiness body = (FindBusiness)EntityCreator.buildFromDoc(FIND_BUSINESS_XML, "org.uddi.api_v3");
      BusinessList result = inquiry.findBusiness(body);
      if (result == null)
        Assert.fail("Null result from find business operation");
      BusinessInfos bInfos = result.getBusinessInfos();
      if (bInfos == null)
        Assert.fail("No result from find business operation");
      List<BusinessInfo> biList = bInfos.getBusinessInfo();
      if (biList == null || biList.size() == 0)
        Assert.fail("No result from find business operation");
View Full Code Here

  }
 
  public void findAllBusiness() {
    try {
      FindBusiness body = (FindBusiness)EntityCreator.buildFromDoc(FIND_ALL_BUSINESSES_XML, "org.uddi.api_v3");
      BusinessList result = inquiry.findBusiness(body);
      if (result == null)
        Assert.fail("Null result from find business operation");
      BusinessInfos bInfos = result.getBusinessInfos();
      if (bInfos == null)
        Assert.fail("No result from find business operation");
      List<BusinessInfo> biList = bInfos.getBusinessInfo();
      if (biList == null || biList.size() == 0)
        Assert.fail("No result from find business operation");
View Full Code Here

 
  public List<BusinessInfo> findAllSignedBusiness() {
    List<BusinessInfo> biList = null;
    try {
      FindBusiness body = (FindBusiness)EntityCreator.buildFromDoc(FIND_ALL_SIGNED_BUSINESSES_XML, "org.uddi.api_v3");
      BusinessList result = inquiry.findBusiness(body);
      if (result == null)
        Assert.fail("Null result from find business operation");
      BusinessInfos bInfos = result.getBusinessInfos();
      if (bInfos == null)
        Assert.fail("No result from find business operation");
      biList = bInfos.getBusinessInfo();
      if (biList == null || biList.size() == 0)
        Assert.fail("No result from find business operation");
View Full Code Here

                fs.setAuthInfo(authinfo);
                fs.setFindQualifiers(new FindQualifiers());
                fs.getFindQualifiers().getFindQualifier().add("approximateMatch");
                fs.getName().add(new Name("%", null));
                try {
                        BusinessList findService = inquriy.findBusiness(fs);
                        if (findService.getBusinessInfos() == null) {
                                return ("NO BUSINESSES RETURNED!");
                        } else {
                                for (int i = 0; i < findService.getBusinessInfos().getBusinessInfo().size(); i++) {
                                        sb.append(findService.getBusinessInfos().getBusinessInfo().get(i).getName().get(0).getValue()).
                                                append(" lang=").append(findService.getBusinessInfos().getBusinessInfo().get(i).getName().get(0).getLang()).
                                                append(" ").append(findService.getBusinessInfos().getBusinessInfo().get(i).getBusinessKey())
                                                .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.findBusiness(body, findQualifiers, em);

      BusinessList result = InquiryHelper.getBusinessListFromKeys(body, findQualifiers, em, keysFound);

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

   * different from the deleted business key.
   */
  @Override
  protected void postValidate() throws Exception
  {
    BusinessList businessList;
   
    Name name = new Name();
    name.setValue(businessEntity.getName().get(0).getValue());
    name.setLang(businessEntity.getName().get(0).getLang());
   
    FindBusiness findBusiness = new FindBusiness();
    findBusiness.getName().add(name);
   
    inqueryService = JUDDIServiceProvider.getInquiryService();
    businessList = inqueryService.findBusiness(findBusiness);
    try
    {
      Assert.assertNull("A non-null BusinessInfos object was retured in a search for the name of a " +
          "bussiness item that should previously have been deleted", businessList.getBusinessInfos());
    }
    catch(AssertionError e)
    {
      for (BusinessInfo bi: businessList.getBusinessInfos().getBusinessInfo())
      {
        Assert.assertFalse("A business with the same name and business key of the business that should " +
          "have been deleted has been found", bi.getBusinessKey()  .equals(businessEntity.getBusinessKey()));
      }
     
View Full Code Here

    findBusiness.setAuthInfo(authenticationToken.getAuthInfo());
    findBusiness.getName().add(q);
    findBusiness.setFindQualifiers(findQualifiers);
    findBusiness.setMaxRows(max);

    BusinessList businessList = inquiryService.findBusiness(findBusiness);
    businessInfos = businessList.getBusinessInfos();

    //Print out the names of the returned businesses
    for (BusinessInfo bi : businessInfos.getBusinessInfo()) {
      if (businessInfo == null) {
        businessInfo = bi;
View Full Code Here

          fb.setListHead(null);
          fb.setMaxRows(null);
          // Setting the start index to the chunkData
          Holder<Integer> subscriptionStartIndex = new Holder<Integer>(chunkData);
         
          BusinessList businessList = InquiryHelper.getBusinessListFromKeys(fb, 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 static BusinessList getBusinessListFromKeys(FindBusiness body, FindQualifiers findQualifiers, EntityManager em, List<?> keysFound,
                             Date modifiedAfter, Date modifiedBefore, Holder<Integer> subscriptionStartIndex, Integer subscriptionMaxRows)
           throws DispositionReportFaultMessage {

    BusinessList result = new BusinessList();
    ListDescription listDesc = new ListDescription();
    result.setListDescription(listDesc);

    // Sort and retrieve the final results taking paging into account
    List<?> queryResults = FetchBusinessEntitiesQuery.select(
        em, findQualifiers, keysFound, body.getMaxRows(), body.getListHead(), listDesc);
     
    if (queryResults != null && queryResults.size() > 0)
      result.setBusinessInfos(new org.uddi.api_v3.BusinessInfos());
   
    // 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.BusinessEntity modelBusinessEntity = (org.apache.juddi.model.BusinessEntity)item;
      org.uddi.api_v3.BusinessInfo apiBusinessInfo = new org.uddi.api_v3.BusinessInfo();
     
      if (modifiedAfter != null && modifiedAfter.after(modelBusinessEntity.getModifiedIncludingChildren())){
        currentIndex++;
        continue;
      }
     
      if (modifiedBefore != null && modifiedBefore.before(modelBusinessEntity.getModifiedIncludingChildren())) {
        currentIndex++;
        continue;
      }
     
      MappingModelToApi.mapBusinessInfo(modelBusinessEntity, apiBusinessInfo);
     
      result.getBusinessInfos().getBusinessInfo().add(apiBusinessInfo);

      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

TOP

Related Classes of org.uddi.api_v2.BusinessList

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.