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);