Package org.uddi.api_v2

Examples of org.uddi.api_v2.InstanceDetails


    public void testCompareToDurationGT() throws DatatypeConfigurationException {
        System.out.println("TModelInstanceDetailsComparator.compare testCompareToDurationGT");
        TModelInstanceDetails lhs = new TModelInstanceDetails();
        lhs.getTModelInstanceInfo().add(new TModelInstanceInfo());
        lhs.getTModelInstanceInfo().get(0).setTModelKey("hi");
        lhs.getTModelInstanceInfo().get(0).setInstanceDetails(new InstanceDetails());
        lhs.getTModelInstanceInfo().get(0).getInstanceDetails().setInstanceParms("P5Y");
        TModelInstanceDetails rhs = new TModelInstanceDetails();

        rhs.getTModelInstanceInfo().add(new TModelInstanceInfo());
        rhs.getTModelInstanceInfo().get(0).setTModelKey("hi");
        rhs.getTModelInstanceInfo().get(0).setInstanceDetails(new InstanceDetails());
        rhs.getTModelInstanceInfo().get(0).getInstanceDetails().setInstanceParms("P2Y");
        TModelInstanceDetailsComparator instance = new TModelInstanceDetailsComparator("hi", false, false, true);
        int result = instance.compare(lhs, rhs);
        Assert.assertTrue("result " + lhs.getTModelInstanceInfo().get(0).getInstanceDetails().getInstanceParms() + " compare to " +
                rhs.getTModelInstanceInfo().get(0).getInstanceDetails().getInstanceParms() + " " +
View Full Code Here


    public void testCompareToDurationEQ() throws DatatypeConfigurationException {
        System.out.println("TModelInstanceDetailsComparator.compare testCompareToDurationEQ");
        TModelInstanceDetails lhs = new TModelInstanceDetails();
        lhs.getTModelInstanceInfo().add(new TModelInstanceInfo());
        lhs.getTModelInstanceInfo().get(0).setTModelKey("hi");
        lhs.getTModelInstanceInfo().get(0).setInstanceDetails(new InstanceDetails());
        lhs.getTModelInstanceInfo().get(0).getInstanceDetails().setInstanceParms("P5Y");
        TModelInstanceDetails rhs = new TModelInstanceDetails();

        rhs.getTModelInstanceInfo().add(new TModelInstanceInfo());
        rhs.getTModelInstanceInfo().get(0).setTModelKey("hi");
        rhs.getTModelInstanceInfo().get(0).setInstanceDetails(new InstanceDetails());
        rhs.getTModelInstanceInfo().get(0).getInstanceDetails().setInstanceParms("P5Y");
        TModelInstanceDetailsComparator instance = new TModelInstanceDetailsComparator("hi", false, false, true);
        int result = instance.compare(lhs, rhs);
        Assert.assertTrue("result " + lhs.getTModelInstanceInfo().get(0).getInstanceDetails().getInstanceParms() + " compare to " +
                lhs.getTModelInstanceInfo().get(0).getInstanceDetails().getInstanceParms() + " " +
View Full Code Here

                                bindingTemplate.getDescription().addAll(Common2UDDI.mapDescription(bindingDescription, lang));

                                // reference wsdl:binding tModel
                                TModelInstanceInfo tModelInstanceInfoBinding = new TModelInstanceInfo();
                                tModelInstanceInfoBinding.setTModelKey(keyDomainURI + binding.getQName().getLocalPart());
                                InstanceDetails instanceDetails = new InstanceDetails();
                                instanceDetails.setInstanceParms(portName);
                                tModelInstanceInfoBinding.setInstanceDetails(instanceDetails);

                                tModelInstanceInfoBinding.getDescription().addAll(Common2UDDI.mapDescription("The wsdl:binding that this wsdl:port implements. " + bindingDescription
                                        + " The instanceParms specifies the port local name.", lang));
                                tModelInstanceDetails.getTModelInstanceInfo().add(tModelInstanceInfoBinding);
View Full Code Here

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

                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

TOP

Related Classes of org.uddi.api_v2.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.