if (rmVersion == null)
throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.cannotDecideRMVersion));
String rmNamespaceValue = SpecSpecificConstants.getRMNamespaceValue(rmVersion);
SequenceAcknowledgement sequenceAck = new SequenceAcknowledgement(rmNamespaceValue);
Identifier id = new Identifier(rmNamespaceValue);
id.setIndentifer(sequenceId);
sequenceAck.setIdentifier(id);
SequencePropertyBeanMgr seqPropMgr = storageManager.getSequencePropertyBeanMgr();
SequencePropertyBean seqBean = seqPropMgr.retrieve(sequencePropertyKey,
Sandesha2Constants.SequenceProperties.SERVER_COMPLETED_MESSAGES);
String msgNoList = (String) seqBean.getValue();
ArrayList ackRangeArrayList = SandeshaUtil.getAckRangeArrayList(msgNoList, factory, rmNamespaceValue);
Iterator iterator = ackRangeArrayList.iterator();
while (iterator.hasNext()) {
AcknowledgementRange ackRange = (AcknowledgementRange) iterator.next();
sequenceAck.addAcknowledgementRanges(ackRange);
}
SequencePropertyBean sequenceClosedBean = seqPropMgr.retrieve(sequencePropertyKey,
Sandesha2Constants.SequenceProperties.SEQUENCE_CLOSED);
if (sequenceClosedBean != null && Sandesha2Constants.VALUE_TRUE.equals(sequenceClosedBean.getValue())) {
// sequence is closed. so add the 'Final' part.
if (SpecSpecificConstants.isAckFinalAllowed(rmVersion)) {
AckFinal ackFinal = new AckFinal(rmNamespaceValue);
sequenceAck.setAckFinal(ackFinal);
}
}
applicationMsg.setMessagePart(Sandesha2Constants.MessageParts.SEQ_ACKNOWLEDGEMENT, sequenceAck);
sequenceAck.toOMElement(envelope.getHeader());
if (applicationMsg.getWSAAction()==null) {
applicationMsg.setAction(SpecSpecificConstants.getSequenceAcknowledgementAction(SandeshaUtil.getRMVersion(
sequenceId, storageManager)));
applicationMsg.setSOAPAction(SpecSpecificConstants.getSequenceAcknowledgementSOAPAction(SandeshaUtil