createSeqResponse.setProperty(Sandesha2Constants.APPLICATION_PROCESSING_DONE, "true");
CreateSequenceResponse createSeqResPart = createSeqResponse.getCreateSequenceResponse();
// OFFER PROCESSING
SequenceOffer offer = createSeqPart.getSequenceOffer();
if (offer != null) {
Accept accept = createSeqResPart.getAccept();
if (accept == null) {
if (log.isDebugEnabled())
log.debug(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.noAcceptPart));
FaultManager.makeCreateSequenceRefusedFault(createSeqRMMsg, SandeshaMessageHelper.getMessage(SandeshaMessageKeys.noAcceptPart),
new Exception(),
null);
// Return false if an Exception hasn't been thrown.
if (log.isDebugEnabled())
log.debug("Exit: CreateSeqMsgProcessor::processInMessage " + Boolean.FALSE);
return false;
}
// offered seq id
String offeredSequenceID = offer.getIdentifer().getIdentifier();
//Need to see if this is a duplicate offer.
//If it is we can't accept the offer as we can't be sure it has come from the same client.
RMSBean finderBean = new RMSBean ();
finderBean.setSequenceID(offeredSequenceID);
RMSBean rMSBean = storageManager.getRMSBeanMgr().findUnique(finderBean);
boolean offerAccepted = false;
String outgoingSideInternalSequenceId = SandeshaUtil
.getOutgoingSideInternalSequenceID(rmdBean.getSequenceID());
if(rMSBean != null){
if (log.isDebugEnabled())
log.debug("Duplicate offer so we can't accept as we can't be sure it's from the same client: " + offeredSequenceID);
offerAccepted = false;
} else {
boolean isValidseqID = isValidseqID(offeredSequenceID, context, createSeqRMMsg, storageManager);
offerAccepted = true;
//Before processing this offer any further we need to perform some extra checks
//on the offered EP if WS-RM Spec 1.1 is being used
if(isValidseqID && Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(rmdBean.getRMVersion())){
Endpoint endpoint = offer.getEndpoint();
if (endpoint!=null) {
//Check to see if the offer endpoint has a value of WSA Anonymous
String addressingNamespace = (String) createSeqRMMsg.getProperty(AddressingConstants.WS_ADDRESSING_VERSION);
String endpointAddress = endpoint.getEPR().getAddress();
if(SpecSpecificConstants.getAddressingAnonymousURI(addressingNamespace).equals(endpointAddress)){