Package org.uddi.api_v3

Examples of org.uddi.api_v3.BindingTemplate


  }
 
  protected BindingTemplate parseServiceBinding(Class<?> classWithAnnotations, String lang,
      WebService webServiceAnnotation, Properties properties) {
   
    BindingTemplate bindingTemplate = null;
    UDDIServiceBinding uddiServiceBinding= (UDDIServiceBinding) classWithAnnotations.getAnnotation(UDDIServiceBinding.class);
    //binding
    if (uddiServiceBinding!=null) {
      bindingTemplate = new BindingTemplate();
     
      bindingTemplate.setBindingKey(TokenResolver.replaceTokens(uddiServiceBinding.bindingKey(), properties));
     
      String bindingLang = String.valueOf(lang);
      if (uddiServiceBinding.lang()!=null) {
        bindingLang = TokenResolver.replaceTokens(uddiServiceBinding.lang(),properties);
      }
      Description bindingDescription = new Description();
      bindingDescription.setLang(bindingLang);
      bindingDescription.setValue(TokenResolver.replaceTokens(uddiServiceBinding.description(),properties));
      bindingTemplate.getDescription().add(bindingDescription);
     
      AccessPoint accessPoint = new AccessPoint();
      accessPoint.setUseType(AccessPointType.WSDL_DEPLOYMENT.toString());
      if (!"".equals(uddiServiceBinding.accessPointType())) {
        accessPoint.setUseType(uddiServiceBinding.accessPointType());
      }
      if (!"".equals(uddiServiceBinding.accessPoint())) {
        String endPoint = uddiServiceBinding.accessPoint();
        endPoint = TokenResolver.replaceTokens(endPoint, properties);
                log.debug("AccessPoint EndPoint=" + endPoint);
        accessPoint.setValue(endPoint);
      } else if (webServiceAnnotation!=null && webServiceAnnotation.wsdlLocation()!=null) {
        accessPoint.setValue(webServiceAnnotation.wsdlLocation());
      }
      bindingTemplate.setAccessPoint(accessPoint);
     
      //tModelKeys on the binding
      if (!"".equals(uddiServiceBinding.tModelKeys())) {
        String[] tModelKeys= uddiServiceBinding.tModelKeys().split(",");
        for (String tModelKey : tModelKeys) {
          TModelInstanceInfo instanceInfo = new TModelInstanceInfo();
          instanceInfo.setTModelKey(tModelKey);
          if (bindingTemplate.getTModelInstanceDetails()==null) {
            bindingTemplate.setTModelInstanceDetails(new TModelInstanceDetails());
          }
          bindingTemplate.getTModelInstanceDetails().getTModelInstanceInfo().add(instanceInfo);
        }
      }
      //categoryBag on the binding
      if (!"".equals(uddiServiceBinding.categoryBag())) {
        CategoryBag categoryBag = parseCategoryBag(uddiServiceBinding.categoryBag());
            bindingTemplate.setCategoryBag(categoryBag);
      }
    } else {
      log.error("Missing UDDIServiceBinding annotation in class " + classWithAnnotations);
    }
    return bindingTemplate;
View Full Code Here


 
  public void saveNotifierBinding(String authInfo, String bindingXML, String bindingKey, Integer port) {
    try {
      SaveBinding sb = new SaveBinding();
      sb.setAuthInfo(authInfo);
      BindingTemplate btIn = (BindingTemplate)EntityCreator.buildFromDoc(bindingXML, "org.uddi.api_v3");
      String value = btIn.getAccessPoint().getValue();
      value = value.replace("{randomPort}", port.toString());
      sb.getBindingTemplate().add(btIn);
      publication.saveBinding(sb);   
    }
    catch(Exception e) {
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();
        }
        Description description = new Description();
        description.setLang(lang);
        description.setValue(bindingDescription);
        bindingTemplate.getDescription().add(description);
       
        // reference wsdl:binding tModel
        TModelInstanceInfo tModelInstanceInfoBinding = new TModelInstanceInfo();
        tModelInstanceInfoBinding.setTModelKey(keyDomainURI + binding.getQName().getLocalPart());
        InstanceDetails instanceDetails = new InstanceDetails();
        instanceDetails.setInstanceParms(portName)
        tModelInstanceInfoBinding.setInstanceDetails(instanceDetails);
        Description descriptionB = new Description();
        descriptionB.setLang(lang);
        descriptionB.setValue("The wsdl:binding that this wsdl:port implements. " + bindingDescription +
            " The instanceParms specifies the port local name.");
        tModelInstanceInfoBinding.getDescription().add(descriptionB);
        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();
        }
        Description descriptionPT = new Description();
        descriptionPT.setLang(lang);
        descriptionPT.setValue("The wsdl:portType that this wsdl:port implements." + portTypeDescription );
        tModelInstanceInfoPortType.getDescription().add(descriptionPT);
        tModelInstanceDetails.getTModelInstanceInfo().add(tModelInstanceInfoPortType);
       
        //reference bpel:process tModel
        TModelInstanceInfo tModelInstanceInfoBPEL = new TModelInstanceInfo();
        tModelInstanceInfoBPEL.setTModelKey(keyDomainURI + service.getQName().getLocalPart() + "Process");
        Description descriptionBPEL = new Description();
        // 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();
        }
        descriptionBPEL.setLang(lang);
        descriptionBPEL.setValue("The bpel:process this wsdl:port supports." + serviceDescription);
        tModelInstanceInfoBPEL.getDescription().add(descriptionBPEL);
        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

         * @param node
         * @return a binding object or null
         */
        public BindingTemplate register(BindingTemplate binding, Node node) {

                BindingTemplate bindingTemplate = null;
                log.info("Registering bindingTemplate with key " + binding.getBindingKey());
                try {
                        SaveBinding saveBinding = new SaveBinding();
                        saveBinding.setAuthInfo(getAuthToken(node.getSecurityUrl()));
                        saveBinding.getBindingTemplate().add(binding);
                        BindingDetail bindingDetail = getUDDINode().getTransport().getUDDIPublishService(node.getPublishUrl()).saveBinding(saveBinding);
                        bindingTemplate = bindingDetail.getBindingTemplate().get(0);
                        if (log.isDebugEnabled()) {
                                log.debug("Registering template binding " + bindingTemplate.getBindingKey() + " completed.");
                        }
                } catch (Exception e) {
                        log.error("Unable to register template binding " + binding.getBindingKey()
                                + " ." + e.getMessage(), e);
                } catch (Throwable t) {
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());
        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());
        AccessPoint ap = new AccessPoint();
        ap.setUseType(str255);
        ap.setValue("http://localhost");
        bt.setAccessPoint(ap);
        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());
        AccessPoint ap = new AccessPoint();
        ap.setUseType(str256);
        ap.setValue("http://localhost");
        bt.setAccessPoint(ap);
        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());
        AccessPoint ap = new AccessPoint();
        ap.setUseType(str255);
        ap.setValue(str4097);
        bt.setAccessPoint(ap);
        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());
        AccessPoint ap = new AccessPoint();
        ap.setUseType(str255);
        ap.setValue(str4096);
        bt.setAccessPoint(ap);
        bs.getBindingTemplates().getBindingTemplate().add(bt);

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

        sb.getBusinessEntity().add(be);
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.