AcknowledgementProcessor ackProcessor = new AcknowledgementProcessor();
ackProcessor.processMessage(createSeqResponseRMMsgCtx);
}
//Processing the create sequence response.
CreateSequenceResponse createSeqResponsePart = (CreateSequenceResponse) createSeqResponseRMMsgCtx
.getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ_RESPONSE);
if (createSeqResponsePart == null)
throw new SandeshaException("Create Sequence Response part is null");
String newOutSequenceId = createSeqResponsePart.getIdentifier()
.getIdentifier();
if (newOutSequenceId == null)
throw new SandeshaException("New sequence Id is null");
ConfigurationContext configCtx = createSeqResponseRMMsgCtx
.getMessageContext().getConfigurationContext();
String createSeqMsgId = createSeqResponseRMMsgCtx.getMessageContext()
.getRelatesTo().getValue();
StorageManager storageManager = SandeshaUtil
.getSandeshaStorageManager(configCtx);
SenderBeanMgr retransmitterMgr = storageManager
.getRetransmitterBeanMgr();
CreateSeqBeanMgr createSeqMgr = storageManager.getCreateSeqBeanMgr();
CreateSeqBean createSeqBean = createSeqMgr.retrieve(createSeqMsgId);
if (createSeqBean == null)
throw new SandeshaException("Create Sequence entry is not found");
String internalSequenceId = createSeqBean.getInternalSequenceId();
if (internalSequenceId == null || "".equals(internalSequenceId))
throw new SandeshaException("TempSequenceId has is not set");
//deleting the create sequence entry.
retransmitterMgr.delete(createSeqMsgId);
//storing new out sequence id
SequencePropertyBeanMgr sequencePropMgr = storageManager
.getSequencePropretyBeanMgr();
SequencePropertyBean outSequenceBean = new SequencePropertyBean(
internalSequenceId, Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID,
newOutSequenceId);
SequencePropertyBean internalSequenceBean = new SequencePropertyBean(
newOutSequenceId,
Sandesha2Constants.SequenceProperties.INTERNAL_SEQUENCE_ID, internalSequenceId);
sequencePropMgr.insert(outSequenceBean);
sequencePropMgr.insert(internalSequenceBean);
//processing for accept (offer has been sent)
Accept accept = createSeqResponsePart.getAccept();
if (accept != null) {
//Find offered sequence from internal sequence id.
SequencePropertyBean offeredSequenceBean = sequencePropMgr
.retrieve(internalSequenceId,
Sandesha2Constants.SequenceProperties.OFFERED_SEQUENCE);