Package com.opera.core.systems.scope.protos

Examples of com.opera.core.systems.scope.protos.ScopeProtos$ServiceList


        //here we are assuming we don't know what key is used for the service, so we look it up
        FindService fs = new FindService();
        fs.setFindQualifiers(new FindQualifiers());
        fs.getFindQualifiers().getFindQualifier().add(UDDIConstants.EXACT_MATCH);
        fs.getName().add(new Name("ZeroCool Service", lang));
        ServiceList findService = inquiry.findService(fs);

        //parse the results and get a list of services to get the details on
        GetServiceDetail gsd = new GetServiceDetail();
        for (int i = 0; i < findService.getServiceInfos().getServiceInfo().size(); i++) {
            gsd.getServiceKey().add(findService.getServiceInfos().getServiceInfo().get(i).getServiceKey());
        }
        ServiceDetail serviceDetail = inquiry.getServiceDetail(gsd);

        //parse the service details, looking for our versioned service
        if (serviceDetail != null) {
View Full Code Here


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

                System.out.println("fetching business list");
                ServiceList before = getServiceList(uddi);
                if (before.getServiceInfos() == null) {
                        System.out.println("before no service returned!");
                        before.setServiceInfos(new ServiceInfos());
                } else {
                        System.out.println(before.getServiceInfos().getServiceInfo().size() + " service returned before");
                }

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

                ServiceList after = getServiceList(uddi);
                if (after.getServiceInfos().getServiceInfo() == null) {
                        System.out.println("after no service returned!");
                        after.setServiceInfos(new ServiceInfos());
                        return;
                } else {
                        System.out.println(after.getServiceInfos().getServiceInfo().size() + " service returned after");
                }
                PrintUDDI<ServiceList> p = new PrintUDDI<ServiceList>();
                if (before.getServiceInfos().getServiceInfo().size()
                        < after.getServiceInfos().getServiceInfo().size()) {
                        System.out.println("hey it worked as advertised. Here's all the services with QOS parameters");
                        System.out.println(p.print(after));
                } else {

                        System.out.println("something's not right, here's the before service listing");
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());
 
          // 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.findService(body, findQualifiers, em);
 
      ServiceList result = InquiryHelper.getServiceListFromKeys(body, findQualifiers, em, keysFound);
     
      tx.commit();
      return result;
    } finally {
      if (tx.isActive()) {
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;
   
    while (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();
     
      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)
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.findService(body, findQualifiers, em);
 
      ServiceList result = InquiryHelper.getServiceListFromKeys(body, findQualifiers, em, keysFound);
     
      tx.commit();
      return result;
    } finally {
      if (tx.isActive()) {
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;
   
    while (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();
     
      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)
View Full Code Here

TOP

Related Classes of com.opera.core.systems.scope.protos.ScopeProtos$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.