Package org.apache.juddi.datatype.response

Examples of org.apache.juddi.datatype.response.BusinessInfo


    this.maker = maker;
  }

  public RegistryObject unmarshal(Element element)
  {
    BusinessInfo obj = new BusinessInfo();
    Vector nodeList = null;
    AbstractHandler handler = null;

    // Attributes
    obj.setBusinessKey(element.getAttribute("businessKey"));

    // Text Node Value
    // {none}

    // Child Elements
    nodeList = XMLUtils.getChildElementsByTagName(element,NameHandler.TAG_NAME);
    for (int i=0; i<nodeList.size(); i++)
    {
      handler = maker.lookup(NameHandler.TAG_NAME);
      Name name = (Name )handler.unmarshal((Element)nodeList.elementAt(i));
      if (name != null)
        obj.addName(name);
    }

    nodeList = XMLUtils.getChildElementsByTagName(element,DescriptionHandler.TAG_NAME);
    for (int i=0; i<nodeList.size(); i++)
    {
      handler = maker.lookup(DescriptionHandler.TAG_NAME);
      Description descr = (Description)handler.unmarshal((Element)nodeList.elementAt(i));
      if (descr != null)
        obj.addDescription(descr);
    }

    nodeList = XMLUtils.getChildElementsByTagName(element,ServiceInfosHandler.TAG_NAME);
    if (nodeList.size() > 0)
    {
      handler = maker.lookup(ServiceInfosHandler.TAG_NAME);
      obj.setServiceInfos((ServiceInfos)handler.unmarshal((Element)nodeList.elementAt(0)));
    }

    return obj;
  }
View Full Code Here


    return obj;
  }

  public void marshal(RegistryObject object,Element parent)
  {
    BusinessInfo info = (BusinessInfo)object;
    String generic = getGeneric(null);
    String namespace = getUDDINamespace(generic);
    Element element = parent.getOwnerDocument().createElementNS(namespace,TAG_NAME);
    AbstractHandler handler = null;

    String businessKey = info.getBusinessKey();
    if (businessKey != null)
      element.setAttribute("businessKey",businessKey);

    Vector nameVector = info.getNameVector();
    if ((nameVector!=null) && (nameVector.size() > 0))
    {
      handler = maker.lookup(NameHandler.TAG_NAME);
      for (int i=0; i < nameVector.size(); i++)
        handler.marshal((org.apache.juddi.datatype.Name)nameVector.elementAt(i),element);
    }

    Vector descVector = info.getDescriptionVector();
    if ((descVector!=null) && (descVector.size() > 0))
    {
      handler = maker.lookup(DescriptionHandler.TAG_NAME);
      for (int i=0; i < descVector.size(); i++)
        handler.marshal((Description)descVector.elementAt(i),element);
    }

    ServiceInfos infos = info.getServiceInfos();
    if (infos != null)
    {
      handler = maker.lookup(ServiceInfosHandler.TAG_NAME);
      handler.marshal(infos,element);
    }
View Full Code Here

    sInfo.addName(new Name("regInfoServNm"));
    sInfo.addName(new Name("regInfoServNm2","en"));
    sInfo.setServiceKey("826e6443-e3c5-442b-9bf8-943071ca83f4");
    sInfo.setBusinessKey("56644a68-8779-46c7-93ce-90eeb7569f3f");

    BusinessInfo bInfo = new BusinessInfo();
    bInfo.setBusinessKey("56644a68-8779-46c7-93ce-90eeb7569f3f");
    bInfo.addName(new Name("regInfoBizNm"));
    bInfo.addName(new Name("regInfoBizNm2","en"));
    bInfo.addDescription(new Description("regInfoBiz whatever"));
    bInfo.addDescription(new Description("regInfoBiz whatever too","fr"));
    bInfo.addServiceInfo(sInfo);

    BusinessInfos bInfos = new BusinessInfos();
    bInfos.addBusinessInfo(bInfo);
    bInfos.addBusinessInfo(bInfo);
View Full Code Here

   *
   */
  public BusinessInfo fetchBusinessInfo(String businessKey)
    throws org.apache.juddi.error.RegistryException
  {
    BusinessInfo info = null;

    if ((businessKey != null) && (connection != null))
    {
      try
      {
        info = new BusinessInfo();
        info.setBusinessKey(businessKey);
        info.setNameVector(BusinessNameTable.select(businessKey,connection));
        info.setDescriptionVector(BusinessDescTable.select(businessKey,connection));
        info.setServiceInfos(fetchServiceInfosByBusinessKey(businessKey));
      }
      catch(java.sql.SQLException sqlex)
      {
        throw new RegistryException(sqlex);
      }
View Full Code Here

      infoVector = new Vector(rowCount);
      for (int i=0; i<rowCount; i++)
      {
        String relatedKey = (String)keyVector.elementAt(i);
        BusinessInfo bizInfo = fetchBusinessInfo(relatedKey);

        if(bizInfo != null)
        {
          RelatedBusinessInfo relatedBizInfo = new  RelatedBusinessInfo();

          relatedBizInfo.setBusinessKey(bizInfo.getBusinessKey());
          relatedBizInfo.setNameVector( bizInfo.getNameVector() );
          relatedBizInfo.setDescriptionVector( bizInfo.getDescriptionVector() );

          Vector keyedReferences = PublisherAssertionTable.selectRelatedBusinesses(businessKey,relatedKey,connection);
          relatedBizInfo.setSharedRelationships(new SharedRelationships(keyedReferences));

          infoVector.addElement(relatedBizInfo);
View Full Code Here

   *
   */
  public BusinessInfo fetchBusinessInfo(String businessKey)
    throws org.apache.juddi.error.RegistryException
  {
    BusinessInfo info = null;

    if ((businessKey != null) && (connection != null))
    {
      try
      {
        info = new BusinessInfo();
        info.setBusinessKey(businessKey);
        info.setNameVector(BusinessNameTable.select(businessKey,connection));
        info.setDescriptionVector(BusinessDescTable.select(businessKey,connection));
        info.setServiceInfos(fetchServiceInfosByBusinessKey(businessKey));
      }
      catch(java.sql.SQLException sqlex)
      {
        throw new RegistryException(sqlex);
      }
View Full Code Here

      infoVector = new Vector(rowCount);
      for (int i=0; i<rowCount; i++)
      {
        String relatedKey = (String)keyVector.elementAt(i);
        BusinessInfo bizInfo = fetchBusinessInfo(relatedKey);

        if(bizInfo != null)
        {
          RelatedBusinessInfo relatedBizInfo = new  RelatedBusinessInfo();

          relatedBizInfo.setBusinessKey(bizInfo.getBusinessKey());
          relatedBizInfo.setNameVector( bizInfo.getNameVector() );
          relatedBizInfo.setDescriptionVector( bizInfo.getDescriptionVector() );

          Vector keyedReferences = PublisherAssertionTable.selectRelatedBusinesses(businessKey,relatedKey,connection);
          relatedBizInfo.setSharedRelationships(new SharedRelationships(keyedReferences));

          infoVector.addElement(relatedBizInfo);
View Full Code Here

    this.maker = maker;
  }

  public RegistryObject unmarshal(Element element)
  {
    BusinessInfo obj = new BusinessInfo();
    Vector nodeList = null;
    AbstractHandler handler = null;

    // Attributes
    obj.setBusinessKey(element.getAttribute("businessKey"));

    // Text Node Value
    // {none}

    // Child Elements
    nodeList = XMLUtils.getChildElementsByTagName(element,NameHandler.TAG_NAME);
    for (int i=0; i<nodeList.size(); i++)
    {
      handler = maker.lookup(NameHandler.TAG_NAME);
      Name name = (Name )handler.unmarshal((Element)nodeList.elementAt(i));
      if (name != null)
        obj.addName(name);
    }

    nodeList = XMLUtils.getChildElementsByTagName(element,DescriptionHandler.TAG_NAME);
    for (int i=0; i<nodeList.size(); i++)
    {
      handler = maker.lookup(DescriptionHandler.TAG_NAME);
      Description descr = (Description)handler.unmarshal((Element)nodeList.elementAt(i));
      if (descr != null)
        obj.addDescription(descr);
    }

    nodeList = XMLUtils.getChildElementsByTagName(element,ServiceInfosHandler.TAG_NAME);
    if (nodeList.size() > 0)
    {
      handler = maker.lookup(ServiceInfosHandler.TAG_NAME);
      obj.setServiceInfos((ServiceInfos)handler.unmarshal((Element)nodeList.elementAt(0)));
    }

    return obj;
  }
View Full Code Here

    return obj;
  }

  public void marshal(RegistryObject object,Element parent)
  {
    BusinessInfo info = (BusinessInfo)object;
    Element element = parent.getOwnerDocument().createElementNS(null,TAG_NAME);
    AbstractHandler handler = null;

    String businessKey = info.getBusinessKey();
    if (businessKey != null)
      element.setAttribute("businessKey",businessKey);

    Vector nameVector = info.getNameVector();
    if ((nameVector!=null) && (nameVector.size() > 0))
    {
      handler = maker.lookup(NameHandler.TAG_NAME);
      for (int i=0; i < nameVector.size(); i++)
        handler.marshal((org.apache.juddi.datatype.Name)nameVector.elementAt(i),element);
    }

    Vector descVector = info.getDescriptionVector();
    if ((descVector!=null) && (descVector.size() > 0))
    {
      handler = maker.lookup(DescriptionHandler.TAG_NAME);
      for (int i=0; i < descVector.size(); i++)
        handler.marshal((Description)descVector.elementAt(i),element);
    }

    ServiceInfos infos = info.getServiceInfos();
    if (infos != null)
    {
      handler = maker.lookup(ServiceInfosHandler.TAG_NAME);
      handler.marshal(infos,element);
    }
View Full Code Here

    sInfo.addName(new Name("regInfoServNm"));
    sInfo.addName(new Name("regInfoServNm2","en"));
    sInfo.setServiceKey("826e6443-e3c5-442b-9bf8-943071ca83f4");
    sInfo.setBusinessKey("56644a68-8779-46c7-93ce-90eeb7569f3f");

    BusinessInfo bInfo = new BusinessInfo();
    bInfo.setBusinessKey("56644a68-8779-46c7-93ce-90eeb7569f3f");
    bInfo.addName(new Name("regInfoBizNm"));
    bInfo.addName(new Name("regInfoBizNm2","en"));
    bInfo.addDescription(new Description("regInfoBiz whatever"));
    bInfo.addDescription(new Description("regInfoBiz whatever too","fr"));
    bInfo.addServiceInfo(sInfo);

    BusinessInfos bInfos = new BusinessInfos();
    bInfos.addBusinessInfo(bInfo);
    bInfos.addBusinessInfo(bInfo);
View Full Code Here

TOP

Related Classes of org.apache.juddi.datatype.response.BusinessInfo

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.