CreateSequenceResponseType createResponse =
RMUtils.getWSRMFactory().createCreateSequenceResponseType();
createResponse.setIdentifier(destination.generateSequenceIdentifier());
DestinationPolicyType dp = reliableEndpoint.getManager().getDestinationPolicy();
Duration supportedDuration = dp.getSequenceExpiration();
if (null == supportedDuration) {
supportedDuration = DatatypeFactory.PT0S;
}
Expires ex = create.getExpires();
if (null != ex || supportedDuration.isShorterThan(DatatypeFactory.PT0S)) {
Duration effectiveDuration = supportedDuration;
if (null != ex && supportedDuration.isLongerThan(ex.getValue())) {
effectiveDuration = supportedDuration;
}
ex = RMUtils.getWSRMFactory().createExpires();
ex.setValue(effectiveDuration);
createResponse.setExpires(ex);
}
OfferType offer = create.getOffer();
if (null != offer) {
AcceptType accept = RMUtils.getWSRMFactory().createAcceptType();
if (dp.isAcceptOffers()) {
Source source = reliableEndpoint.getSource();
LOG.fine("Accepting inbound sequence offer");
// AddressingProperties maps = RMContextUtils.retrieveMAPs(message, false, false);
AttributedURI to = VersionTransformer.convert(maps.getTo());
accept.setAcksTo(RMUtils.createReference2004(to.getValue()));