URL consumerUrl = nc.getReference().getEndpointAddress().getAddress();
if (brokerList == null) {
addConsumer(consumerUrl);
}
NewConsumerResponse ncr = new NewConsumerResponse();
if (producerList != null) {
ncr.setSequenceType(Constants.EndProducers);
for (URL producerUrl : producerList) {
ncr.addReferenceToSequence(EncodingUtils.createEndpointReference(producerUrl, null));
}
} else if(brokerList != null) {
ncr.setSequenceType(Constants.BrokerProducers);
for (BrokerStruct broker : brokerList) {
ncr.addReferenceToSequence(EncodingUtils.createEndpointReference(broker.producerUrl, null));
}
} else {
ncr.setSequenceType(Constants.NoProducers);
}
try {
EncodingUtils.encodeToStream(encodingRegistry, ncr, ostream);
} catch(IOUtilsException e) {
throw new RuntimeException(e);