StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,
configurationContext.getAxisConfiguration());
// Check that the sender of this AckRequest holds the correct token
RMDBean rmdBean = SandeshaUtil.getRMDBeanFromSequenceId(storageManager, sequenceId);
if(rmdBean != null && rmdBean.getSecurityTokenData() != null) {
SecurityManager secManager = SandeshaUtil.getSecurityManager(configurationContext);
SecurityToken token = secManager.recoverSecurityToken(rmdBean.getSecurityTokenData());
secManager.checkProofOfPossession(token, soapHeader, msgContext);
}
// Check that the sequence requested exists
if (FaultManager.checkForUnknownSequence(rmMsgCtx, sequenceId, storageManager, piggybackedAckRequest)) {
if (log.isDebugEnabled())
log.debug("Exit: AckRequestedProcessor::processAckRequestedHeader, Unknown sequence ");
return false;
}
// throwing a fault if the sequence is terminated
if (FaultManager.checkForSequenceTerminated(rmMsgCtx, sequenceId, rmdBean, piggybackedAckRequest)) {
if (log.isDebugEnabled())
log.debug("Exit: AckRequestedProcessor::processAckRequestedHeader, Sequence terminated");
return false;
}
// Setting the ack depending on AcksTo.
EndpointReference acksTo = new EndpointReference(rmdBean.getAcksToEPR());
String acksToStr = acksTo.getAddress();
if (acksToStr == null)
throw new SandeshaException(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.acksToStrNotSet));
//Getting the operation for ack messages.
AxisOperation ackOperation = SpecSpecificConstants.getWSRMOperation(
Sandesha2Constants.MessageTypes.ACK,
rmdBean.getRMVersion(),
msgContext.getAxisService());
MessageContext ackMsgCtx = SandeshaUtil.createNewRelatedMessageContext(rmMsgCtx, ackOperation);
//setting up the RMMsgContext