Package org.apache.juddi.datatype.binding

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


   *
   */
  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

      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

        // 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

        // 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

    tModInstInfo.setInstanceDetails(instDetails);

    TModelInstanceDetails tModInstDet = new TModelInstanceDetails();
    tModInstDet.addTModelInstanceInfo(tModInstInfo);

    BindingTemplate binding =  new BindingTemplate();
    binding.setBindingKey("c9613c3c-fe55-4f34-a3da-b3167afbca4a");
    binding.setServiceKey("997a55bc-563d-4c04-8a94-781604870d31");
    binding.addDescription(new Description("whatever"));
    binding.addDescription(new Description("whatever too","fr"));
    binding.setHostingRedirector(new HostingRedirector("92658289-0bd7-443c-8948-0bb4460b44c0"));
    binding.setAccessPoint(new AccessPoint(AccessPoint.HTTP,"http://www.juddi.org/service.wsdl"));
    binding.setTModelInstanceDetails(tModInstDet);

    BindingTemplates object = new BindingTemplates();
    object.addBindingTemplate(binding);
    object.addBindingTemplate(binding);
    return object;
View Full Code Here

    tModInstInfo.setInstanceDetails(instDetails);

    TModelInstanceDetails tModInstDet = new TModelInstanceDetails();
    tModInstDet.addTModelInstanceInfo(tModInstInfo);

    BindingTemplate binding =  new BindingTemplate();
    binding.setBindingKey("c9613c3c-fe55-4f34-a3da-b3167afbca4a");
    binding.setServiceKey("997a55bc-563d-4c04-8a94-781604870d31");
    binding.addDescription(new Description("whatever"));
    binding.addDescription(new Description("whatever too","fr"));
    binding.setHostingRedirector(new HostingRedirector("92658289-0bd7-443c-8948-0bb4460b44c0"));
    binding.setAccessPoint(new AccessPoint(AccessPoint.HTTP,"http://www.sviens.com/service.wsdl"));
    binding.setTModelInstanceDetails(tModInstDet);

    BindingTemplates bindings = new BindingTemplates();
    bindings.addBindingTemplate(binding);

    CategoryBag catBag = new CategoryBag();
View Full Code Here

      // Validate request parameters
      for (int i=0; i<bindingVector.size(); i++)
      {
        // Move the BindingTemplate into a form we can work with easily
        BindingTemplate binding = (BindingTemplate)bindingVector.elementAt(i);
        String serviceKey = binding.getServiceKey();
        String bindingKey = binding.getBindingKey();

        // Confirm that the 'BusinessService' that this binding belongs to
        // really exists. If not then throw an InvalidKeyPassedException.
       if ((serviceKey == null) || (serviceKey.length() == 0) || (!dataStore.isValidServiceKey(serviceKey)))
          throw new InvalidKeyPassedException("save_binding: "+
              "serviceKey="+serviceKey);

        // Confirm that 'publisherID' controls the BusinessService that this
        // binding template belongs to.  If not then throw a UserMismatchException.
        if (!dataStore.isServicePublisher(serviceKey,publisherID))
          throw new UserMismatchException("save_binding: "+
              "publisherID="+publisherID+", "+
              "serviceKey="+serviceKey);

        // If a BindingKey was specified then make sure it's a valid one.
        if ((bindingKey != null) && (bindingKey.length() > 0) && (!dataStore.isValidBindingKey(bindingKey)))
          throw new InvalidKeyPassedException("save_binding: "+
              "bindingKey="+bindingKey);

        // Normally, a valid tModelKey MUST be specified for the keyedReference
        // to be valid. However, in the case of a keyedReference that is used in
        // a categoryBag, the tModelKey may be omitted or specified as a
        // zero-length string to indicate that the taxonomy being used is
        // uddi-org:general_keywords. When it is omitted in this manner, the UDDI
        // registry will insert the proper key during the save_xx operation.
        // - UDDI Programmers API v2.04 Section 4.3.5.1 Specifying keyedReferences
        //
        CategoryBag categoryBag = binding.getCategoryBag();
        if (categoryBag != null)
        {
          Vector keyedRefVector = categoryBag.getKeyedReferenceVector();
          if (keyedRefVector != null)
          {
            int vectorSize = keyedRefVector.size();
            if (vectorSize > 0)
            {
              for (int j=0; j<vectorSize; j++)
              {
                KeyedReference keyedRef = (KeyedReference)keyedRefVector.elementAt(j);
                String key = keyedRef.getTModelKey();
               
                // A null or zero-length tModelKey is treated as
                // though the tModelKey for uddiorg:general_keywords
                // had been specified.
                //
                if ((key == null) || (key.trim().length() == 0))
                  keyedRef.setTModelKey(TModel.GENERAL_KEYWORDS_TMODEL_KEY);
              }
            }
          }
        }
      }

      for (int i=0; i<bindingVector.size(); i++)
      {
        // move the BindingTemplate data into a form we can work with easily
        BindingTemplate binding = (BindingTemplate)bindingVector.elementAt(i);
        String bindingKey = binding.getBindingKey();

        // If the new BindingTemplate has a BindingKey then it must already
        // exists so delete the old one. It a BindingKey isn't specified then
        // this is a new BindingTemplate so create a new BindingKey for it.
        if ((bindingKey != null) && (bindingKey.length() > 0))
          dataStore.deleteBinding(bindingKey);
        else
          binding.setBindingKey(uuidgen.uuidgen());

        // everything checks out so let's save it.
        dataStore.saveBinding(binding);
      }
View Full Code Here

    tModInstInfo.setInstanceDetails(instDetails);

    TModelInstanceDetails tModInstDet = new TModelInstanceDetails();
    tModInstDet.addTModelInstanceInfo(tModInstInfo);

    BindingTemplate binding =  new BindingTemplate();
    binding.setBindingKey("c9613c3c-fe55-4f34-a3da-b3167afbca4a");
    binding.setServiceKey("997a55bc-563d-4c04-8a94-781604870d31");
    binding.addDescription(new Description("whatever"));
    binding.addDescription(new Description("whatever too","fr"));
    binding.setHostingRedirector(new HostingRedirector("92658289-0bd7-443c-8948-0bb4460b44c0"));
    binding.setAccessPoint(new AccessPoint(AccessPoint.HTTP,"http://www.juddi.org/service.wsdl"));
    binding.setTModelInstanceDetails(tModInstDet);

    SaveBinding object = new SaveBinding();
    object.setAuthInfo(authInfo);
    object.addBindingTemplate(binding);
    object.addBindingTemplate(binding);
View Full Code Here

    if (bindingVector == null)
      return null;
  
    for (int i=0; i<bindingVector.size(); i++)
    {
      BindingTemplate binding = (BindingTemplate)bindingVector.elementAt(i);
   
      CategoryBag catBag = binding.getCategoryBag();
      if (catBag != null)
      {
        Vector refs = catBag.getKeyedReferenceVector();
        if ((refs != null) && (refs.size() > 0))
          validate(refs);
View Full Code Here

TOP

Related Classes of org.apache.juddi.datatype.binding.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.