Package org.uddi.api_v3

Examples of org.uddi.api_v3.InstanceDetails


                for (int i = 0; i < tModelInstanceInfo.size(); i++) {
                        TModelInstanceInfo t = new TModelInstanceInfo();
                        t.setTModelKey(tModelInstanceInfo.get(i).getTModelKey());
                        t.getDescription().addAll(MapDescription(tModelInstanceInfo.get(i).getDescription()));
                        if (tModelInstanceInfo.get(i).getInstanceDetails() != null) {
                                t.setInstanceDetails(new InstanceDetails());
                                t.getInstanceDetails().getDescription().addAll(MapDescription(tModelInstanceInfo.get(i).getInstanceDetails().getDescription()));
                                t.getInstanceDetails().setInstanceParms(tModelInstanceInfo.get(i).getInstanceDetails().getInstanceParms());
                                t.getInstanceDetails().getOverviewDoc().add(MapOverviewDoc(tModelInstanceInfo.get(i).getInstanceDetails().getOverviewDoc()));
                        }
                        r.add(t);
View Full Code Here


            throw new IllegalArgumentException("rhs");
        }
        if (lhs.getTModelInstanceInfo().isEmpty() || rhs.getTModelInstanceInfo().isEmpty()) {
            throw new IllegalArgumentException("no data to compare");
        }
        InstanceDetails lhsc = null;
        InstanceDetails rhsc = null;
        for (int i = 0; i < lhs.getTModelInstanceInfo().size(); i++) {
            if (lhs.getTModelInstanceInfo().get(i).getTModelKey().equalsIgnoreCase(compareField)) {
                lhsc = lhs.getTModelInstanceInfo().get(i).getInstanceDetails();
            }
        }
        for (int i = 0; i < rhs.getTModelInstanceInfo().size(); i++) {
            if (rhs.getTModelInstanceInfo().get(i).getTModelKey().equalsIgnoreCase(compareField)) {
                rhsc = rhs.getTModelInstanceInfo().get(i).getInstanceDetails();
            }
        }

        if (lhsc == null) {
            throw new IllegalArgumentException(compareField + " not found for lhs");
        }
        if (rhsc == null) {
            throw new IllegalArgumentException(compareField + " not found for rhs");
        }
        if (lhsc.getInstanceParms() == null) {
            throw new IllegalArgumentException(compareField + " found lhs, but no data");
        }
        if (rhsc.getInstanceParms() == null) {
            throw new IllegalArgumentException(compareField + " found rhs, but no data");
        }
        if (isNumber) {
            Double l = Double.parseDouble(lhsc.getInstanceParms());
            Double r = Double.parseDouble(rhsc.getInstanceParms());
            return l.compareTo(r);
        }

        if (isDate) {
            XMLGregorianCalendar l = fac.newXMLGregorianCalendar(lhsc.getInstanceParms());
            XMLGregorianCalendar r = fac.newXMLGregorianCalendar(rhsc.getInstanceParms());
            //System.out.println(l.toXMLFormat() + " " + r.toXMLFormat());
            int x = l.compare(r);

            if (x == DatatypeConstants.LESSER) {
                return -1;
            }

            if (x == DatatypeConstants.GREATER) {
                return 1;
            }
            if (x == DatatypeConstants.EQUAL) {
                return 0;
            }
            throw new ArrayIndexOutOfBoundsException("cannot compare, result was " + x);
        }

        if (isDuration) {
            Duration l = fac.newDuration(lhsc.getInstanceParms());
            Duration r = fac.newDuration(rhsc.getInstanceParms());
          //  System.out.println(l.toString() + " " + r.toString());
            int x = l.compare(r);

            if (x == DatatypeConstants.LESSER) {
                return -1;
View Full Code Here

            bindingTemplate.getDescription().addAll(Common2UDDI.mapDescription(getDescription(res.getDoc()), lang));

            // reference wsdl:binding tModel
            TModelInstanceInfo tModelInstanceInfoBinding = new TModelInstanceInfo();
            tModelInstanceInfoBinding.setTModelKey(keyDomainURI + "binding");
            InstanceDetails instanceDetails = new InstanceDetails();
            instanceDetails.setInstanceParms(portName);
            tModelInstanceInfoBinding.setInstanceDetails(instanceDetails);
          
            tModelInstanceInfoBinding.getDescription().addAll(Common2UDDI.mapDescription("The binding that this endpoint implements. " + bindingTemplate.getDescription().get(0).getValue()
                    + " The instanceParms specifies the \" port local name.", lang));
            TModelInstanceDetails tModelInstanceDetails = new TModelInstanceDetails();
View Full Code Here

        bt.setAccessPoint(new AccessPoint("http://localhost/endpoint1BAD", AccessPointType.WSDL_DEPLOYMENT.toString()));
        bt.setTModelInstanceDetails(new TModelInstanceDetails());
        TModelInstanceInfo tii = new TModelInstanceInfo();
        tii.setTModelKey(WSDMQosConstants.METRIC_FAULT_COUNT_KEY);

        tii.setInstanceDetails(new InstanceDetails());
        tii.getInstanceDetails().setInstanceParms("400");
        bt = UDDIClient.addSOAPtModels(bt);
        bt.getTModelInstanceDetails().getTModelInstanceInfo().add(tii);
        bs.getBindingTemplates().getBindingTemplate().add(bt);
       
        bt = new BindingTemplate();
        bt.setAccessPoint(new AccessPoint("http://localhost/endpoint2BETTER", AccessPointType.WSDL_DEPLOYMENT.toString()));
        bt.setTModelInstanceDetails(new TModelInstanceDetails());
         tii = new TModelInstanceInfo();
        tii.setTModelKey(WSDMQosConstants.METRIC_FAULT_COUNT_KEY);

        tii.setInstanceDetails(new InstanceDetails());
        tii.getInstanceDetails().setInstanceParms("4");
        bt = UDDIClient.addSOAPtModels(bt);
        bt.getTModelInstanceDetails().getTModelInstanceInfo().add(tii);
        bs.getBindingTemplates().getBindingTemplate().add(bt);
       
View Full Code Here

                BindingTemplate bt = new BindingTemplate();
                bt.setAccessPoint(new AccessPoint("http://localhost", AccessPointType.WSDL_DEPLOYMENT.toString()));
                bt.setTModelInstanceDetails(new TModelInstanceDetails());
                TModelInstanceInfo tii = new TModelInstanceInfo();
                tii.setTModelKey(WSDMQosConstants.METRIC_FAULT_COUNT_KEY);
                tii.setInstanceDetails(new InstanceDetails());
                tii.getInstanceDetails().setInstanceParms("400");
                bt = UDDIClient.addSOAPtModels(bt);
                bt.getTModelInstanceDetails().getTModelInstanceInfo().add(tii);
                bs.getBindingTemplates().getBindingTemplate().add(bt);
                be.getBusinessServices().getBusinessService().add(bs);
View Full Code Here

                transport.setTModelKey(UDDIConstants.TRANSPORT_AMQP);
                bt.getTModelInstanceDetails().getTModelInstanceInfo().add(transport);

                TModelInstanceInfo topic = new TModelInstanceInfo();
                topic.setTModelKey(TMODEL_DESTINATION_TYPE);
                topic.setInstanceDetails(new InstanceDetails());
                topic.getInstanceDetails().setInstanceParms("amq.topic");
                bt.getTModelInstanceDetails().getTModelInstanceInfo().add(topic);

                TModelInstanceInfo name = new TModelInstanceInfo();
                name.setTModelKey(TMODEL_DESTINATION_NAME);
                name.setInstanceDetails(new InstanceDetails());
                name.getInstanceDetails().setInstanceParms(TOPIC);
                bt.getTModelInstanceDetails().getTModelInstanceInfo().add(name);

                bs.getBindingTemplates().getBindingTemplate().add(bt);
View Full Code Here

    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 {
        List<RelatedBusinessInfo> biList = bInfos.getRelatedBusinessInfo();
        if (bInfos == null)
          Assert.fail("No result from find related business operation");
        if (biList == null || biList.size() == 0)
          Assert.fail("No result from find related business operation");
        Set<String> keys = new HashSet<String>();
View Full Code Here

  }
 
  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

      org.uddi.api_v3.BusinessService bsIn = (org.uddi.api_v3.BusinessService)EntityCreator.buildFromDoc(serviceXML, "org.uddi.api_v3");
      String serviceName = bsIn.getName().get(0).getValue();
      String bindingKey = bsIn.getBindingTemplates().getBindingTemplate().get(0).getBindingKey();
      for (int i=0; i<numberOfCopies; i++) {
          // save the entity
        SaveService ss = new SaveService();
        ss.setAuthInfo(authInfo);
        bsIn.getName().get(0).setValue(serviceName + "-" + i);
       
        bsIn.setServiceKey(serviceKey + "-" + i);
        bsIn.getBindingTemplates().getBindingTemplate().get(0).setBindingKey(bindingKey + "-" + i);
        ss.getBusinessService().add(bsIn);
        publication.saveService(ss);
        logger.debug("Add service with key " + bsIn.getServiceKey());
      }
    }
    catch(Exception e) {
View Full Code Here

 
 
  public void saveService(String authInfo, String serviceXML, String serviceKey) {
    try {
      // First save the entity
      SaveService ss = new SaveService();
      ss.setAuthInfo(authInfo);
     
      org.uddi.api_v3.BusinessService bsIn = (org.uddi.api_v3.BusinessService)EntityCreator.buildFromDoc(serviceXML, "org.uddi.api_v3");
      ss.getBusinessService().add(bsIn);
      publication.saveService(ss);
     
      // Now get the entity and check the values
      GetServiceDetail gs = new GetServiceDetail();
      gs.getServiceKey().add(serviceKey);
View Full Code Here

TOP

Related Classes of org.uddi.api_v3.InstanceDetails

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.