Examples of BindingTemplate


Examples of org.uddi.api_v3.BindingTemplate

  /**
   * Copies the TemplateBinding from one UDDI to another UDDI.
   */
  public void xRegisterServiceBinding() {
    try {
      BindingTemplate bindingTemplate = fromClerk.findServiceBinding(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

Examples of org.uddi.api_v3.BindingTemplate

      if (result == null)
        Assert.fail("Null result from find binding operation");
      List<BindingTemplate> btList = result.getBindingTemplate();
      if (btList == null || btList.size() == 0)
        Assert.fail("No result from find binding operation");
      BindingTemplate btOut = btList.get(0);
     
      BindingTemplate btIn = (BindingTemplate)EntityCreator.buildFromDoc(TckBindingTemplate.JOE_BINDING_XML, "org.uddi.api_v3");
     
      assertEquals(btIn.getServiceKey(), btOut.getServiceKey());
      assertEquals(btIn.getBindingKey(), btOut.getBindingKey());
     
      TckValidator.checkDescriptions(btIn.getDescription(), btOut.getDescription());
      TckValidator.checkCategories(btIn.getCategoryBag(), btOut.getCategoryBag());
    }
    catch(Exception e) {
      logger.error(e.getMessage(), e);
      Assert.fail("No exception should be thrown:  " + e.getMessage());
    }
View Full Code Here

Examples of org.uddi.api_v3.BindingTemplate

    try {
      // First save the entity
      SaveBinding sb = new SaveBinding();
      sb.setAuthInfo(authInfo);
     
      BindingTemplate btIn = (BindingTemplate)EntityCreator.buildFromDoc(bindingXML, "org.uddi.api_v3");
      sb.getBindingTemplate().add(btIn);
      publication.saveBinding(sb);
     
      // Now get the entity and check the values
      GetBindingDetail gb = new GetBindingDetail();
      gb.getBindingKey().add(bindingKey);
      BindingDetail bd = inquiry.getBindingDetail(gb);
      List<BindingTemplate> btOutList = bd.getBindingTemplate();
      BindingTemplate btOut = btOutList.get(0);

      assertEquals(btIn.getServiceKey(), btOut.getServiceKey());
      assertEquals(btIn.getBindingKey(), btOut.getBindingKey());
     
      TckValidator.checkDescriptions(btIn.getDescription(), btOut.getDescription());
      TckValidator.checkCategories(btIn.getCategoryBag(), btOut.getCategoryBag());
    }
    catch(Exception e) {
      logger.error(e.getMessage(), e);
      Assert.fail("No exception should be thrown: " + e.getMessage());
    }
View Full Code Here

Examples of org.uddi.api_v3.BindingTemplate

  public void saveNotifierBinding(String authInfo, String bindingXML, String bindingKey) {
    try {
      SaveBinding sb = new SaveBinding();
      sb.setAuthInfo(authInfo);
     
      BindingTemplate btIn = (BindingTemplate)EntityCreator.buildFromDoc(bindingXML, "org.uddi.api_v3");
      sb.getBindingTemplate().add(btIn);
      publication.saveBinding(sb);   
    }
    catch(Exception e) {
      logger.error(e.getMessage(), e);
View Full Code Here

Examples of org.uddi.api_v3.BindingTemplate

    }
    assertEquals(bts1.getBindingTemplate().size(), bts2.getBindingTemplate().size());
    Iterator<BindingTemplate> bt1Iter  = bts1.getBindingTemplate().iterator();
    Iterator<BindingTemplate> bt2Iter  = bts2.getBindingTemplate().iterator();
    while (bt1Iter.hasNext()) {
      BindingTemplate bt1 = bt1Iter.next();
      BindingTemplate bt2 = bt2Iter.next();
      assertEquals(bt1.getAccessPoint().getValue(),bt2.getAccessPoint().getValue());
      assertEquals(bt1.getAccessPoint().getUseType(),bt2.getAccessPoint().getUseType());
      assertEquals(bt1.getBindingKey(),bt2.getBindingKey());
      checkCategories(bt1.getCategoryBag(), bt2.getCategoryBag());
      checkDescriptions(bt1.getDescription(),bt2.getDescription());
      checkHostingRedirector(bt1.getHostingRedirector(),bt2.getHostingRedirector());
      //the inbound apiBindingTemplate can have a null serviceKey
      if (bt1.getServiceKey()!=null) {
        assertEquals(bt1.getServiceKey(),bt2.getServiceKey());
      }
      checkTModelInstanceDetails(bt1.getTModelInstanceDetails(),bt2.getTModelInstanceDetails());
    }
  }
View Full Code Here

Examples of org.uddi.api_v3.BindingTemplate

   * Register a service binding.
   *
   */
  public BindingTemplate register(BindingTemplate binding, Node node) {
   
    BindingTemplate bindingTemplate=null;
    log.info("Registering bindingTemplate with key " + binding.getBindingKey());
    try {
      String authToken = getAuthToken(node.getSecurityUrl());
      SaveBinding saveBinding = new SaveBinding();
      saveBinding.setAuthInfo(authToken);
      saveBinding.getBindingTemplate().add(binding);
      BindingDetail bindingDetail = getUDDINode().getTransport().getUDDIPublishService(node.getPublishUrl()).saveBinding(saveBinding);
      bindingTemplate = bindingDetail.getBindingTemplate().get(0);
    } catch (Exception e) {
      log.error("Unable to register template binding " + bindingTemplate.getBindingKey()
          + " ." + e.getMessage(),e);
    } catch (Throwable t) {
      log.error("Unable to register template binding " + bindingTemplate.getBindingKey()
          + " ." + t.getMessage(),t);
    }
    log.info("Registering template binding " + binding.getBindingKey() + " completed.");
    return bindingTemplate;
  }
View Full Code Here

Examples of org.uddi.api_v3.BindingTemplate

   @Test
     public void testReadingServiceBindingAnnotation() {
       try {
        Class classWithAnnotations = Loader.loadClass(HelloWorldMockup.class.getName());
        AnnotationProcessor ap = new AnnotationProcessor();
        BindingTemplate bindingTemplate = ap.parseServiceBinding(classWithAnnotations, "en", null, null);
        assertNotNull(bindingTemplate);
        //expecting references to two keys
        assertEquals(2, bindingTemplate.getTModelInstanceDetails().getTModelInstanceInfo().size());
        assertEquals("tModelKey1",bindingTemplate.getTModelInstanceDetails().getTModelInstanceInfo().get(0).getTModelKey());
        //expecting two KeyedReferences in the CategoryBag
        assertEquals(2, bindingTemplate.getCategoryBag().getKeyedReference().size());
        KeyedReference keyedReference2 = bindingTemplate.getCategoryBag().getKeyedReference().get(1);
       assertEquals("uddi-org:types:wsdl2",keyedReference2.getKeyName());
       assertEquals("wsdlDeployment2",keyedReference2.getKeyValue());
       assertEquals("uddi:uddi.org:categorization:types2",keyedReference2.getTModelKey());
       } catch (Exception e) {
         //we should not have any issues reading the annotations
View Full Code Here

Examples of org.uddi.api_v3.BindingTemplate

         properties.put("serverPort", "8080");
         BusinessService service = ap.readServiceAnnotations(HelloWorldMockup2.class.getName(),properties);
         assertNotNull(service);
         assertEquals("HelloWorldMockup2",service.getName().get(0).getValue());
         assertEquals(1,service.getBindingTemplates().getBindingTemplate().size());
         BindingTemplate binding = service.getBindingTemplates().getBindingTemplate().get(0);
         String endPoint = binding.getAccessPoint().getValue();
         assertEquals("http://localhost:8080/subscription-listener/helloworld",endPoint);
         String serviceKey = binding.getServiceKey();
         assertEquals(service.getServiceKey(),serviceKey);
         assertNull(service.getCategoryBag());
       } catch (Exception e) {
         //we should not have any issues reading the annotations
           e.printStackTrace();
View Full Code Here

Examples of org.uddi.api_v3.BindingTemplate

        CategoryBag categoryBag = parseCategoryBag(uddiService.categoryBag());
            service.setCategoryBag(categoryBag);
      }
     
      //bindingTemplate on service
      BindingTemplate bindingTemplate = parseServiceBinding(clazz, lang, webServiceAnnotation, properties);
      if (bindingTemplate!=null) {
        bindingTemplate.setServiceKey(service.getServiceKey());
        if (service.getBindingTemplates()==null) {
          service.setBindingTemplates(new BindingTemplates());
        }
        service.getBindingTemplates().getBindingTemplate().add(bindingTemplate);
      }
View Full Code Here

Examples of org.uddi.api_v3.BindingTemplate

 
  @SuppressWarnings("unchecked")
  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
TOP
Copyright © 2018 www.massapi.com. 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.