Package org.uddi.api_v2

Examples of org.uddi.api_v2.BusinessList


      fb.setFindQualifiers(fq);
      Name searchname = new Name();
      searchname.setValue(UDDIConstants.WILDCARD);
      fb.getName().add(searchname);
      BusinessList findBusiness = inquiry.findBusiness(fb);
      return findBusiness;

   }
View Full Code Here


        System.out.println("saving...");
        SaveTM(createKeyGenator, uddi);


        System.out.println("fetching business list");
        BusinessList before = getBusinessList(uddi);
        if (before.getBusinessInfos() == null) {
            System.out.println("before no businesses returned!");
            before.setBusinessInfos(new BusinessInfos());
        } else {
            System.out.println(before.getBusinessInfos().getBusinessInfo().size() + " businesses returned before");
        }

        System.out.println("saving mary");
        SaveMary(uddi);

        BusinessList after = getBusinessList(uddi);
        if (after.getBusinessInfos() == null) {
            System.out.println("after no businesses returned!");
            after.setBusinessInfos(new BusinessInfos());
        } else {
            System.out.println(after.getBusinessInfos().getBusinessInfo().size() + " businesses returned after");
        }
        PrintUDDI<BusinessList> p = new PrintUDDI<BusinessList>();
        if (before.getBusinessInfos().getBusinessInfo().size()
                < after.getBusinessInfos().getBusinessInfo().size()) {
            System.out.println("hey it worked as advertised, double checking");
            if (CheckFor(after, "uddi:uddi.marypublisher.com:marybusinessone")) {
                System.out.println("ok!");
            } else {
                System.out.println("no good!");
View Full Code Here

        public void Browse(String[] args) {
                try {

                        String token = GetAuthKey("uddi", "uddi");
                        BusinessList findBusiness = GetBusinessList(token);
                        PrintBusinessInfo(findBusiness.getBusinessInfos());
                        PrintBusinessDetails(findBusiness.getBusinessInfos(), token);
                        PrintServiceDetailsByBusiness(findBusiness.getBusinessInfos(), token);

                        security.discardAuthToken(new DiscardAuthToken(token));

                } catch (Exception e) {
                        e.printStackTrace();
View Full Code Here

                fb.setFindQualifiers(fq);
                Name searchname = new Name();
                searchname.setValue(UDDIConstants.WILDCARD);
                fb.getName().add(searchname);
                BusinessList findBusiness = inquiry.findBusiness(fb);
                return findBusiness;

        }
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();
      return result;
    } finally {
      if (tx.isActive()) {
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

      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

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

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.