Examples of BindingTemplate


Examples of org.apache.juddi.datatype.binding.BindingTemplate

   * @throws java.sql.SQLException
   */
  public static BindingTemplate select(String bindingKey,Connection connection)
    throws java.sql.SQLException
  {
    BindingTemplate binding = null;
    PreparedStatement statement = null;
    ResultSet resultSet = null;

    try
    {
      statement = connection.prepareStatement(selectSQL);
      statement.setString(1,bindingKey.toString());

      if (log.isDebugEnabled()) {
          log.debug("select from " + tablePrefix + "BINDING_TEMPLATE table:\n\n\t" + selectSQL +
            "\n\t BINDING_KEY=" + bindingKey.toString() + "\n");
      }

      resultSet = statement.executeQuery();
      if (resultSet.next())
      {
        binding = new BindingTemplate();
        binding.setServiceKey(resultSet.getString(1));//("SERVICE_KEY"));
        binding.setBindingKey(bindingKey);

        String urlType = resultSet.getString(2);//("ACCESS_POINT_TYPE");
        String url = resultSet.getString(3);//("ACCESS_POINT_URL");
        if ((urlType != null) && (url != null))
          binding.setAccessPoint(new AccessPoint(urlType,url));

        String redirectorKey = resultSet.getString(4);//("HOSTING_REDIRECTOR");
        if (redirectorKey != null)
          binding.setHostingRedirector(new HostingRedirector(redirectorKey));
      }

      return binding;
    }
    finally
View Full Code Here

Examples of org.apache.juddi.datatype.binding.BindingTemplate

      }

      // execute the statement
      resultSet = statement.executeQuery();

      BindingTemplate binding = null;
      while (resultSet.next())
      {
        binding = new BindingTemplate();
        binding.setServiceKey(serviceKey);
        binding.setBindingKey(resultSet.getString(1));//("BINDING_KEY"));

        String urlType = resultSet.getString(2);//("ACCESS_POINT_TYPE");
        String url = resultSet.getString(3);//("ACCESS_POINT_URL");
        if ((urlType != null) && (url != null))
          binding.setAccessPoint(new AccessPoint(urlType,url));

        String redirectorKey = resultSet.getString(4);//("HOSTING_REDIRECTOR");
        if (redirectorKey != null)
          binding.setHostingRedirector(new HostingRedirector(redirectorKey));

        bindList.add(binding);
        binding = null;
      }
View Full Code Here

Examples of org.apache.juddi.datatype.binding.BindingTemplate

   *
   */
  public BindingTemplate fetchBinding(String bindingKey)
    throws org.apache.juddi.error.RegistryException
  {
    BindingTemplate binding = null;

    try
    {
      if ((bindingKey != null) && (connection != null))
      {
        // fetch the BindingTempate and it's Description Vector
        binding = BindingTemplateTable.select(bindingKey,connection);
        binding.setDescriptionVector(BindingDescTable.select(bindingKey,connection));

        // fetch the BindingTemplate's CategoryBag (UDDI v3.0)
        CategoryBag bag = new CategoryBag();
        bag.setKeyedReferenceVector(BindingCategoryTable.select(bindingKey,connection));
        binding.setCategoryBag(bag);

        // fetch the BindingTemplate's TModelInstanceInfos
        Vector infoVector = TModelInstanceInfoTable.select(bindingKey,connection);
        if (infoVector != null)
        {
          int vectorSize = infoVector.size();
          for (int infoID=0; infoID<vectorSize; infoID++)
          {
            TModelInstanceInfo info = (TModelInstanceInfo)infoVector.elementAt(infoID);

            // fetch the TModelInstanceInfo Descriptions
            info.setDescriptionVector(TModelInstanceInfoDescTable.select(bindingKey,infoID,connection));

            InstanceDetails instDetails = info.getInstanceDetails();
            if (instDetails != null)
            {
              // fetch the InstanceDetail Descriptions
              instDetails.setDescriptionVector(InstanceDetailsDescTable.select(bindingKey,infoID,connection));

              // fetch the InstanceDetail OverviewDoc Descrptions
              OverviewDoc overDoc = instDetails.getOverviewDoc();
              if (overDoc != null)
              {
                overDoc.setDescriptionVector(InstanceDetailsDocDescTable.select(bindingKey,infoID,connection));
                instDetails.setOverviewDoc(overDoc);
              }
            }
          }

          TModelInstanceDetails details = new TModelInstanceDetails();
          details.setTModelInstanceInfoVector(infoVector);
          binding.setTModelInstanceDetails(details);
        }
      }
    }
    catch(java.sql.SQLException sqlex)
    {
View Full Code Here

Examples of org.apache.juddi.datatype.binding.BindingTemplate

      if ((serviceKey != null) && (connection != null))
      {
        Vector tempList = BindingTemplateTable.selectByServiceKey(serviceKey,connection);
        for (int i=0; i<tempList.size(); i++)
        {
          BindingTemplate binding = (BindingTemplate)tempList.elementAt(i);
          bindingList.add(fetchBinding(binding.getBindingKey()));
        }
      }
    }
    catch(java.sql.SQLException sqlex)
    {
View Full Code Here

Examples of org.apache.juddi.datatype.binding.BindingTemplate

        // loop through the vector deleting each server in turn
        int listSize = bindings.size();
        for (int i=0; i<listSize; i++)
        {
          BindingTemplate binding = (BindingTemplate)bindings.elementAt(i);
          deleteBinding(binding.getBindingKey());
        }
      }
    }
    catch(java.sql.SQLException sqlex)
    {
View Full Code Here

Examples of org.apache.juddi.datatype.binding.BindingTemplate

        // save all of the binding templates that were found
        int listSize = bindingList.size();
        for (int i=0; i<listSize; i++)
        {
          BindingTemplate binding = (BindingTemplate)bindingList.elementAt(i);
          binding.setServiceKey(serviceKey);
          binding.setBindingKey(uuidgen.uuidgen());
          saveBinding(binding);
        }
      }
    }
    catch(java.sql.SQLException sqlex)
View Full Code Here

Examples of org.apache.juddi.model.BindingTemplate

*/
public class NotifierTest
  @Test
  public void testHTTPNotifier() throws IllegalArgumentException, SecurityException, URISyntaxException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException {
    BindingTemplate bindingTemplate = new BindingTemplate();
    bindingTemplate.setEntityKey("uddi:uddi.joepublisher.com:bindingnotifier");
    bindingTemplate.setAccessPointType(AccessPointType.END_POINT.toString());
    bindingTemplate.setAccessPointUrl("http://localhost:12345/tcksubscriptionlistener");
    TmodelInstanceInfo instanceInfo = new TmodelInstanceInfo();
    instanceInfo.setTmodelKey("uddi:uddi.org:transport:http");
    bindingTemplate.getTmodelInstanceInfos().add(instanceInfo);
   
    Notifier notifier = new NotifierFactory().getNotifier(bindingTemplate);
   
    Assert.assertEquals(HTTPNotifier.class, notifier.getClass());
  }
View Full Code Here

Examples of org.apache.ws.scout.model.uddi.v2.BindingTemplate

        return address;
    }

  public static BindingTemplate getBindingTemplateFromJAXRSB(
      ServiceBinding serviceBinding) throws JAXRException {
    BindingTemplate bt = objectFactory.createBindingTemplate();
    if (serviceBinding.getKey() != null && serviceBinding.getKey().getId() != null) {
      bt.setBindingKey(serviceBinding.getKey().getId());
    } else {
      bt.setBindingKey("");
    }
 
    try {
      // Set Access URI
            String accessuri = serviceBinding.getAccessURI();
      if (accessuri != null) {
        AccessPoint accessPoint = objectFactory.createAccessPoint();
                accessPoint.setURLType(getURLType(accessuri));
        accessPoint.setValue(accessuri);
                bt.setAccessPoint(accessPoint);
            }
            ServiceBinding sb = serviceBinding.getTargetBinding();
      if (sb != null) {
        HostingRedirector red = objectFactory.createHostingRedirector();
                Key key = sb.getKey();
        if (key != null && key.getId() != null) {
          red.setBindingKey(key.getId());
                } else {
                    red.setBindingKey("");
                }
                bt.setHostingRedirector(red);
            } else {
              if (bt.getAccessPoint() == null) {
                bt.setAccessPoint(objectFactory.createAccessPoint());
              }
            }
      // TODO:Need to look further at the mapping b/w BindingTemplate and
      // Jaxr ServiceBinding

      // Get Service information
           Service svc = serviceBinding.getService();
      if (svc != null && svc.getKey() != null && svc.getKey().getId() != null) {
              bt.setServiceKey(svc.getKey().getId());
           }
     
      InternationalString idesc = serviceBinding.getDescription();
           
            addDescriptions(bt.getDescription(), idesc);

      // SpecificationLink
           Collection<SpecificationLink> slcol = serviceBinding.getSpecificationLinks();
      TModelInstanceDetails tid = objectFactory.createTModelInstanceDetails();
      if (slcol != null && !slcol.isEmpty()) {
              Iterator<SpecificationLink> iter = slcol.iterator();
        while (iter.hasNext()) {
          SpecificationLink slink = (SpecificationLink) iter.next();

          TModelInstanceInfo emptyTInfo = objectFactory.createTModelInstanceInfo();
          tid.getTModelInstanceInfo().add(emptyTInfo);

                    RegistryObject specificationObject = slink.getSpecificationObject();
          if (specificationObject.getKey() != null && specificationObject.getKey().getId() != null) {
            emptyTInfo.setTModelKey(specificationObject.getKey().getId());
                        if (specificationObject.getDescription()!=null) {
                            for (Object o : specificationObject.getDescription().getLocalizedStrings()) {
                                LocalizedString locDesc = (LocalizedString) o;
                                Description description = objectFactory.createDescription();
                                emptyTInfo.getDescription().add(description);
                                description.setValue(locDesc.getValue());
                                description.setLang(locDesc.getLocale().getLanguage());
                            }
                        }
                        Collection<ExternalLink> externalLinks = slink.getExternalLinks();
                        if (externalLinks!=null && externalLinks.size()>0) {
                            for (ExternalLink link : externalLinks) {
                                InstanceDetails ids = objectFactory.createInstanceDetails();
                                emptyTInfo.setInstanceDetails(ids);
                                if (link.getDescription()!=null) {
                                    Description description = objectFactory.createDescription();
                                    ids.getDescription().add(description);
                                    description.setValue(link.getDescription().getValue());
                                }
                                if (link.getExternalURI()!=null) {
                                    OverviewDoc overviewDoc = objectFactory.createOverviewDoc();
                                    ids.setOverviewDoc(overviewDoc);
                                    overviewDoc.setOverviewURL(link.getExternalURI());
                                }
                            }
                        }
          }
              }
            }
      bt.setTModelInstanceDetails(tid);
      log.debug("BindingTemplate=" + bt.toString());
    } catch (Exception ud) {
            throw new JAXRException("Apache JAXR Impl:", ud);
        }
        return bt;
    }
View Full Code Here

Examples of org.apache.ws.scout.uddi.BindingTemplate

        return address;
    }

  public static BindingTemplate getBindingTemplateFromJAXRSB(
      ServiceBinding serve) throws JAXRException {
    BindingTemplate bt = BindingTemplate.Factory.newInstance();
    if (serve.getKey() != null && serve.getKey().getId() != null) {
      bt.setBindingKey(serve.getKey().getId());
    } else {
      bt.setBindingKey("");
    }
 
    try {
      // Set Access URI
            String accessuri = serve.getAccessURI();
      if (accessuri != null) {
        AccessPoint ap = AccessPoint.Factory.newInstance();
                ap.setURLType(getURLType(accessuri));
        ap.setStringValue(accessuri);
                bt.setAccessPoint(ap);
            }
            ServiceBinding sb = serve.getTargetBinding();
      if (sb != null) {
        HostingRedirector red = HostingRedirector.Factory.newInstance();
                Key key = sb.getKey();
        if (key != null && key.getId() != null) {
          red.setBindingKey(key.getId());
                } else {
                    red.setBindingKey("");
                }
                bt.setHostingRedirector(red);
            } else {
              if (bt.getAccessPoint() == null) {
                bt.setAccessPoint(AccessPoint.Factory.newInstance());
              }
            }
      // TODO:Need to look further at the mapping b/w BindingTemplate and
      // Jaxr ServiceBinding

      // Get Service information
           Service svc = serve.getService();
      if (svc != null && svc.getKey() != null && svc.getKey().getId() != null) {
              bt.setServiceKey(svc.getKey().getId());
           }
     
      InternationalString idesc = ((RegistryObject) serve).getDescription();
           
            if (idesc != null) {
                for (LocalizedString locName : idesc.getLocalizedStrings()) {
                    Description desc = bt.addNewDescription();
                    desc.setStringValue(locName.getValue());
                    desc.setLang(locName.getLocale().getLanguage());               
                }
            }

      // SpecificationLink
           Collection<SpecificationLink> slcol = serve.getSpecificationLinks();
      TModelInstanceDetails tid = TModelInstanceDetails.Factory
          .newInstance();
      if (slcol != null && !slcol.isEmpty()) {
              Iterator<SpecificationLink> iter = slcol.iterator();
        while (iter.hasNext()) {
          SpecificationLink slink = (SpecificationLink) iter.next();

          TModelInstanceInfo emptyTInfo = tid
              .addNewTModelInstanceInfo();

                    RegistryObject specificationObject = slink.getSpecificationObject();
          if (specificationObject.getKey() != null && specificationObject.getKey().getId() != null) {
            emptyTInfo.setTModelKey(specificationObject.getKey().getId());
                        if (specificationObject.getDescription()!=null) {
                            for (LocalizedString locDesc : specificationObject.getDescription().getLocalizedStrings()) {
                                Description description = emptyTInfo.addNewDescription();
                                description.setStringValue(locDesc.getValue());
                                description.setLang(locDesc.getLocale().getLanguage());
                            }
                        }
                        Collection<ExternalLink> externalLinks = slink.getExternalLinks();
                        if (externalLinks!=null && externalLinks.size()>0) {
                            for (ExternalLink link : externalLinks) {
                                InstanceDetails ids = emptyTInfo.addNewInstanceDetails();
                                if (link.getDescription()!=null) {
                                    Description description = ids.addNewDescription();
                                    description.setStringValue(link.getDescription().getValue());
                                }
                                if (link.getExternalURI()!=null) {
                                    OverviewDoc overviewDoc = ids.addNewOverviewDoc();
                                    overviewDoc.setOverviewURL(link.getExternalURI());
                                }
                            }
                        }
          }
              }
            }
      bt.setTModelInstanceDetails(tid);
      log.debug("BindingTemplate=" + bt.toString());
    } catch (Exception ud) {
            throw new JAXRException("Apache JAXR Impl:", ud);
        }
        return bt;
    }
View Full Code Here

Examples of org.uddi.api_v2.BindingTemplate

       
        public static org.uddi.api_v2.BindingTemplate MapBinding(org.uddi.api_v3.BindingTemplate be) {
                if (be == null) {
                        return null;
                }
                BindingTemplate item = new org.uddi.api_v2.BindingTemplate();
                item.getDescription().addAll(MapDescription(be.getDescription()));
               
                item.setBindingKey(be.getBindingKey());
                item.setServiceKey(be.getServiceKey());
                item.setAccessPoint(MapAccessPoint(be.getAccessPoint()));
                item.setHostingRedirector(MapHostingRedir(be.getHostingRedirector()));
               
                item.setTModelInstanceDetails(MapTModelInstanceDetails(be.getTModelInstanceDetails()));
               
                return item;
        }
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.