Package org.uddi.api_v3

Examples of org.uddi.api_v3.BusinessService


                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();
View Full Code Here


        public ServiceRegistrationResponse registerBusinessService(QName serviceQName, String portName, URL serviceUrl, Definition wsdlDefinition) throws RemoteException, ConfigurationException, TransportException, WSDLException, MalformedURLException {

                String genericWSDLURL = wsdlDefinition.getDocumentBaseURI();   //TODO maybe point to repository version
                ServiceRegistrationResponse response = new ServiceRegistrationResponse();
                String serviceKey = UDDIKeyConvention.getServiceKey(properties, serviceQName.getLocalPart());
                BusinessService businessService = lookupService(serviceKey);
                if (businessService == null) {
                        List<TModel> tModels = new ArrayList<TModel>();
                        // Create the PortType tModels
                        Map<QName, PortType> portTypes = (Map<QName, PortType>) wsdlDefinition.getAllPortTypes();
                        tModels.addAll(createWSDLPortTypeTModels(genericWSDLURL, portTypes));
                        // Create the Binding tModels
                        Map<QName, Binding> bindings = (Map<QName, Binding>) wsdlDefinition.getAllBindings();
                        tModels.addAll(createWSDLBindingTModels(genericWSDLURL, bindings));
                        // Register these tModels
                        for (TModel tModel : tModels) {
                                clerk.register(tModel);
                        }
                        // Service
                        businessService = createBusinessService(serviceQName, wsdlDefinition);
                        // Register this Service
                        clerk.register(businessService);
                }
                //Add the BindingTemplate to this Service
                BindingTemplate binding = createWSDLBinding(serviceQName, portName, serviceUrl, wsdlDefinition);
                // Register BindingTemplate
                if (binding.getAccessPoint() != null) {
                        clerk.register(binding);
                        if (businessService.getBindingTemplates() == null) {
                                businessService.setBindingTemplates(new BindingTemplates());
                        }
                        businessService.getBindingTemplates().getBindingTemplate().add(binding);
                        response.setBindingKey(binding.getBindingKey());
                }
                response.setBusinessService(businessService);
                return response;
        }
View Full Code Here

        }

        public String unRegisterBusinessService(QName serviceName, String portName, URL serviceUrl) throws RemoteException, ConfigurationException, TransportException {

                String serviceKey = UDDIKeyConvention.getServiceKey(properties, serviceName.getLocalPart());
                BusinessService service = lookupService(serviceKey);
                boolean isRemoveServiceIfNoTemplates = true;
                String bindingKey = UDDIKeyConvention.getBindingKey(properties, serviceName, portName, serviceUrl);
                //check if this bindingKey is in the service's binding templates
                for (BindingTemplate bindingTemplate : service.getBindingTemplates().getBindingTemplate()) {
                        if (bindingKey.equals(bindingTemplate.getBindingKey())) {
                                clerk.unRegisterBinding(bindingKey);
                                //if this is the last binding for this service, and
                                if (service.getBindingTemplates().getBindingTemplate().size() == 1 && isRemoveServiceIfNoTemplates) {
                                        clerk.unRegisterService(serviceKey);
                                        if (bindingTemplate.getTModelInstanceDetails() != null
                                                && bindingTemplate.getTModelInstanceDetails().getTModelInstanceInfo() != null) {
                                                for (TModelInstanceInfo tModelInstanceInfo : bindingTemplate.getTModelInstanceDetails().getTModelInstanceInfo()) {
                                                        String tModelKey = tModelInstanceInfo.getTModelKey();
View Full Code Here

         * @throws TransportException
         */
        private BusinessService lookupService(String serviceKey) throws RemoteException, ConfigurationException, TransportException {

                //Checking if this serviceKey already exist
                BusinessService service = clerk.getServiceDetail(serviceKey);
                return service;
        }
View Full Code Here

                }
                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);
                }
View Full Code Here

         * @return a business service
         */
        protected BusinessService createBusinessService(QName serviceQName, Definition wsdlDefinition) {

                log.debug("Constructing Service UDDI Information for " + serviceQName);
                BusinessService service = new BusinessService();
                // BusinessKey
                service.setBusinessKey(businessKey);
                // ServiceKey
                service.setServiceKey(UDDIKeyConvention.getServiceKey(properties, serviceQName.getLocalPart()));
                // Description
                String serviceDescription = properties.getProperty(Property.SERVICE_DESCRIPTION, Property.DEFAULT_SERVICE_DESCRIPTION);
                // Override with the service description from the WSDL if present
                if (wsdlDefinition.getService(serviceQName) != null) {
                        Element docElement = wsdlDefinition.getService(serviceQName).getDocumentationElement();
                        if (docElement != null && docElement.getTextContent() != null) {
                                serviceDescription = docElement.getTextContent();
                        }
                }

                service.getDescription().addAll(Common2UDDI.mapDescription(serviceDescription, lang));

                // Service name
                Name sName = new Name();
                sName.setLang(lang);
                sName.setValue(serviceQName.getLocalPart());
                service.getName().add(sName);

                CategoryBag categoryBag = new CategoryBag();

                String namespace = serviceQName.getNamespaceURI();
                if (namespace != null && namespace.length() != 0) {
                        KeyedReference namespaceReference = newKeyedReference(
                                "uddi:uddi.org:xml:namespace", "uddi-org:xml:namespace", namespace);
                        categoryBag.getKeyedReference().add(namespaceReference);
                }

                KeyedReference serviceReference = newKeyedReference(
                        "uddi:uddi.org:wsdl:types", "uddi-org:wsdl:types", "service");
                categoryBag.getKeyedReference().add(serviceReference);

                KeyedReference localNameReference = newKeyedReference(
                        "uddi:uddi.org:xml:localname", "uddi-org:xml:localName", serviceQName.getLocalPart());
                categoryBag.getKeyedReference().add(localNameReference);

                service.setCategoryBag(categoryBag);

                return service;
        }
View Full Code Here

                BusinessEntity be = new BusinessEntity();
                Name n = new Name();
                n.setValue("ServiceNameTooLongTest A Test business");
                be.getName().add(n);
                be.setBusinessServices(new BusinessServices());
                BusinessService bs = new BusinessService();
                n = new Name();
                n.setValue(str256);
                bs.getName().add(n);
                be.getBusinessServices().getBusinessService().add(bs);

                sb.getBusinessEntity().add(be);
                try {
                        BusinessDetail saveBusiness = publicationJoe.saveBusiness(sb);
View Full Code Here

                BusinessEntity be = new BusinessEntity();
                Name n = new Name();
                n.setValue("ServiceNameMaxLenTest A Test business");
                be.getName().add(n);
                be.setBusinessServices(new BusinessServices());
                BusinessService bs = new BusinessService();
                n = new Name();
                n.setValue(str255);
                bs.getName().add(n);
                be.getBusinessServices().getBusinessService().add(bs);

                sb.getBusinessEntity().add(be);

                BusinessDetail saveBusiness = publicationJoe.saveBusiness(sb);
View Full Code Here

                BusinessEntity be = new BusinessEntity();
                Name n = new Name();
                n.setValue("ServiceNameMaxLangLenTest A Test business");
                be.getName().add(n);
                be.setBusinessServices(new BusinessServices());
                BusinessService bs = new BusinessService();
                n = new Name();
                n.setValue(str255);
                n.setLang(str26);
                bs.getName().add(n);
                be.getBusinessServices().getBusinessService().add(bs);

                sb.getBusinessEntity().add(be);

                BusinessDetail saveBusiness = publicationJoe.saveBusiness(sb);
View Full Code Here

                BusinessEntity be = new BusinessEntity();
                Name n = new Name();
                n.setValue("ServiceNameTooLongLangTest A Test business");
                be.getName().add(n);
                be.setBusinessServices(new BusinessServices());
                BusinessService bs = new BusinessService();
                n = new Name();
                n.setValue(str255);
                n.setLang(str27);
                bs.getName().add(n);
                be.getBusinessServices().getBusinessService().add(bs);

                sb.getBusinessEntity().add(be);
                try {
                        BusinessDetail saveBusiness = publicationJoe.saveBusiness(sb);
View Full Code Here

TOP

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