.getSandeshaStorageManager(configurationContext);
} catch (SandeshaException e) {
e.printStackTrace();
}
SequencePropertyBeanMgr seqPropMgr = storageManager
.getSequencePropretyBeanMgr();
SequencePropertyBean receivedMsgBean = new SequencePropertyBean(
sequenceId, Sandesha2Constants.SequenceProperties.SERVER_COMPLETED_MESSAGES, "");
//setting the addressing version
String addressingNamespaceValue = createSequenceMsg.getAddressingNamespaceValue();
SequencePropertyBean addressingNamespaceBean = new SequencePropertyBean (
sequenceId,Sandesha2Constants.SequenceProperties.ADDRESSING_NAMESPACE_VALUE,addressingNamespaceValue);
seqPropMgr.insert(addressingNamespaceBean);
String anonymousURI = SpecSpecificConstants.getAddressingAnonymousURI(addressingNamespaceValue);
//If no replyTo value. Send responses as sync.
SequencePropertyBean toBean = null;
if (replyTo!=null) {
toBean = new SequencePropertyBean(sequenceId,
Sandesha2Constants.SequenceProperties.TO_EPR, replyTo.getAddress());
}else {
toBean = new SequencePropertyBean(sequenceId,
Sandesha2Constants.SequenceProperties.TO_EPR, anonymousURI);
}
SequencePropertyBean replyToBean = new SequencePropertyBean(sequenceId,
Sandesha2Constants.SequenceProperties.REPLY_TO_EPR, to.getAddress());
SequencePropertyBean acksToBean = new SequencePropertyBean(sequenceId,
Sandesha2Constants.SequenceProperties.ACKS_TO_EPR, acksTo.getAddress());
seqPropMgr.insert(receivedMsgBean);
seqPropMgr.insert(replyToBean);
seqPropMgr.insert(acksToBean);
if (toBean!=null)
seqPropMgr.insert(toBean);
NextMsgBeanMgr nextMsgMgr = storageManager.getNextMsgBeanMgr();
nextMsgMgr.insert(new NextMsgBean(sequenceId, 1)); // 1 will be the next
// message to invoke. This will apply for only in-order invocations.
SandeshaUtil.startSenderForTheSequence(configurationContext,sequenceId);
//stting the RM SPEC version for this sequence.
String createSequenceMsgAction = createSequenceMsg.getWSAAction();
if (createSequenceMsgAction==null)
throw new SandeshaException ("Create sequence message does not have the WSA:Action value");
String messageRMNamespace = createSequence.getNamespaceValue();
String specVersion = null;
if (Sandesha2Constants.SPEC_2005_02.NS_URI.equals(messageRMNamespace)) {
specVersion = Sandesha2Constants.SPEC_VERSIONS.v1_0;
}else if (Sandesha2Constants.SPEC_2005_10.NS_URI.equals(messageRMNamespace)) {
specVersion = Sandesha2Constants.SPEC_VERSIONS.v1_1;
} else {
throw new SandeshaException ("Create sequence message does not has a valid RM namespace value. Cant decide the RM version");
}
SequencePropertyBean specVerionBean = new SequencePropertyBean ();
specVerionBean.setSequenceID(sequenceId);
specVerionBean.setName(Sandesha2Constants.SequenceProperties.RM_SPEC_VERSION);
specVerionBean.setValue(specVersion);
seqPropMgr.insert(specVerionBean);
//TODO get the SOAP version from the create seq message.
return sequenceId;
}