@Override
public final JBIReply transform(final int httpStatus, final String httpStatusReason,
final Header[] httpResponseHeaders, final Source xmlPayloadToTransform, final CachedExchange jbiExchange,
final String contentId) throws MessagingException {
if (jbiExchange.getExchange().isInOnlyPattern() || jbiExchange.getExchange().isRobustInOnlyPattern()) {
if (this.logger.isLoggable(Level.FINE)) {
final MEPPatternConstants mep = MEPPatternConstants.fromURI(jbiExchange.getExchange().getPattern());
this.logger.fine(mep + " exchange and <on-http-status> for " + httpStatus + ": status DONE returned.");
}
return new DoneStatusReply();
} else {
try (final EasyByteArrayOutputStream out = new EasyByteArrayOutputStream()) {
this.doPayloadTransformation(httpStatus, httpStatusReason, httpResponseHeaders, xmlPayloadToTransform,
new StreamResult(out), jbiExchange, contentId, "OUT", out);
return new OutReply(new BytesSource(out.toRawByteArray()));
}
}
}