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

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


        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

                        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

        FindService fs = new FindService();
        fs.setFindQualifiers(new FindQualifiers());
        fs.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
        fs.getName().add(new Name("%", null));
        try {
            ServiceList findService = inquiry.findService(fs);
            if (findService.getServiceInfos() == null) {
                logger.warn("NO SERVICES RETURNED!");
            } else {
                for (int i = 0; i < findService.getServiceInfos().getServiceInfo().size(); i++) {
                    logger.warn(findService.getServiceInfos().getServiceInfo().get(i).getName().get(0).getValue() + " "
                            + findService.getServiceInfos().getServiceInfo().get(i).getServiceKey() + " "
                            + findService.getServiceInfos().getServiceInfo().get(i).getBusinessKey());
                }
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
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.