if (createTransaction)
reportTransaction = storageManager.getTransaction();
sequenceReport.setInternalSequenceID(internalSequenceID);
RMSBean createSeqFindBean = new RMSBean();
createSeqFindBean.setInternalSequenceID(internalSequenceID);
RMSBean rMSBean = createSeqMgr.findUnique(createSeqFindBean);
// if data not is available sequence has to be terminated or
// timedOut.
if (rMSBean != null && rMSBean.isTerminated()) {
// check weather this is an terminated sequence.
sequenceReport.setSequenceStatus(SequenceReport.SEQUENCE_STATUS_TERMINATED);
fillOutgoingSequenceInfo(sequenceReport, rMSBean, storageManager);
return sequenceReport;
} else if (rMSBean != null && rMSBean.isTimedOut()) {
sequenceReport.setSequenceStatus(SequenceReport.SEQUENCE_STATUS_TIMED_OUT);
fillOutgoingSequenceInfo(sequenceReport, rMSBean, storageManager);
return sequenceReport;
} else if (rMSBean == null) {
// sequence must hv been timed out before establishing. No other
// posibility I can think of.
// this does not get recorded since there is no key (which is
// normally the sequenceID) to store it.
// so, setting the sequence status to INITIAL
sequenceReport.setSequenceStatus(SequenceReport.SEQUENCE_STATUS_INITIAL);
// returning the current sequence report.
return sequenceReport;
}
String outSequenceID = rMSBean.getSequenceID();
if (outSequenceID == null) {
sequenceReport.setInternalSequenceID(internalSequenceID);
sequenceReport.setSequenceStatus(SequenceReport.SEQUENCE_STATUS_INITIAL);
sequenceReport.setSequenceDirection(SequenceReport.SEQUENCE_DIRECTION_OUT);
if(rMSBean.getSecurityTokenData() != null) sequenceReport.setSecureSequence(true);
return sequenceReport;
}
sequenceReport.setSequenceStatus(SequenceReport.SEQUENCE_STATUS_ESTABLISHED);