Package org.uddi.api_v3

Examples of org.uddi.api_v3.BusinessServices


    }

    public static BusinessEntity getBusinessEntityFromJAXROrg(Organization organization)
      throws JAXRException {
    BusinessEntity biz = objectFactory.createBusinessEntity();
    BusinessServices bss = objectFactory.createBusinessServices();
    BusinessService[] barr = new BusinessService[0];

    try {
      // It may just be an update
            Key key = organization.getKey();
      if (key != null && key.getId() != null) {
        biz.setBusinessKey(key.getId());
            } else {
                biz.setBusinessKey("");
            }
      // Lets get the Organization attributes at the top level
     
      InternationalString iname = organization.getName();
     
      if (iname != null) {
                addNames(biz.getName(), iname);
      }
     
      InternationalString idesc = organization.getDescription();
     
            addDescriptions(biz.getDescription(), idesc);

      if (organization.getPrimaryContact() != null &&
        organization.getPrimaryContact().getPersonName()!= null &&
        organization.getPrimaryContact().getPersonName().getFullName() != null) {

        biz.setAuthorizedName(organization.getPrimaryContact().getPersonName()
            .getFullName());
      }

            Collection<Service> s = organization.getServices();
            log.debug("?Org has services=" + s.isEmpty());

      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++;
            }

            /*
             * map users : JAXR has concept of 'primary contact', which is a
             * special designation for one of the users, and D6.1 seems to say
             * that the first UDDI user is the primary contact
             */

      Contacts cts = objectFactory.createContacts();
      Contact[] carr = new Contact[0];

            User primaryContact = organization.getPrimaryContact();
            Collection<User> users = organization.getUsers();

            // Expand array to necessary size only (xmlbeans does not like
            // null items in cases like this)

            int carrSize = 0;

            if (primaryContact != null) {
                carrSize += 1;
            }

            // TODO: Clean this up and make it more efficient
            Iterator<User> it = users.iterator();
            while (it.hasNext()) {
                User u = (User) it.next();
                if (u != primaryContact) {
                    carrSize++;
                }
            }

            carr = new Contact[carrSize];

            /*
             * first do primary, and then filter that out in the loop
             */
            if (primaryContact != null) {
                Contact ct = getContactFromJAXRUser(primaryContact);
                carr[0] = ct;
            }

            it = users.iterator();
            int carrPos = 1;
            while (it.hasNext()) {
                User u = (User) it.next();

                if (u != primaryContact) {
                    Contact ct = getContactFromJAXRUser(u);
                    carr[carrPos] = ct;
                    carrPos++;
                }
            }

      bss.getBusinessService().addAll(Arrays.asList(barr));
            if (carr.length>0) {
                cts.getContact().addAll(Arrays.asList(carr));
                biz.setContacts(cts);
            }
            biz.setBusinessServices(bss);
View Full Code Here


      org.setDescription(is);
    }
    org.setKey(lifeCycleManager.createKey(businessEntity.getBusinessKey()));

    //Set Services also
    BusinessServices services = businessEntity.getBusinessServices();
    if(services != null)
    {
      List<BusinessService> bizServiceList = services.getBusinessService();
      for (BusinessService businessService : bizServiceList) {
        org.addService(getService(businessService, lifeCycleManager));
      }
    }
View Full Code Here

    }

    org.setKey(lifeCycleManager.createKey(entity.getBusinessKey()));

    //Set Services also
    BusinessServices services = entity.getBusinessServices();
    List<BusinessService> bizServiceList = services.getBusinessService();
    for (BusinessService businessService : bizServiceList) {
      org.addService(getService(businessService, lifeCycleManager));
    }

    /*
 
View Full Code Here

    }

    public static BusinessEntity getBusinessEntityFromJAXROrg(Organization organization)
      throws JAXRException {
    BusinessEntity biz = objectFactory.createBusinessEntity();
    BusinessServices bss = objectFactory.createBusinessServices();
    BusinessService[] barr = new BusinessService[0];

    try {
      // It may just be an update
            Key key = organization.getKey();
      if (key != null && key.getId() != null) {
        biz.setBusinessKey(key.getId());
            } else {
                biz.setBusinessKey("");
            }
      // Lets get the Organization attributes at the top level
     
      InternationalString iname = organization.getName();
     
      if (iname != null) {
                addNames(biz.getName(), iname);
      }
     
      InternationalString idesc = organization.getDescription();
     
            addDescriptions(biz.getDescription(), idesc);

      if (organization.getPrimaryContact() != null &&
        organization.getPrimaryContact().getPersonName()!= null &&
        organization.getPrimaryContact().getPersonName().getFullName() != null) {

        biz.setAuthorizedName(organization.getPrimaryContact().getPersonName()
            .getFullName());
      }

            Collection<Service> s = organization.getServices();
            log.debug("?Org has services=" + s.isEmpty());

      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++;
            }

            /*
             * map users : JAXR has concept of 'primary contact', which is a
             * special designation for one of the users, and D6.1 seems to say
             * that the first UDDI user is the primary contact
             */

      Contacts cts = objectFactory.createContacts();
      Contact[] carr = new Contact[0];

            User primaryContact = organization.getPrimaryContact();
            Collection<User> users = organization.getUsers();

            // Expand array to necessary size only (xmlbeans does not like
            // null items in cases like this)

            int carrSize = 0;

            if (primaryContact != null) {
                carrSize += 1;
            }

            // TODO: Clean this up and make it more efficient
            Iterator<User> it = users.iterator();
            while (it.hasNext()) {
                User u = (User) it.next();
                if (u != primaryContact) {
                    carrSize++;
                }
            }

            carr = new Contact[carrSize];

            /*
             * first do primary, and then filter that out in the loop
             */
            if (primaryContact != null) {
                Contact ct = getContactFromJAXRUser(primaryContact);
                carr[0] = ct;
            }

            it = users.iterator();
            int carrPos = 1;
            while (it.hasNext()) {
                User u = (User) it.next();

                if (u != primaryContact) {
                    Contact ct = getContactFromJAXRUser(u);
                    carr[carrPos] = ct;
                    carrPos++;
                }
            }

      bss.getBusinessService().addAll(Arrays.asList(barr));
            if (carr.length>0) {
                cts.getContact().addAll(Arrays.asList(carr));
                biz.setContacts(cts);
            }
            biz.setBusinessServices(bss);
View Full Code Here

      org.setDescription(getIString(desc.getLang(), desc.getValue(), lifeCycleManager));
    }
    org.setKey(lifeCycleManager.createKey(businessEntity.getBusinessKey()));

    //Set Services also
    BusinessServices services = businessEntity.getBusinessServices();
    if(services != null)
    {
      List<BusinessService> bizServiceList = services.getBusinessService();
      for (BusinessService businessService : bizServiceList) {
        org.addService(getService(businessService, lifeCycleManager));
      }
    }
View Full Code Here

                item.setOperator(operator);
                item.getDescription().addAll(MapDescription(be.getDescription()));
               
                item.getName().addAll(MapName(be.getName()));
                if (be.getBusinessServices() != null && !be.getBusinessServices().getBusinessService().isEmpty()) {
                        item.setBusinessServices(new BusinessServices());
                        item.getBusinessServices().getBusinessService().addAll(MapService(be.getBusinessServices().getBusinessService()));
                }
                return item;
        }
View Full Code Here

        this.lang = properties.getProperty(Property.LANG, Property.DEFAULT_LANG);
    }

    public BusinessServices registerBusinessServices(Definition wsdlDefinition) throws RemoteException, ConfigurationException, TransportException, WSDLException {

        BusinessServices businessServices = new BusinessServices();

        for (Object serviceName : wsdlDefinition.getAllServices().keySet()) {
            QName serviceQName = (QName) serviceName;
            Service service = wsdlDefinition.getService(serviceQName);
            BusinessService businessService = null;
            //add service
            URL serviceUrl = null;
            if (service.getPorts() != null && service.getPorts().size() > 0) {
                for (Object portName : service.getPorts().keySet()) {
                    businessService = registerBusinessService(serviceQName, (String) portName, serviceUrl, wsdlDefinition).getBusinessService();
                }
            }
            if (businessService != null) {
                businessServices.getBusinessService().add(businessService);
            }
        }

        return businessServices;
View Full Code Here

     */
    public BusinessServices createBusinessServices(Definition wsdlDefinition) {
        if (wsdlDefinition == null) {
            throw new IllegalArgumentException();
        }
        BusinessServices businessServices = new BusinessServices();
        for (Object serviceName : wsdlDefinition.getAllServices().keySet()) {
            QName serviceQName = (QName) serviceName;
            Service service = wsdlDefinition.getService(serviceQName);
            BusinessService businessService = createBusinessService(serviceQName, wsdlDefinition);
            //service.getExtensibilityElements().
            //add the bindingTemplates
            URL serviceUrl = null;
            if (service.getPorts() != null && service.getPorts().size() > 0) {
                businessService.setBindingTemplates(new BindingTemplates());
                for (Object portName : service.getPorts().keySet()) {
                    BindingTemplate bindingTemplate = createWSDLBinding(serviceQName, (String) portName, serviceUrl, wsdlDefinition);
                    businessService.getBindingTemplates().getBindingTemplate().add(bindingTemplate);
                }
            }
            businessServices.getBusinessService().add(businessService);
        }

        return businessServices;
    }
View Full Code Here

                                properties.put("businessName", "biz");
                                properties.put("serverName", "localhost");
                                properties.put("serverPort", "80");

                                WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(null, new URLLocalizerDefaultImpl(), properties);
                                BusinessServices businessServices = wsdl2UDDI.createBusinessServices(wsdlDefinition);
                                for (int i = 0; i < businessServices.getBusinessService().size(); i++) {
                                        if (businessServices.getBusinessService().get(i).getBindingTemplates() != null) {
                                                for (int k = 0; k < businessServices.getBusinessService().get(i).getBindingTemplates().getBindingTemplate().size(); k++) {
                                                        items.addAll(ParseBinding(businessServices.getBusinessService().get(i).getBindingTemplates().getBindingTemplate().get(k)));
                                                }
                                        }
                                }
                        } catch (Exception ex) {
                                log.error(ex);
View Full Code Here

                be.getName().addAll(getNames());
                return be;
        }

        private static BusinessServices getServices() {
                BusinessServices r = new BusinessServices();
                BusinessService x = new BusinessService();
                x.setBusinessKey(domainprefix+"businesskey");
                x.setServiceKey(domainprefix+"servicekey");
                x.setCategoryBag(getCatbag());
                x.getDescription().addAll(getDescriptions());
                x.getName().addAll(getNames());
                x.setBindingTemplates(getBindingTemplates());
                r.getBusinessService().add(x);
                return r;
        }
View Full Code Here

TOP

Related Classes of org.uddi.api_v3.BusinessServices

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.