Package org.uddi.api_v2

Examples of org.uddi.api_v2.ServiceList


                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

        public static ServiceList MapServiceList(org.uddi.api_v2.ServiceList serviceDetail) {
                if (serviceDetail == null) {
                        return null;
                }
                ServiceList r = new ServiceList();
                r.setListDescription(new ListDescription());
                r.getListDescription().setActualCount(0);
                r.getListDescription().setIncludeCount(0);
                r.getListDescription().setListHead(0);

                if (serviceDetail.getServiceInfos() != null) {
                        r.setServiceInfos(new ServiceInfos());
                        r.getListDescription().setIncludeCount(serviceDetail.getServiceInfos().getServiceInfo().size());
                        r.getListDescription().setActualCount(serviceDetail.getServiceInfos().getServiceInfo().size());
                        for (int i = 0; i < serviceDetail.getServiceInfos().getServiceInfo().size(); i++) {
                                ServiceInfo x = new ServiceInfo();
                                x.setBusinessKey(serviceDetail.getServiceInfos().getServiceInfo().get(i).getBusinessKey());
                                x.setServiceKey(serviceDetail.getServiceInfos().getServiceInfo().get(i).getServiceKey());
                                x.getName().addAll(MapName(serviceDetail.getServiceInfos().getServiceInfo().get(i).getName()));
                                r.getServiceInfos().getServiceInfo().add(x);
                        }
                }
                r.setTruncated(serviceDetail.getTruncated() == Truncated.TRUE);
                return r;
        }
View Full Code Here

        n.setValue("%");
        fb.getName().add(n);
        fb.setFindQualifiers(new FindQualifiers());
        fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
        try {
            ServiceList findBusiness = inquiry.findService(fb);
            if (findBusiness.getServiceInfos() != null) {
                for (int i = 0; i < findBusiness.getServiceInfos().getServiceInfo().size(); i++) {
                    if (targetServiceKeys.contains(findBusiness.getServiceInfos().getServiceInfo().get(i).getServiceKey())) {
                        found1++;
                    }
                }
            }
        } catch (Exception ex) {
            HandleException(ex);
            Assert.fail("unexpected failure");
        }
        if (found1 != 2) {
            failuremsg += "No lang defined, " + found1 + " records found instead of 2";
        }



        found1 = 0;
        fb = new FindService();
        fb.setAuthInfo(authInfoJoe);
        n = new Name();
        n.setLang("en");
        n.setValue("%");
        fb.getName().add(n);
        fb.setFindQualifiers(new FindQualifiers());
        fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
        try {
            ServiceList findBusiness = inquiry.findService(fb);
            if (findBusiness.getServiceInfos() != null) {
                for (int i = 0; i < findBusiness.getServiceInfos().getServiceInfo().size(); i++) {
                    if (businesskeysToDelete.contains(findBusiness.getServiceInfos().getServiceInfo().get(i).getBusinessKey())) {
                        found1++;
                    }
                }
            }
        } catch (Exception ex) {
View Full Code Here

     
      tckBusiness.saveBusinesses(authInfoJoe, TOM_BUSINESS1_XML, TOM_BUSINESS1_KEY, 1);
      tckBusiness.saveBusinesses(authInfoJoe, TOM_BUSINESS2_XML, TOM_BUSINESS2_KEY, 1);
      try {
        int size = 0;
        ServiceList sl = null;

        FindService fs = new FindService();
        FindQualifiers fqs = new FindQualifiers();
        fqs.getFindQualifier().add(UDDIConstants.COMBINE_CATEGORY_BAGS);
        fs.setFindQualifiers(fqs);

                KeyedReference keyRef1 = new KeyedReference();
                keyRef1.setTModelKey(TOM_PUBLISHER_TMODEL01_KEY);
                keyRef1.setKeyValue("value-y");
       
        CategoryBag cb = new CategoryBag();
        cb.getKeyedReference().add(keyRef1);
        fs.setCategoryBag(cb);
       
        sl = inquiry.findService(fs);
        if (sl.getServiceInfos() == null) {
                    Assert.fail("Should have found one entry on FindService with TModelBag, "
                       + "found " + size);
        }
        size = sl.getServiceInfos().getServiceInfo().size();
        if (size != 1) {
          Assert.fail("Should have found one entry on FindService with TModelBag, "
              + "found " + size);
        } else {
            List<ServiceInfo> siList = sl.getServiceInfos().getServiceInfo();
          String serviceKey = siList.get(0).getServiceKey();
          if (!SERVICE_KEY1.equals(serviceKey)) {
              Assert.fail("Should have found service key " + SERVICE_KEY1
                      + " but found [" + serviceKey + "]");
          }
View Full Code Here

    fs.getName().add(name);
    startFind = System.currentTimeMillis();
    //this will match ALL services (100 * 100 =) 10,000 services
    int all = numberOfBusinesses * numberOfServices;
    System.out.println("Matching " + all+  " services");
    ServiceList serviceList = inquiry.findService(fs);
    findDuration = System.currentTimeMillis() - startFind;
    System.out.println("Find " + all + " services took "  +  findDuration + "ms. Size=" + serviceList.getServiceInfos().getServiceInfo().size());

    long startDelete = System.currentTimeMillis();
    for (int i=0; i<numberOfBusinesses; i++) {
      tckBusinessService.deleteJoePublisherServices(authInfoJoe, i, numberOfServices);
    }
View Full Code Here

      tckBusiness.saveBusinesses(authInfoJoe, TOM_BUSINESS1_XML, TOM_BUSINESS1_KEY, 1);
      tckBusiness.saveBusinesses(authInfoJoe, TOM_BUSINESS2_XML, TOM_BUSINESS2_KEY, 1);
      tckBusiness.saveBusinesses(authInfoJoe, TOM_BUSINESS5_XML, TOM_BUSINESS5_KEY, 1);
      try {
        int size = 0;
        ServiceList sl = null;

        FindService fs = new FindService();
       
        //by default keys are ADD, we should only find service 5
                KeyedReference keyRef1 = new KeyedReference();
                keyRef1.setTModelKey(TOM_PUBLISHER_TMODEL01_KEY);
                keyRef1.setKeyValue("value-z");
               
                KeyedReference keyRef2 = new KeyedReference();
                keyRef2.setTModelKey(TOM_PUBLISHER_TMODEL02_KEY);
        keyRef2.setKeyValue("value-x");
       
        CategoryBag cb = new CategoryBag();
        cb.getKeyedReference().add(keyRef1);
        cb.getKeyedReference().add(keyRef2);
        fs.setCategoryBag(cb);
       
        sl = inquiry.findService(fs);
        if (sl.getServiceInfos() == null) {
                    Assert.fail("Should have found one entry on FindService with TModelBag, "
                       + "found " + size);
        }
        size = sl.getServiceInfos().getServiceInfo().size();
        if (size != 1) {
          Assert.fail("Should have found one entry on FindService with TModelBag, "
              + "found " + size);
        } else {
            List<ServiceInfo> siList = sl.getServiceInfos().getServiceInfo();
          String serviceKey = siList.get(0).getServiceKey();
          if (!SERVICE_KEY5.equals(serviceKey)) {
              Assert.fail("Should have found service key " + SERVICE_KEY5
                      + " but found [" + serviceKey + "]");
          }
View Full Code Here

      tckBusiness.saveBusinesses(authInfoJoe, TOM_BUSINESS1_XML, TOM_BUSINESS1_KEY, 1);
      tckBusiness.saveBusinesses(authInfoJoe, TOM_BUSINESS2_XML, TOM_BUSINESS2_KEY, 1);
      tckBusiness.saveBusinesses(authInfoJoe, TOM_BUSINESS5_XML, TOM_BUSINESS5_KEY, 1);
      try {
        int size = 0;
        ServiceList sl = null;

        FindService fs = new FindService();
       
        //by default keys are ADD, we should only find service 5
                KeyedReference keyRef1 = new KeyedReference();
                keyRef1.setTModelKey(TOM_PUBLISHER_TMODEL01_KEY);
                keyRef1.setKeyValue("value-y");
              
        CategoryBag cb = new CategoryBag();
        cb.getKeyedReference().add(keyRef1);
        fs.setCategoryBag(cb);
       
        sl = inquiry.findService(fs);
        if (sl.getServiceInfos() != null) {
                    Assert.fail("Should have found no entries on FindService, "
                       + " found " + size);
        }
      } catch (Exception e) {
        e.printStackTrace();
View Full Code Here

                        tckBusiness.saveBusinesses(authInfoJoe, TOM_BUSINESS1_XML, TOM_BUSINESS1_KEY, 1);
                        tckBusiness.saveBusinesses(authInfoJoe, TOM_BUSINESS2_XML, TOM_BUSINESS2_KEY, 1);
                        tckBusiness.saveBusinesses(authInfoJoe, TOM_BUSINESS5_XML, TOM_BUSINESS5_KEY, 1);
                        try {
                                int size = 0;
                                ServiceList sl = null;

                                FindService fs = new FindService();

                                //by default keys are ADD, we should only find service 5
                                KeyedReference keyRef1 = new KeyedReference();
                                keyRef1.setTModelKey(TOM_PUBLISHER_TMODEL01_KEY);
                                keyRef1.setKeyValue("value-z");

                                KeyedReference keyRef2 = new KeyedReference();
                                keyRef2.setTModelKey(TOM_PUBLISHER_TMODEL02_KEY);
                                keyRef2.setKeyValue("value-x");

                                CategoryBag cb = new CategoryBag();
                                cb.getKeyedReference().add(keyRef1);
                                cb.getKeyedReference().add(keyRef2);
                                fs.setCategoryBag(cb);

                                sl = inquiry.findService(fs);
                                if (sl.getServiceInfos() == null) {
                                        Assert.fail("Should have found one entry on FindService with TModelBag, "
                                                + "found " + size);
                                }
                                size = sl.getServiceInfos().getServiceInfo().size();
                                if (size != 1) {
                                        Assert.fail("Should have found one entry on FindService with TModelBag, "
                                                + "found " + size);
                                } else {
                                        List<ServiceInfo> siList = sl.getServiceInfos().getServiceInfo();
                                        String serviceKey = siList.get(0).getServiceKey();
                                        if (!SERVICE_KEY5.equals(serviceKey)) {
                                                Assert.fail("Should have found service key " + SERVICE_KEY5
                                                        + " but found [" + serviceKey + "]");
                                        }
View Full Code Here

                        tckBusiness.saveBusinesses(authInfoJoe, TOM_BUSINESS1_XML, TOM_BUSINESS1_KEY, 1);
                        tckBusiness.saveBusinesses(authInfoJoe, TOM_BUSINESS2_XML, TOM_BUSINESS2_KEY, 1);
                        tckBusiness.saveBusinesses(authInfoJoe, TOM_BUSINESS5_XML, TOM_BUSINESS5_KEY, 1);
                        try {
                                int size = 0;
                                ServiceList sl = null;

                                FindService fs = new FindService();

                                //by default keys are ADD, we should only find service 5
                                KeyedReference keyRef1 = new KeyedReference();
                                keyRef1.setTModelKey(TOM_PUBLISHER_TMODEL01_KEY);
                                keyRef1.setKeyValue("value-y");

                                CategoryBag cb = new CategoryBag();
                                cb.getKeyedReference().add(keyRef1);
                                fs.setCategoryBag(cb);

                                sl = inquiry.findService(fs);
                                if (sl.getServiceInfos() != null) {
                                        Assert.fail("Should have found no entries on FindService, "
                                                + " found " + size);
                                }
                        } catch (Exception e) {
                                e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.uddi.api_v2.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.