Package org.uddi.api_v3

Examples of org.uddi.api_v3.BindingTemplate


                BusinessService bs = new BusinessService();

                n = new Name();
                n.setValue("A first business service");
                bs.getName().add(n);
                BindingTemplate bt = new BindingTemplate();
                bs.setBindingTemplates(new BindingTemplates());
                bt.setAccessPoint(new AccessPoint());
                bt.getAccessPoint().setValue(url);

                //bt.setHostingRedirector(new HostingRedirector());
                //bt.getHostingRedirector().setBindingKey(str255);
                bs.getBindingTemplates().getBindingTemplate().add(bt);

                be.getBusinessServices().getBusinessService().add(bs);

                sb.getBusinessEntity().add(be);
                System.out.println("Saving the business with the first service");
                BusinessDetail saveBusiness = publicationJoe.saveBusiness(sb);

                TckCommon.PrintBusinessDetails(saveBusiness.getBusinessEntity());

                //setup the next one
                bs = new BusinessService();
                n = new Name();
                n.setValue("A a redirected business service");
                bt = new BindingTemplate();
                bt.setAccessPoint(new AccessPoint());
                bt.getAccessPoint().setUseType(AccessPointType.BINDING_TEMPLATE.toString());
                bt.getAccessPoint().setValue(saveBusiness.getBusinessEntity().get(0).getBusinessServices().getBusinessService().get(0).getBindingTemplates().getBindingTemplate().get(0).getBindingKey());
                bs.getName().add(n);
                bs.setBindingTemplates(new BindingTemplates());
                bs.getBindingTemplates().getBindingTemplate().add(bt);
                saveBusiness.getBusinessEntity().get(0).getBusinessServices().getBusinessService().add(bs);
View Full Code Here


                        be.getName().add(bsn);

                        BusinessService bs = new BusinessService();
                        Name n = new Name();
                        n.setValue("A a redirected business service");
                        BindingTemplate bt = new BindingTemplate();
                        bt.setAccessPoint(new AccessPoint());
                        bt.getAccessPoint().setUseType(AccessPointType.BINDING_TEMPLATE.toString());
                        bt.getAccessPoint().setValue("uddi:" + UUID.randomUUID().toString());
                        bs.getName().add(n);
                        bs.setBindingTemplates(new BindingTemplates());
                        bs.getBindingTemplates().getBindingTemplate().add(bt);
                        be.setBusinessServices(new BusinessServices());
                        be.getBusinessServices().getBusinessService().add(bs);
View Full Code Here

                BusinessService bs = new BusinessService();

                n = new Name();
                n.setValue(str255);
                bs.getName().add(n);
                BindingTemplate bt = new BindingTemplate();
                bs.setBindingTemplates(new BindingTemplates());

                bt.setHostingRedirector(new HostingRedirector());
                bt.getHostingRedirector().setBindingKey(str256);
                bs.getBindingTemplates().getBindingTemplate().add(bt);

                be.getBusinessServices().getBusinessService().add(bs);

                sb.getBusinessEntity().add(be);
View Full Code Here

                BusinessService bs = new BusinessService();

                n = new Name();
                n.setValue(str255);
                bs.getName().add(n);
                BindingTemplate bt = new BindingTemplate();
                bs.setBindingTemplates(new BindingTemplates());
                bt.setAccessPoint(new AccessPoint());
                bt.getAccessPoint().setValue(str4096);

                bs.getBindingTemplates().getBindingTemplate().add(bt);

                be.getBusinessServices().getBusinessService().add(bs);
View Full Code Here

                BusinessService bs = new BusinessService();

                n = new Name();
                n.setValue(str255);
                bs.getName().add(n);
                BindingTemplate bt = new BindingTemplate();

                bs.setBindingTemplates(new BindingTemplates());
                bt.setAccessPoint(new AccessPoint());
                bt.getAccessPoint().setValue(str4097);

                bs.getBindingTemplates().getBindingTemplate().add(bt);

                be.getBusinessServices().getBusinessService().add(bs);
View Full Code Here

                //Make sure the names are the same
                Assert.assertEquals(specBusinessService.getName().get(0).getValue(), businessService.getName().get(0).getValue());
                //We should have a overviewDoc with one overviewURL which should end with "/sample.wsdl"
                Assert.assertNotNull(businessService.getBindingTemplates());
                Assert.assertEquals(1, businessService.getBindingTemplates().getBindingTemplate().size());
                BindingTemplate bindingTemplate = businessService.getBindingTemplates().getBindingTemplate().get(0);
                Assert.assertNotNull(bindingTemplate);
                BindingTemplate specBindingTemplate = specBusinessService.getBindingTemplates().getBindingTemplate().get(0);

                Assert.assertEquals(specBindingTemplate.getBindingKey(), bindingTemplate.getBindingKey());
                Assert.assertEquals(specBindingTemplate.getServiceKey(), bindingTemplate.getServiceKey());
                Assert.assertEquals(specBindingTemplate.getAccessPoint().getValue(), bindingTemplate.getAccessPoint().getValue());
                Assert.assertTrue(2 <= bindingTemplate.getTModelInstanceDetails().getTModelInstanceInfo().size());
                //first binding/tmodelInstanceDetails
                Assert.assertEquals(specBindingTemplate.getTModelInstanceDetails().getTModelInstanceInfo().get(0).getTModelKey(),
                        bindingTemplate.getTModelInstanceDetails().getTModelInstanceInfo().get(0).getTModelKey());
                Assert.assertEquals(specBindingTemplate.getTModelInstanceDetails().getTModelInstanceInfo().get(0).getInstanceDetails().getInstanceParms(),
                        bindingTemplate.getTModelInstanceDetails().getTModelInstanceInfo().get(0).getInstanceDetails().getInstanceParms());
                //second binding/tmodelInstanceDetails
                Assert.assertEquals(specBindingTemplate.getTModelInstanceDetails().getTModelInstanceInfo().get(1).getTModelKey(),
                        bindingTemplate.getTModelInstanceDetails().getTModelInstanceInfo().get(1).getTModelKey());

                //Compare categoryBag
                //We should have a categoryBag with 3 keyedReferences
                Assert.assertNotNull(businessService.getCategoryBag());
View Full Code Here

                be.getBusinessServices().getBusinessService().add(bs);
                BusinessEntity register = clerk.register(be);
                logger.info("Registered business keygen: " + register.getBusinessKey());

                //start up our listener
                BindingTemplate start = SubscriptionCallbackListener.start(manager, "default");
                Assert.assertNotNull(start);

                if (TckCommon.isDebug()) {
                        PrintUDDI<BindingTemplate> p = new PrintUDDI<BindingTemplate>();
                        logger.info(p.print(start));
                }

                //register for callbacks
                SubscriptionCallbackListener.registerCallback(this);

                Subscription sub = new Subscription();

                sub.setNotificationInterval(DatatypeFactory.newInstance().newDuration(1000));
                sub.setBindingKey(start.getBindingKey());
                sub.setSubscriptionFilter(new SubscriptionFilter());
                sub.getSubscriptionFilter().setFindBusiness(new FindBusiness());
                sub.getSubscriptionFilter().getFindBusiness().setFindQualifiers(new FindQualifiers());
                sub.getSubscriptionFilter().getFindBusiness().getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                sub.getSubscriptionFilter().getFindBusiness().getName().add(new Name(UDDIConstants.WILDCARD, null));

                Subscription subscription = clerk.register(sub, clerk.getUDDINode().getApiNode());
                if (TckCommon.isDebug()) {
                        PrintUDDI<Subscription> p2 = new PrintUDDI<Subscription>();
                        logger.info(p2.print(subscription));
                }
                Assert.assertNotNull(subscription);
                Assert.assertNotNull(subscription.getBindingKey());
                Assert.assertNotNull(subscription.getSubscriptionKey());
                logger.info("Registered subscription key: " + (subscription.getSubscriptionKey()) + " bindingkey: " + subscription.getBindingKey());

                //fetch the business just to verify binding registration
                BusinessEntity businessDetail = clerk.getBusinessDetail("uddi:somebusiness:somebusinesskey");
                Assert.assertNotNull(businessDetail);
                Assert.assertNotNull(businessDetail.getBusinessKey());
                Assert.assertNotNull(businessDetail.getBusinessServices());
                Assert.assertNotNull(businessDetail.getBusinessServices().getBusinessService().get(0));
                Assert.assertNotNull(businessDetail.getBusinessServices().getBusinessService().get(0).getBindingTemplates());
                Assert.assertNotNull(businessDetail.getBusinessServices().getBusinessService().get(0).getBindingTemplates().getBindingTemplate().get(0));
                if (TckCommon.isDebug()) {
                        PrintUDDI<BusinessEntity> p2 = new PrintUDDI<BusinessEntity>();
                        logger.info(p2.print(businessDetail));
                }

                //trigger the callback
                BusinessEntity trigger = new BusinessEntity();
                trigger.getName().add(new Name("somebusiness trigger SubscriptionCallbackTest1", null));
                BusinessEntity triggered = clerk.register(trigger);
                //wait up to 30 seconds or until we get something
                long wait = TckPublisher.getSubscriptionTimeout();
                while (wait > 0 && notifications == 0) {
                        Thread.sleep(1000);
                        System.out.print(".");
                        wait--;
                }

                logger.info("Callback check." + notifications);
                //Thread.sleep(2000);
                SubscriptionCallbackListener.stop(manager, "default", start.getBindingKey());
                clerk.unRegisterSubscription(subscription.getSubscriptionKey());
                clerk.unRegisterTModel(createKeyGenator.getTModelKey());

                clerk.unRegisterBusiness(triggered.getBusinessKey());
                clerk.unRegisterBusiness(businessDetail.getBusinessKey());
View Full Code Here

        service = createBusinessService(serviceName, wsdlDefinition);
        // Register this BPEL Service
        clerk.register(service);
    }
    //Add the BindingTemplate to this Service
    BindingTemplate binding = createBPELBinding(serviceName, portName, serviceUrl, wsdlDefinition);
    // Register BindingTemplate
    clerk.register(binding);
    return binding;
  }
View Full Code Here

      return tModel;
    }
   
    public BindingTemplate createBPELBinding(QName serviceName, String portName, URL serviceUrl, Definition wsdlDefinition) {
   
      BindingTemplate bindingTemplate = new BindingTemplate();
    // Set BusinessService Key
    bindingTemplate.setServiceKey(UDDIKeyConvention.getServiceKey(properties, serviceName.getLocalPart()));
    // Set Binding Key
    String bindingKey = UDDIKeyConvention.getBindingKey(properties, serviceName, portName, serviceUrl);
    bindingTemplate.setBindingKey(bindingKey);
    // Set AccessPoint
    AccessPoint accessPoint = new AccessPoint();
    accessPoint.setUseType(AccessPointType.END_POINT.toString());
    accessPoint.setValue(urlLocalizer.rewrite(serviceUrl));
    bindingTemplate.setAccessPoint(accessPoint);
   
    Service service =  wsdlDefinition.getService(serviceName);
   
    if (service!=null) {
      TModelInstanceDetails tModelInstanceDetails = new TModelInstanceDetails();
     
      Port port = service.getPort(portName);
      if (port!=null) {
        Binding binding = port.getBinding();
        // Set the Binding Description
        String bindingDescription = properties.getProperty(Property.BINDING_DESCRIPTION, Property.DEFAULT_BINDING_DESCRIPTION);
        // Override with the service description from the WSDL if present
        Element docElement = binding.getDocumentationElement();
        if (docElement!=null && docElement.getTextContent()!=null) {
          bindingDescription = docElement.getTextContent();
        }
       
        bindingTemplate.getDescription().addAll(Common2UDDI.mapDescription(bindingDescription, lang));
       
        // reference wsdl:binding tModel
        TModelInstanceInfo tModelInstanceInfoBinding = new TModelInstanceInfo();
        tModelInstanceInfoBinding.setTModelKey(keyDomainURI + binding.getQName().getLocalPart());
        InstanceDetails instanceDetails = new InstanceDetails();
        instanceDetails.setInstanceParms(portName)
        tModelInstanceInfoBinding.setInstanceDetails(instanceDetails);
       
        tModelInstanceInfoBinding.getDescription().addAll(Common2UDDI.mapDescription("The wsdl:binding that this wsdl:port implements. " + bindingDescription +
            " The instanceParms specifies the port local name.", lang));
        tModelInstanceDetails.getTModelInstanceInfo().add(tModelInstanceInfoBinding);
       
        // reference wsdl:portType tModel
        PortType portType = binding.getPortType();
        TModelInstanceInfo tModelInstanceInfoPortType = new TModelInstanceInfo();
        tModelInstanceInfoPortType.setTModelKey(keyDomainURI + portType.getQName().getLocalPart());
        String portTypeDescription = "";
        docElement = portType.getDocumentationElement();
        if (docElement!=null && docElement.getTextContent()!=null) {
          portTypeDescription = docElement.getTextContent();
        }
       
        tModelInstanceInfoPortType.getDescription().addAll(Common2UDDI.mapDescription("The wsdl:portType that this wsdl:port implements." + portTypeDescription, lang));
        tModelInstanceDetails.getTModelInstanceInfo().add(tModelInstanceInfoPortType);
       
        //reference bpel:process tModel
        TModelInstanceInfo tModelInstanceInfoBPEL = new TModelInstanceInfo();
        tModelInstanceInfoBPEL.setTModelKey(keyDomainURI + service.getQName().getLocalPart() + "Process");
       
        // Description
        String serviceDescription = properties.getProperty(Property.SERVICE_DESCRIPTION, Property.DEFAULT_SERVICE_DESCRIPTION);
        // Override with the service description from the WSDL if present
        docElement = wsdlDefinition.getService(serviceName).getDocumentationElement();
        if (docElement!=null && docElement.getTextContent()!=null) {
          serviceDescription = docElement.getTextContent();
        }
       
        tModelInstanceInfoBPEL.getDescription().addAll(Common2UDDI.mapDescription("The bpel:process this wsdl:port supports." + serviceDescription, lang));
        tModelInstanceDetails.getTModelInstanceInfo().add(tModelInstanceInfoBPEL);
       
        bindingTemplate.setTModelInstanceDetails(tModelInstanceDetails);
      } else {
        log.error("Could not find Port with portName: " + portName);
      }
    } else {
      log.error("Could not find Service with serviceName: " + serviceName.getLocalPart());
View Full Code Here

  /**
   * Copies the TemplateBinding from one UDDI to another UDDI.
   */
  public void xRegisterServiceBinding() {
    try {
      BindingTemplate bindingTemplate = fromClerk.getServiceBindingDetail(entityKey,fromClerk.getUDDINode().getApiNode());
      log.info("xregister binding " + bindingTemplate.getBindingKey()+ " + from "
          + fromClerk.getName() + " to " + toClerk.getName());
      toClerk.register(bindingTemplate,toClerk.getUDDINode().getApiNode());
    } catch (Exception e) {
      log.error("Could not " + toString() + ". " + e.getMessage() + " " + e.getCause(),e);
    }
View Full Code Here

TOP

Related Classes of org.uddi.api_v3.BindingTemplate

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.