Package org.uddi.api_v2

Examples of org.uddi.api_v2.FindBusiness


      tckBusiness.saveBusiness(authInfoJoe, TOM_BUSINESS2_XML, TOM_BUSINESS2_KEY);
      try {
        int size = 0;
        BusinessList bl = null;

        FindBusiness fb = new FindBusiness();
        FindQualifiers fqs = new FindQualifiers();
        fqs.getFindQualifier().add("combineCategoryBags");
        fb.setFindQualifiers(fqs);

        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);
        fb.setCategoryBag(cb);

        bl = inquiry.findBusiness(fb);
        if (bl.getBusinessInfos() == null) {
          Assert.fail("Should have found one entry on FindBusiness with TModelBag, "
              + "found " + size);
View Full Code Here


     
      try {
        int size = 0;
        BusinessList bl = null;

        FindBusiness fb = new FindBusiness();
        FindQualifiers fqs = new FindQualifiers();
        fqs.getFindQualifier().add("combineCategoryBags");
        fb.setFindQualifiers(fqs);

        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");
       
        KeyedReference keyRef3 = new KeyedReference();
        keyRef3.setTModelKey(TOM_PUBLISHER_TMODEL01_KEY);
        keyRef3.setKeyValue("value-y");

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

        bl = inquiry.findBusiness(fb);
        if (bl.getBusinessInfos() == null) {
          Assert.fail("Should have found one entry on FindBusiness with TModelBag, "
              + "found " + size);
View Full Code Here

                for (int i = 0; i < 1000; i++) {
                        Holder<List<Subscription>> items = new Holder<List<Subscription>>();
                        items.value = new ArrayList<Subscription>();
                        Subscription s = new Subscription();
                        s.setSubscriptionFilter(new SubscriptionFilter());
                        s.getSubscriptionFilter().setFindBusiness(new FindBusiness());
                        s.getSubscriptionFilter().getFindBusiness().setFindQualifiers(new FindQualifiers());
                        s.getSubscriptionFilter().getFindBusiness().getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                        s.getSubscriptionFilter().getFindBusiness().getName().add(new Name(UDDIConstants.WILDCARD, null));
                        items.value.add(s);
                        sub.saveSubscription(authInfoJoe, items);
View Full Code Here

            HandleException(ex);
            Assert.fail("unexpected failure");
        }

        int found1 = 0;
        FindBusiness fb = new FindBusiness();
        fb.setAuthInfo(authInfoJoe);
        n = new Name();
        n.setValue("%");
        fb.getName().add(n);
        fb.setFindQualifiers(new FindQualifiers());
        fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
        try {
            BusinessList findBusiness = inquiry.findBusiness(fb);
            if (findBusiness.getBusinessInfos() != null) {
                for (int i = 0; i < findBusiness.getBusinessInfos().getBusinessInfo().size(); i++) {
                    if (businesskeysToDelete.contains(findBusiness.getBusinessInfos().getBusinessInfo().get(i).getBusinessKey())) {
                        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 FindBusiness();
        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 {
            BusinessList findBusiness = inquiry.findBusiness(fb);
            if (findBusiness.getBusinessInfos() != null) {
                for (int i = 0; i < findBusiness.getBusinessInfos().getBusinessInfo().size(); i++) {
                    if (businesskeysToDelete.contains(findBusiness.getBusinessInfos().getBusinessInfo().get(i).getBusinessKey())) {
View Full Code Here

    }
    long saveDuration = System.currentTimeMillis() - startSave;
    System.out.println("Saved " + numberOfBusinesses + " businesses with each " + numberOfServices + " services in " + saveDuration + "ms");
   
    //find 20 businesses by name
    FindBusiness fb = new FindBusiness();
    org.uddi.api_v3.FindQualifiers apiFq = new org.uddi.api_v3.FindQualifiers();
    apiFq.getFindQualifier().add(FindQualifiers.APPROXIMATE_MATCH);
    apiFq.getFindQualifier().add(FindQualifiers.CASE_INSENSITIVE_MATCH);
    fb.setFindQualifiers(apiFq);
    Name name = new Name();
    name.setValue("John%");
    fb.getName().add(name);
    fb.setMaxRows(20);
    long startFind = System.currentTimeMillis();
    BusinessList result = inquiry.findBusiness(fb);
    long findDuration = System.currentTimeMillis() - startFind;
    System.out.println("Find 20 businesses took "  +  findDuration + "ms. Size=" + result.getBusinessInfos().getBusinessInfo().size());
    // it takes less then 1 second, make sure it stays faster then 5 seconds
View Full Code Here

                tckBusiness.deleteJoePublisherBusiness(authInfoJoe);
                tckTModel.deleteJoePublisherTmodel(authInfoJoe);
        }

        private void findbuinsess(String fq) throws Exception {
                FindBusiness fb = new FindBusiness();
                fb.setAuthInfo(authInfoJoe);
                fb.setFindQualifiers(new FindQualifiers());
                fb.getFindQualifiers().getFindQualifier().add(fq);
                fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                fb.getName().add(new Name(UDDIConstants.WILDCARD, null));
                inquiry.findBusiness(fb);
        }
View Full Code Here

                inquiry.findRelatedBusinesses(fb);
                after();
        }

        private void findbuinsess(String[] fq) throws Exception {
                FindBusiness fb = new FindBusiness();
                fb.setAuthInfo(authInfoJoe);
                fb.setFindQualifiers(new FindQualifiers());
                fb.getFindQualifiers().getFindQualifier().addAll(Arrays.asList(fq));

                fb.getName().add(new Name(UDDIConstants.WILDCARD, null));
                inquiry.findBusiness(fb);
        }
View Full Code Here

     
      try {
        int size = 0;
        BusinessList bl = null;
 
        FindBusiness fbb = new FindBusiness();
        TModelBag tmb = new TModelBag();
        tmb.getTModelKey().add(TOM_PUBLISHER_TMODEL01_KEY);
        fbb.setTModelBag(tmb);
        bl = inquiry.findBusiness(fbb);
        size = bl.getBusinessInfos().getBusinessInfo().size();
        if (size != 1) {
          Assert.fail("Should have found one entry on FindBusiness with TModelBag, "
              + "found " + size);
View Full Code Here

        public static FindBusiness MapFindBusiness(org.uddi.api_v2.FindBusiness body) {
                if (body == null) {
                        return null;
                }
                FindBusiness r = new FindBusiness();
                r.setCategoryBag(MapCategoryBag(body.getCategoryBag()));
                r.setDiscoveryURLs(MapDiscoveryURLs(body.getDiscoveryURLs()));
                r.setFindQualifiers(MapFindQualifiers(body.getFindQualifiers()));
                r.setTModelBag(MapTModelBag(body.getTModelBag()));
                r.setMaxRows(body.getMaxRows());
                r.getName().addAll(MapName(body.getName()));
                if (ContainsWildCard(r.getName())) {
                        r.setFindQualifiers(AddApproximateMatch(r.getFindQualifiers()));
                }
                return r;
        }
View Full Code Here

                tckBusinessJoe.saveJoePublisherBusinesses(authInfoJoe, numberOfBusinesses);
                long saveDuration = System.currentTimeMillis() - startSave;
                System.out.println("****************** Save " + numberOfBusinesses + " Joes Duration=" + saveDuration);

                long startFind = System.currentTimeMillis();
                FindBusiness fs = new FindBusiness();
                fs.setAuthInfo(authInfoJoe);
                fs.getName().add(new Name(UDDIConstants.WILDCARD, null));
                fs.setFindQualifiers(new FindQualifiers());
                fs.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                inquiryJoe.findBusiness(fs);
                long endFind = System.currentTimeMillis() - startFind;
                logger.info("****************** Find " + numberOfBusinesses + " Joes Business Duration= " + endFind);

                long startDelete = System.currentTimeMillis();
View Full Code Here

TOP

Related Classes of org.uddi.api_v2.FindBusiness

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.