Package org.apache.ws.scout.uddi

Examples of org.apache.ws.scout.uddi.BusinessService


        return pa;
    }

  public static BusinessService getBusinessServiceFromJAXRService(
      Service serve) throws JAXRException {
    BusinessService bs = BusinessService.Factory.newInstance();
    try {
      InternationalString iname = ((RegistryObject) serve).getName();
           
      for (LocalizedString locName : iname.getLocalizedStrings()) {
          Name name = bs.addNewName();
          name.setStringValue(locName.getValue());
          name.setLang(locName.getLocale().getLanguage());               
      }
          
            InternationalString idesc = ((RegistryObject) serve).getDescription();
   
            if (idesc != null) {
                for (LocalizedString locName : idesc.getLocalizedStrings()) {
                    Description desc = bs.addNewDescription();
                    desc.setStringValue(locName.getValue());
                    desc.setLang(locName.getLocale().getLanguage());               
                }
            }

            Organization o = serve.getProvidingOrganization();

            /*
             * there may not always be a key...
             */
            if (o != null) {
                Key k = o.getKey();

        if (k != null && k.getId() != null) {
                    bs.setBusinessKey(k.getId());
                }
                   
      } else {
                /*
                 * gmj - I *think* this is the right thing to do
                 */
        throw new JAXRException(
            "Service has no associated organization");
            }

      if (serve.getKey() != null && serve.getKey().getId() != null) {
                bs.setServiceKey(serve.getKey().getId());
            } else {
                bs.setServiceKey("");
            }

            CategoryBag catBag = getCategoryBagFromClassifications(serve.getClassifications());
            if (catBag!=null) {
                bs.setCategoryBag(catBag);
            }

            //Add the ServiceBinding information
            BindingTemplates bt = getBindingTemplates(serve.getServiceBindings());
            if (bt != null) {
                bs.setBindingTemplates(bt);
            }
          
            log.debug("BusinessService=" + bs.toString());
    } catch (Exception ud) {
            throw new JAXRException("Apache JAXR Impl:", ud);
        }
        return bs;
    }
View Full Code Here


      barr = new BusinessService[s.size()];

            Iterator<Service> iter = s.iterator();
      int barrPos = 0;
      while (iter.hasNext()) {
        BusinessService bs = ScoutJaxrUddiHelper
            .getBusinessServiceFromJAXRService((Service) iter
                .next());
        barr[barrPos] = bs;
        barrPos++;
            }
View Full Code Here

      //Set Services also
      BusinessServices services = entity.getBusinessServices();
      BusinessService[] sarr = services != null ? services.getBusinessServiceArray() : null;
      for (int i = 0; sarr != null && i < sarr.length; i++)
      {
         BusinessService s = (BusinessService)sarr[i];
         org.addService(getService(s, lcm));
      }

      /*
       *  Users
View Full Code Here

      //Set Services also
      BusinessServices services = entity.getBusinessServices();
      BusinessService[] sarr = services != null ? services.getBusinessServiceArray() : null;
      for (int i = 0; sarr != null && i < sarr.length; i++)
      {
         BusinessService s = (BusinessService)sarr[i];
         org.addService(getService(s, lcm));
        
      }

      /*
 
View Full Code Here

        Iterator iter = services.iterator();
        int currLoc = 0;
        while (iter.hasNext()) {
            try {
                BusinessService bs = ScoutJaxrUddiHelper.getBusinessServiceFromJAXRService((Service) iter.next());
                sarr[currLoc] = bs;
                currLoc++;
            }
            catch (ClassCastException ce) {
                throw new UnexpectedObjectException();
            }
        }
        // Save Service
        ServiceDetail sd = null;
        try {
            sd = (ServiceDetail) executeOperation(sarr, "SAVE_SERVICE");
        }
        catch (RegistryException e) {
            exceptions.add(new SaveException(e.getLocalizedMessage()));
            bulk.setStatus(JAXRResponse.STATUS_FAILURE);
            return bulk;
        }

        sarr = sd.getBusinessServiceArray();
        for (int i = 0; sarr != null && i < sarr.length; i++) {
            BusinessService entity = (BusinessService) sarr[i];
            coll.add(new KeyImpl(entity.getServiceKey()));
        }
        bulk.setCollection(coll);
        bulk.setExceptions(exceptions);

        return bulk;
View Full Code Here

TOP

Related Classes of org.apache.ws.scout.uddi.BusinessService

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.