Package org.uddi.api_v2

Examples of org.uddi.api_v2.BusinessList


     
      tckBusiness.saveBusinesses(authInfoTom, TOM_BUSINESS_XML, TOM_BUSINESS_KEY, 1);
     
      try {
        int size = 0;
        BusinessList bl = null;
 
        FindBusiness fbb = new FindBusiness();
        TModelBag tmb = new TModelBag();
        tmb.getTModelKey().add(TOM_PUBLISHER_TMODEL01_KEY);
        fbb.setTModelBag(tmb);
        bl = inquiry.findBusiness(fbb);
        size = bl.getBusinessInfos().getBusinessInfo().size();
        if (size != 1) {
          Assert.fail("Should have found one entry on FindBusiness with TModelBag, "
              + "found " + size);
        } else {
          List<BusinessInfo> biList = bl.getBusinessInfos().getBusinessInfo();
          if (biList.get(0).getServiceInfos().getServiceInfo().size() != 1) {
            Assert.fail("Should have found only one ServiceInfo");
          } else {
              List<ServiceInfo> siList = biList.get(0).getServiceInfos().getServiceInfo();
              ServiceInfo si = siList.get(0);
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

      logger.debug("FindBusiness " + findBusiness + " sending findBusinesses request..");
      List<Business> businesses = new ArrayList<Business>();
     
      Transport transport = WebHelper.getTransport(session.getServletContext());
      UDDIInquiryPortType inquiryService = transport.getUDDIInquiryService();
      BusinessList businessList = inquiryService.findBusiness(findBusiness);
      for (BusinessInfo businessInfo : businessList.getBusinessInfos().getBusinessInfo()) {
        Business business = new Business(
            businessInfo.getBusinessKey(),
            EntityForLang.getName(businessInfo.getName(),lang).getValue(),
            EntityForLang.getDescription(businessInfo.getDescription(),lang).getValue());
        List<Service> services = new ArrayList<Service>();
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 (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)
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

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

  @SuppressWarnings("unchecked")
  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);
    List<?> serviceResults = null;
    for (int i = 0; i<queryResults.size(); i++) {
      org.apache.juddi.model.BusinessEntity be = (org.apache.juddi.model.BusinessEntity) queryResults.get(i);
     
      List<Object> keysIn = new ArrayList<Object>();
      List<org.apache.juddi.model.BusinessService> services = be.getBusinessServices();
      for (int j = 0; j<services.size(); j++) {
        keysIn.add(services.get(j).getEntityKey());
      }

      serviceResults = FindServiceByTModelKeyQuery.select(em, findQualifiers, body.getTModelBag(), null, keysIn);
      if (serviceResults == null) {
        be.setBusinessServices(null);
      } else {
        ListDescription ldesc = new ListDescription();
        result.setListDescription(listDesc);
        List<?> srvcs = FetchBusinessServicesQuery.select(em, findQualifiers, serviceResults, body.getMaxRows(),
            body.getListHead(), ldesc);
        be.setBusinessServices((List<org.apache.juddi.model.BusinessService>)srvcs);
      }
    }
     
    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 (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)
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);
    List<?> serviceResults = null;
    for (int i = 0; i<queryResults.size(); i++) {
      org.apache.juddi.model.BusinessEntity be = (org.apache.juddi.model.BusinessEntity) queryResults.get(i);
     
      List<Object> keysIn = new ArrayList<Object>();
      List<org.apache.juddi.model.BusinessService> services = be.getBusinessServices();
      for (int j = 0; j<services.size(); j++) {
        keysIn.add(services.get(j).getEntityKey());
      }

      serviceResults = FindServiceByTModelKeyQuery.select(em, findQualifiers, body.getTModelBag(), null, keysIn);
      if (serviceResults == null) {
        be.setBusinessServices(null);
      } else {
        ListDescription ldesc = new ListDescription();
        result.setListDescription(listDesc);
        List<?> srvcs = FetchBusinessServicesQuery.select(em, findQualifiers, serviceResults, body.getMaxRows(),
            body.getListHead(), ldesc);
        be.setBusinessServices((List<org.apache.juddi.model.BusinessService>)srvcs);
      }
    }
     
    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 (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)
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.commit();
      return result;
    } finally {
      if (tx.isActive()) {
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.