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

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


    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

          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

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

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

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

                FindService fb = new FindService();
                fb.setMaxRows(1);
                fb.getName().add(new Name(UDDIConstants.WILDCARD, null));
                fb.setFindQualifiers(new FindQualifiers());
                fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                ServiceList findService = inquiry.findService(fb);
                Assume.assumeTrue(findService != null);
                Assume.assumeTrue(findService.getServiceInfos() != null);
                Assume.assumeTrue(!findService.getServiceInfos().getServiceInfo().isEmpty());

                String url = manager.getClientConfig().getHomeNode().getInquiry_REST_Url();

                Assume.assumeNotNull(url);
               
                //get the results via inquiry rest
                HttpClient client = new DefaultHttpClient();
                HttpGet httpGet = new HttpGet(url + "?serviceKey=" + findService.getServiceInfos().getServiceInfo().get(0).getServiceKey());
                logger.info("Fetching " + httpGet.getURI());
                HttpResponse response = client.execute(httpGet);
               
               
                Assert.assertTrue(response.getStatusLine().getStatusCode() == 200);
                logger.info("Response content: " + response.getEntity().getContent());
                BusinessService unmarshal = JAXB.unmarshal(response.getEntity().getContent(), BusinessService.class);
                client.getConnectionManager().shutdown();
                Assert.assertNotNull(unmarshal);
                Assert.assertEquals(unmarshal.getServiceKey(), findService.getServiceInfos().getServiceInfo().get(0).getServiceKey());


        }
View Full Code Here

                        fb.setMaxRows(fetch);
                        fb.setListHead(offset);
                        fb.getName().add(new Name(UDDIConstants.WILDCARD, null));
                        fb.setFindQualifiers(new FindQualifiers());
                        fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                        ServiceList findService = inquiry.findService(fb);
                        int returnedcount = findService.getServiceInfos().getServiceInfo().size();
                        do {
                                for (int i = 0; i < findService.getServiceInfos().getServiceInfo().size(); i++) {
                                        GetServiceDetail gsd = new GetServiceDetail();
                                        gsd.getServiceKey().add(findService.getServiceInfos().getServiceInfo().get(i).getServiceKey());
                                        ServiceDetail serviceDetail = inquiry.getServiceDetail(gsd);
                                        if (serviceDetail.getBusinessService().get(0).getBindingTemplates() != null
                                                && !serviceDetail.getBusinessService().get(0).getBindingTemplates().getBindingTemplate().isEmpty()) {
                                                return serviceDetail.getBusinessService().get(0).getBindingTemplates().getBindingTemplate().get(0);
                                        }

                                }
                                offset = fetch;
                                fetch = fetch + 10;
                                fb = new FindService();
                                fb.setMaxRows(fetch);
                                fb.setListHead(offset);
                                fb.getName().add(new Name(UDDIConstants.WILDCARD, null));
                                fb.setFindQualifiers(new FindQualifiers());
                                fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                                findService = inquiry.findService(fb);
                                returnedcount = findService.getServiceInfos().getServiceInfo().size();

                        } while (returnedcount > 0);
                } catch (DispositionReportFaultMessage ex) {
                        Logger.getLogger(UDDI_160_RESTIntergrationTest.class.getName()).log(Level.SEVERE, null, ex);
                } catch (RemoteException ex) {
View Full Code Here

TOP

Related Classes of com.opera.core.systems.scope.protos.ScopeProtos$ServiceList$Builder

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.