Package org.uddi.api_v3

Examples of org.uddi.api_v3.ServiceList


          fs.setListHead(null);
          fs.setMaxRows(null);
          // Setting the start index to the chunkData
          Holder<Integer> subscriptionStartIndex = new Holder<Integer>(chunkData);
 
          ServiceList serviceList = InquiryHelper.getServiceListFromKeys(fs, findQualifiers, em, currentMatchingKeys,
                                           startPointDate, endPointDate, subscriptionStartIndex, modelSubscription.getMaxEntities());
          if (serviceList.getServiceInfos()==null || serviceList.getServiceInfos().getServiceInfo().size()==0) {
            serviceList=null;
          }
          // 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 String findService(String findQualifier) {
    String serviceKey = null;
    try {
      FindService body = (FindService)EntityCreator.buildFromDoc(FIND_SERVICE_XML, "org.uddi.api_v3");
      if (findQualifier!=null) body.getFindQualifiers().getFindQualifier().add(findQualifier);
      ServiceList result = inquiry.findService(body);
      if (result == null)
        Assert.fail("Null result from find service operation");
      ServiceInfos sInfos = result.getServiceInfos();
      if (sInfos == null)
        Assert.fail("No result from find service operation");
      List<ServiceInfo> siList = sInfos.getServiceInfo();
      if (siList == null || siList.size() == 0)
        Assert.fail("No result from find service operation");
View Full Code Here

 
  public String findService_CombinedCatBag() {
    String serviceKey = null;
    try {
      FindService body = (FindService)EntityCreator.buildFromDoc(COMBINE_CAT_FIND_SERVICES, "org.uddi.api_v3");
      ServiceList result = inquiry.findService(body);
      if (result == null)
        Assert.fail("Null result from find service operation");
      ServiceInfos sInfos = result.getServiceInfos();
      if (sInfos == null)
        Assert.fail("No result from find service operation");
      List<ServiceInfo> siList = sInfos.getServiceInfo();
      if (siList == null || siList.size() == 0)
        Assert.fail("No result from find service operation");
View Full Code Here

                fs.setAuthInfo(authinfo);
                fs.setFindQualifiers(new FindQualifiers());
                fs.getFindQualifiers().getFindQualifier().add("approximateMatch");
                fs.getName().add(new Name("%", null));
                try {
                        ServiceList findService = inquiry.findService(fs);
                        if (findService.getServiceInfos() == null) {
                                return ("NO SERVICES RETURNED!");
                        } else {
                                for (int i = 0; i < findService.getServiceInfos().getServiceInfo().size(); i++) {
                                        sb.append(findService.getServiceInfos().getServiceInfo().get(i).getName().get(0).getValue()).append(" lang=").append(findService.getServiceInfos().getServiceInfo().get(i).getName().get(0).getLang()).append(" ").append(findService.getServiceInfos().getServiceInfo().get(i).getServiceKey()).append(" ").append(findService.getServiceInfos().getServiceInfo().get(i).getBusinessKey()).append(
                                                System.getProperty("line.separator"));
                                }
                        }
                } catch (Exception ex) {
                        sb.append(ex.getMessage());
View Full Code Here

                          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.BusinessNotFound", businessKey));
                      }
                }
            }

      ServiceList result = InquiryHelper.getServiceListFromKeys(body, findQualifiers, em, keysFound);

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

          fs.setListHead(null);
          fs.setMaxRows(null);
          // Setting the start index to the chunkData
          Holder<Integer> subscriptionStartIndex = new Holder<Integer>(chunkData);
 
          ServiceList serviceList = InquiryHelper.getServiceListFromKeys(fs, findQualifiers, em, currentMatchingKeys,
                                           startPointDate, endPointDate, subscriptionStartIndex, modelSubscription.getMaxEntities());
          if (serviceList.getServiceInfos()==null || serviceList.getServiceInfos().getServiceInfo().size()==0) {
            serviceList=null;
          }
          // 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 ServiceList getServiceListFromKeys(FindService body, FindQualifiers findQualifiers, EntityManager em, List<?> keysFound,
                           Date modifiedAfter, Date modifiedBefore, Holder<Integer> subscriptionStartIndex, Integer subscriptionMaxRows)
           throws DispositionReportFaultMessage {
    ServiceList result = new ServiceList();
    ListDescription listDesc = new ListDescription();
    result.setListDescription(listDesc);
   
    // Sort and retrieve the final results taking paging into account
    List<?> queryResults = FetchBusinessServicesQuery.select(em, findQualifiers, keysFound, body.getMaxRows(), body.getListHead(), listDesc);
    if (queryResults != null && queryResults.size() > 0)
      result.setServiceInfos(new org.uddi.api_v3.ServiceInfos());

    // 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;
    if (logger.isDebugEnabled()) logger.debug("Period = " + modifiedAfter + " ---- " + modifiedBefore);
    while (queryResults!=null && currentIndex < queryResults.size()) {
      Object item = queryResults.get(currentIndex);

      org.apache.juddi.model.BusinessService modelBusinessService = (org.apache.juddi.model.BusinessService)item;
      org.uddi.api_v3.ServiceInfo apiServiceInfo = new org.uddi.api_v3.ServiceInfo();
     
      logger.debug(modelBusinessService.getEntityKey() + " is modified " + modelBusinessService.getModifiedIncludingChildren() + " " + modelBusinessService.getModifiedIncludingChildren().getTime() );
      if (modifiedAfter != null && modifiedAfter.after(modelBusinessService.getModifiedIncludingChildren())) {
        currentIndex++;
        continue;
      }
     
      if (modifiedBefore != null && modifiedBefore.before(modelBusinessService.getModifiedIncludingChildren())) {
        currentIndex++;
        continue;
      }
      MappingModelToApi.mapServiceInfo(modelBusinessService, apiServiceInfo);
     
      result.getServiceInfos().getServiceInfo().add(apiServiceInfo);

      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

    FindService findService = new FindService();
    findService.getName().add(name);
    findService.setBusinessKey(businessKey);
   
    inqueryService = JUDDIServiceProvider.getInquiryService();
    ServiceList serviceList = inqueryService.findService(findService);
   
    try
    {
      Assert.assertNull("A non-null ServiceInfos object was retured in a search for the name of a " +
          "service item that should previously have been deleted", serviceList.getServiceInfos());
    }
    catch(AssertionError e)
    {
      for (ServiceInfo si: serviceList.getServiceInfos().getServiceInfo())
      {
        Assert.assertFalse("A service with the same name and service key of the service that should " +
          "have been deleted has been found", si.getServiceKey().equals(serviceKey));
      }
     
View Full Code Here

    findService.setAuthInfo(authenticationToken.getAuthInfo());
    findService.getName().add(r);
    findService.setFindQualifiers(findQualifiers);
    findService.setMaxRows(maxServ);
   
    ServiceList serviceList = inquiryService.findService(findService);
    serviceInfos = serviceList.getServiceInfos();
   
    //ServiceInfo serviceInfo = null;
   
    //serviceInfo becomes the first service found?
    for (ServiceInfo si : serviceInfos.getServiceInfo())
View Full Code Here

      request.setFindQualifiers(findQualifiers);
    }

    request.setMaxRows(maxRows);

        ServiceList sl = null;
        JAXBElement<?> o = execute(this.objectFactory.createFindService(request),
            this.getInquiryURI());
        if (o != null) sl = (ServiceList) o.getValue();

        return sl;
View Full Code Here

TOP

Related Classes of org.uddi.api_v3.ServiceList

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.