Examples of RelatedBusinessesList


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

    handler = ( RelatedBusinessesListHandler)maker.lookup( RelatedBusinessesListHandler.TAG_NAME);
  }

  private RegistryObject getRegistryObject()
  {
    RelatedBusinessesList object = new RelatedBusinessesList();
    object.setGeneric("2.0");
    object.setOperator("jUDDI.org");
    object.setTruncated(true);
    object.setBusinessKey(new BusinessKey("f9f0c35f-06ab-4bec-9c7d-b1469e73f0eb"));
    object.addRelatedBusinessInfo(new RelatedBusinessInfo("abc"));
    object.addRelatedBusinessInfo(new RelatedBusinessInfo("xyz"));


    return object;

  }
View Full Code Here

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

    this.maker = maker;
  }

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

    // We could use the generic attribute value to
    // determine which version of UDDI was used to
    // format the request XML. - Steve

    // Attributes
    obj.setGeneric(element.getAttribute("generic"));
    obj.setOperator(element.getAttribute("operator"));

    // We can ignore the xmlns attribute since we
    // can always determine it's value using the
    // "generic" attribute. - Steve

    String truncValue = element.getAttribute("truncated");
    if (truncValue != null)
      obj.setTruncated(truncValue.equalsIgnoreCase("true"));

    // Text Node Value
    // {none}

    // Child Elements
    nodeList = XMLUtils.getChildElementsByTagName(element,BusinessKeyHandler.TAG_NAME);
    if (nodeList.size() > 0)
    {
      handler = maker.lookup(BusinessKeyHandler.TAG_NAME);
      obj.setBusinessKey((BusinessKey)handler.unmarshal((Element)nodeList.elementAt(0)));
    }

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

    return obj;
  }
View Full Code Here

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

    return obj;
  }

  public void marshal(RegistryObject object,Element parent)
  {
    RelatedBusinessesList list = (RelatedBusinessesList)object;
    Element element = parent.getOwnerDocument().createElement(TAG_NAME);
    AbstractHandler handler = null;

    String generic = list.getGeneric();
    if (generic != null)
    {
      element.setAttribute("generic",generic);

      if (generic.equals(IRegistry.UDDI_V1_GENERIC))
        element.setAttribute("xmlns",IRegistry.UDDI_V1_NAMESPACE);
      else if (generic.equals(IRegistry.UDDI_V2_GENERIC))
        element.setAttribute("xmlns",IRegistry.UDDI_V2_NAMESPACE);
      else if (generic.equals(IRegistry.UDDI_V3_GENERIC))
        element.setAttribute("xmlns",IRegistry.UDDI_V3_NAMESPACE);
    }

    String operator = list.getOperator();
    if (operator != null)
      element.setAttribute("operator",operator);

    boolean truncated = list.isTruncated();
    if (truncated)
      element.setAttribute("truncated","true");

    BusinessKey key = list.getBusinessKey();
    if (key != null)
    {
      handler = maker.lookup(BusinessKeyHandler.TAG_NAME);
      handler.marshal(key,element);
    }

    RelatedBusinessInfos infos = list.getRelatedBusinessInfos();
    if (infos != null)
    {
      handler = maker.lookup(RelatedBusinessInfosHandler.TAG_NAME);
      handler.marshal(infos,element);
    }
View Full Code Here

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

    AbstractHandler handler = maker.lookup(RelatedBusinessesListHandler.TAG_NAME);

    Element parent = XMLUtils.newRootElement();
    Element child = null;

    RelatedBusinessesList list = new RelatedBusinessesList();
    list.setGeneric("2.0");
    list.setOperator("jUDDI.org");
    list.setTruncated(true);
    list.setBusinessKey(new BusinessKey("f9f0c35f-06ab-4bec-9c7d-b1469e73f0eb"));
    list.addRelatedBusinessInfo(new RelatedBusinessInfo("abc"));
    list.addRelatedBusinessInfo(new RelatedBusinessInfo("xyz"));

    System.out.println();

    RegistryObject regObject = list;
    handler.marshal(regObject,parent);
View Full Code Here

Examples of org.uddi.api_v2.RelatedBusinessesList

       
        public static RelatedBusinessesList MapRelatedBusinessList(org.uddi.api_v3.RelatedBusinessesList findRelatedBusinesses, String operator) {
                if (findRelatedBusinesses == null) {
                        return null;
                }
                RelatedBusinessesList r = new RelatedBusinessesList();
                r.setGeneric(VERSION);
                r.setOperator(operator);
                r.setBusinessKey(findRelatedBusinesses.getBusinessKey());
                if (findRelatedBusinesses.isTruncated() != null && findRelatedBusinesses.isTruncated()) {
                        r.setTruncated(Truncated.TRUE);
                } else {
                        r.setTruncated(Truncated.FALSE);
                }
                r.setRelatedBusinessInfos(new RelatedBusinessInfos());
                if (findRelatedBusinesses.getRelatedBusinessInfos() != null) {
                       
                        for (int i = 0; i < findRelatedBusinesses.getRelatedBusinessInfos().getRelatedBusinessInfo().size(); i++) {
                                RelatedBusinessInfo x = new RelatedBusinessInfo();
                                x.setBusinessKey(findRelatedBusinesses.getRelatedBusinessInfos().getRelatedBusinessInfo().get(i).getBusinessKey());
                                x.getDescription().addAll(MapDescription(findRelatedBusinesses.getRelatedBusinessInfos().getRelatedBusinessInfo().get(i).getDescription()));
                                x.getName().addAll(MapName(findRelatedBusinesses.getRelatedBusinessInfos().getRelatedBusinessInfo().get(i).getName()));
                                r.getRelatedBusinessInfos().getRelatedBusinessInfo().add(x);
                        }
                }
                return r;
        }
View Full Code Here

Examples of org.uddi.api_v3.RelatedBusinessesList

  }
 
  public void findRelatedBusiness_sortByName(boolean isOneSided) {
    try {
      FindRelatedBusinesses body = (FindRelatedBusinesses)EntityCreator.buildFromDoc(FIND_RELATED_BUSINESS_SORT_BY_NAME_XML, "org.uddi.api_v3");
      RelatedBusinessesList result = inquiry.findRelatedBusinesses(body);
      if (result == null)
        Assert.fail("Null result from find related business operation");
      RelatedBusinessInfos bInfos = result.getRelatedBusinessInfos();
   
      //both parties need to register the assertion for it to be live.
      if (isOneSided) {
        Assert.assertNull(bInfos);
      } else {
View Full Code Here

Examples of org.uddi.api_v3.RelatedBusinessesList

      TransportException, ConfigurationException  {
    FindRelatedBusinesses findRelatedBusinesses = new FindRelatedBusinesses();
    findRelatedBusinesses.setBusinessKey(businessKey);
    findRelatedBusinesses.setAuthInfo(node.getSecurityUrl());
    try {
      RelatedBusinessesList rbl = getUDDINode().getTransport().getUDDIInquiryService(node.getInquiryUrl()).findRelatedBusinesses(findRelatedBusinesses);
      return rbl;
    } catch (DispositionReportFaultMessage dr) {
      DispositionReport report = DispositionReportFaultMessage.getDispositionReport(dr);
      checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, businessKey);
    } catch (SOAPFaultException sfe) {
View Full Code Here

Examples of org.uddi.api_v3.RelatedBusinessesList

  public static RelatedBusinessesList getRelatedBusinessesList(FindRelatedBusinesses body, EntityManager em) throws DispositionReportFaultMessage {
    return getRelatedBusinessesList(body, em, null, null);
  }
 
  public static RelatedBusinessesList getRelatedBusinessesList(FindRelatedBusinesses body, EntityManager em, Date modifiedAfter, Date modifiedBefore) throws DispositionReportFaultMessage {
    RelatedBusinessesList result = new RelatedBusinessesList();
    ListDescription listDesc = new ListDescription();
    result.setListDescription(listDesc);
   
    // Either one of the businessKey, fromKey or toKey will be passed.  This is considered the "focal" business to which related businesses must be
    // found.  Rather than use a query, it seems simpler to take advantage of the model's publisher assertion collections.
    org.uddi.api_v3.RelatedBusinessInfos relatedBusinessInfos = new org.uddi.api_v3.RelatedBusinessInfos();
    if (body.getBusinessKey() != null ) {
      InquiryHelper.getRelatedBusinesses(em, Direction.FROM_KEY, body.getBusinessKey(), body.getKeyedReference(), relatedBusinessInfos, modifiedAfter, modifiedBefore);
      InquiryHelper.getRelatedBusinesses(em, Direction.TO_KEY, body.getBusinessKey(), body.getKeyedReference(), relatedBusinessInfos, modifiedAfter, modifiedBefore);
    }
    else if (body.getFromKey() != null)
      InquiryHelper.getRelatedBusinesses(em, Direction.FROM_KEY, body.getFromKey(), body.getKeyedReference(), relatedBusinessInfos, modifiedAfter, modifiedBefore);
    else if (body.getToKey() != null)
      InquiryHelper.getRelatedBusinesses(em, Direction.TO_KEY, body.getToKey(), body.getKeyedReference(), relatedBusinessInfos, modifiedAfter, modifiedBefore);

    if (relatedBusinessInfos.getRelatedBusinessInfo().size() > 0) {
      // TODO: Do proper pagination!
      listDesc.setActualCount(relatedBusinessInfos.getRelatedBusinessInfo().size());
      listDesc.setIncludeCount(relatedBusinessInfos.getRelatedBusinessInfo().size());
      listDesc.setListHead(1);
     
      result.setRelatedBusinessInfos(relatedBusinessInfos);
    }
   
    return result;
  }
View Full Code Here

Examples of org.uddi.api_v3.RelatedBusinessesList

        }
       
      }
      if (subscriptionFilter.getFindRelatedBusinesses() != null) {
        FindRelatedBusinesses findRelatedBusiness = subscriptionFilter.getFindRelatedBusinesses();
        RelatedBusinessesList  relatedBusinessList = InquiryHelper.getRelatedBusinessesList(findRelatedBusiness, em, startPointDate, endPointDate);
        result.setRelatedBusinessesList(relatedBusinessList);
      }
      if (subscriptionFilter.getGetBindingDetail() != null) {
        GetBindingDetail getDetail = subscriptionFilter.getGetBindingDetail();
       
View Full Code Here

Examples of org.uddi.api_v3.RelatedBusinessesList

      // TODO: findQualifiers aren't really used for this call, except maybe for sorting.  Sorting must be done in Java due to the retrieval method used.  Right now
      // no sorting is performed.
      org.apache.juddi.query.util.FindQualifiers findQualifiers = new org.apache.juddi.query.util.FindQualifiers();
      findQualifiers.mapApiFindQualifiers(body.getFindQualifiers());

      RelatedBusinessesList result = InquiryHelper.getRelatedBusinessesList(body, em);

      tx.commit();
                        long procTime = System.nanoTime() - startTime;
                        serviceCounter.update(InquiryQuery.FIND_RELATEDBUSINESSES, QueryStatus.SUCCESS, procTime);                     
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.