Package org.apache.tuscany.sca.binding.notification.encoding

Examples of org.apache.tuscany.sca.binding.notification.encoding.NewProducerResponse


        eaed.start();
       
        XMLInputFactory xif = XMLInputFactory.newInstance();
        XMLStreamReader reader = xif.createXMLStreamReader(new StringReader(testNewProducerResponse));
        reader.next();
        NewProducerResponse newProducerResponse = (NewProducerResponse)der.decode(reader);
        Assert.assertEquals(newProducerResponse.getSequenceType(), "EndConsumers");
        Iterator<EndpointReference> it = newProducerResponse.getReferenceSequence().iterator();
        it.next();
        Assert.assertEquals(it.next().getEndpointAddress().getAddress().toString(), testUrl2);
       
        XMLOutputFactory xof = XMLOutputFactory.newInstance();
        StringWriter testWriter = new StringWriter();
View Full Code Here


                URL producerUrl = np.getReference().getEndpointAddress().getAddress();
                if (brokerList == null) {
                    addProducer(producerUrl);
                }
   
                NewProducerResponse npr = new NewProducerResponse();
                if (consumerList != null) {
                    npr.setSequenceType(Constants.EndConsumers);
                    for (URL consumerUrl : consumerList) {
                        npr.addReferenceToSequence(EncodingUtils.createEndpointReference(consumerUrl, null));
                    }
                } else if(brokerList != null) {
                    npr.setSequenceType(Constants.BrokerConsumers);
                    for (BrokerStruct broker : brokerList) {
                        npr.addReferenceToSequence(EncodingUtils.createEndpointReference(broker.consumerUrl, null));
                    }
                } else {
                    npr.setSequenceType(Constants.NoConsumers);
                }
                try {
                    EncodingUtils.encodeToStream(encodingRegistry, npr, ostream);
                } catch(IOUtilsException e) {
                    throw new RuntimeException(e);
View Full Code Here

    public String newProducer(URI notificationType, URL producerUrl, URL remoteNtmUrl, List<URL> consumerListResult) {
        if (ntmUrlIsRemote(producerUrl, remoteNtmUrl)) {
            try {
                WriteableEPW wEPW = new WriteableEPW(new NewProducer(), producerUrl);
                InputStreamDecoder isd = new InputStreamDecoder();
                NewProducerResponse npr =
                    (NewProducerResponse)IOUtils.sendHttpRequest(remoteNtmUrl, Constants.NEW_PRODUCER_OP, wEPW, isd);
                String sequenceType = npr.getSequenceType();
                if (Constants.EndConsumers.equals(sequenceType) || Constants.BrokerConsumers.equals(sequenceType)) {
                    for (EndpointReference epr : npr.getReferenceSequence()) {
                        consumerListResult.add(epr.getEndpointAddress().getAddress());
                    }
                }
                return sequenceType;
            } catch(Exception e) {
View Full Code Here

                URL producerUrl = np.getReference().getEndpointAddress().getAddress();
                if (brokerList == null) {
                    addProducer(producerUrl);
                }
   
                NewProducerResponse npr = new NewProducerResponse();
                if (consumerList != null) {
                    npr.setSequenceType(Constants.EndConsumers);
                    for (URL consumerUrl : consumerList) {
                        npr.addReferenceToSequence(EncodingUtils.createEndpointReference(consumerUrl, null));
                    }
                }
                else if(brokerList != null) {
                    npr.setSequenceType(Constants.BrokerConsumers);
                    for (BrokerStruct broker : brokerList) {
                        npr.addReferenceToSequence(EncodingUtils.createEndpointReference(broker.consumerUrl, null));
                    }
                }
                else {
                    npr.setSequenceType(Constants.NoConsumers);
                }
                try {
                    EncodingUtils.encodeToStream(encodingRegistry, npr, ostream);
                }
                catch(IOUtilsException e) {
View Full Code Here

    public String newProducer(URI notificationType, URL producerUrl, URL remoteNtmUrl, List<URL> consumerListResult) {
        if (ntmUrlIsRemote(producerUrl, remoteNtmUrl)) {
            try {
                WriteableEPW wEPW = new WriteableEPW(new NewProducer(), producerUrl);
                InputStreamDecoder isd = new InputStreamDecoder();
                NewProducerResponse npr =
                    (NewProducerResponse)IOUtils.sendHttpRequest(remoteNtmUrl, Constants.NEW_PRODUCER_OP, wEPW, isd);
                String sequenceType = npr.getSequenceType();
                if (Constants.EndConsumers.equals(sequenceType) || Constants.BrokerConsumers.equals(sequenceType)) {
                    for (EndpointReference epr : npr.getReferenceSequence()) {
                        consumerListResult.add(epr.getEndpointAddress().getAddress());
                    }
                }
                return sequenceType;
            } catch(Exception e) {
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.binding.notification.encoding.NewProducerResponse

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.