String sequenceId = closeSequence.getIdentifier().getIdentifier();
StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configCtx, configCtx
.getAxisConfiguration());
RMDBean rmdBean = SandeshaUtil.getRMDBeanFromSequenceId(storageManager, sequenceId);
// Check that the sender of this CloseSequence holds the correct token
if(rmdBean != null && rmdBean.getSecurityTokenData() != null) {
SecurityManager secManager = SandeshaUtil.getSecurityManager(msgCtx.getConfigurationContext());
OMElement body = msgCtx.getEnvelope().getBody();
SecurityToken token = secManager.recoverSecurityToken(rmdBean.getSecurityTokenData());
secManager.checkProofOfPossession(token, body, msgCtx);
}
if (FaultManager.checkForUnknownSequence(rmMsgCtx, sequenceId, storageManager, false)) {
if (log.isDebugEnabled())
log.debug("Exit: CloseSequenceProcessor::processInMessage, Unknown sequence " + sequenceId);
return false;
}
// throwing a fault if the sequence is terminated
if (FaultManager.checkForSequenceTerminated(rmMsgCtx, sequenceId, rmdBean, false)) {
if (log.isDebugEnabled())
log.debug("Exit: CloseSequenceProcessor::processInMessage, Sequence terminated");
return false;
}
rmdBean.setClosed(true);
storageManager.getRMDBeanMgr().update(rmdBean);
RMMsgContext ackRMMsgCtx = AcknowledgementManager.generateAckMessage(rmMsgCtx, rmdBean, sequenceId, storageManager, true);
// adding the ack part(s) to the envelope.
Iterator sequenceAckIter = ackRMMsgCtx