// again.
CreateSequenceResponse createSeqResPart = (CreateSequenceResponse) createSeqResponse
.getMessagePart(Sandesha2Constants.MessageParts.CREATE_SEQ_RESPONSE);
// OFFER PROCESSING
SequenceOffer offer = createSeqPart.getSequenceOffer();
if (offer != null) {
Accept accept = createSeqResPart.getAccept();
if (accept == null) {
String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.noAcceptPart);
log.debug(message);
throw new SandeshaException(message);
}
String offeredSequenceID = offer.getIdentifer().getIdentifier(); // offered
// seq.
// id.
boolean offerEcepted = offerAccepted(offeredSequenceID, context, createSeqRMMsg, storageManager);
if (offerEcepted) {
// Setting the CreateSequence table entry for the outgoing
// side.
RMSBean rmsBean = new RMSBean();
rmsBean.setSequenceID(offeredSequenceID);
String outgoingSideInternalSequenceId = SandeshaUtil
.getOutgoingSideInternalSequenceID(newSequenceId);
rmsBean.setInternalSequenceID(outgoingSideInternalSequenceId);
rmsBean.setCreateSeqMsgID(SandeshaUtil.getUUID()); // this
// is a
// dummy
// value.
String outgoingSideSequencePropertyKey = outgoingSideInternalSequenceId;
RMSBeanMgr rmsBeanMgr = storageManager.getRMSBeanMgr();
rmsBeanMgr.insert(rmsBean);
// Setting sequence properties for the outgoing sequence.
// Only will be used by the server side response path. Will
// be wasted properties for the client side.
// setting the out_sequence_id
SequencePropertyBean outSequenceBean = new SequencePropertyBean();
outSequenceBean.setName(Sandesha2Constants.SequenceProperties.OUT_SEQUENCE_ID);
outSequenceBean.setValue(offeredSequenceID);
outSequenceBean.setSequencePropertyKey(outgoingSideSequencePropertyKey);
seqPropMgr.insert(outSequenceBean);
// setting the internal_sequence_id
SequencePropertyBean internalSequenceBean = new SequencePropertyBean();
internalSequenceBean.setName(Sandesha2Constants.SequenceProperties.INTERNAL_SEQUENCE_ID);
internalSequenceBean.setSequencePropertyKey(offeredSequenceID);
internalSequenceBean.setValue(outgoingSideInternalSequenceId);
seqPropMgr.insert(internalSequenceBean);
Endpoint endpoint = offer.getEndpoint();
if (endpoint!=null) {
// setting the OfferedEndpoint
SequencePropertyBean offeredEndpointBean = new SequencePropertyBean();
offeredEndpointBean.setName(Sandesha2Constants.SequenceProperties.OFFERED_ENDPOINT);