private static SOAPEnvelope configureCloseSequence(Options options, ConfigurationContext configurationContext)
throws SandeshaException {
if (options == null)
throw new SandeshaException(SandeshaMessageHelper.getMessage(
SandeshaMessageKeys.optionsObjectNotSet));
EndpointReference epr = options.getTo();
if (epr == null)
throw new SandeshaException(SandeshaMessageHelper.getMessage(
SandeshaMessageKeys.toEPRNotValid, null));
//first see if the cliet has told us which sequence to close
String internalSequenceID =
(String)options.getProperty(SandeshaClientConstants.INTERNAL_SEQUENCE_ID);
if(internalSequenceID==null){
//lookup the internal seq id based on to EPR and sequenceKey
String to = epr.getAddress();
String sequenceKey = (String) options.getProperty(SandeshaClientConstants.SEQUENCE_KEY);
internalSequenceID = SandeshaUtil.getInternalSequenceID(to, sequenceKey);
}
StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(configurationContext,configurationContext.getAxisConfiguration());
// Get a transaction for getting the sequence properties
Transaction transaction = null;
String sequenceID = null;
try
{
transaction = storageManager.getTransaction();
sequenceID = SandeshaUtil.getSequenceIDFromInternalSequenceID(internalSequenceID, storageManager);
}
finally
{
// Commit the tran whatever happened
if(transaction != null) transaction.commit();
}
if (sequenceID == null)
sequenceID = Sandesha2Constants.TEMP_SEQUENCE_ID;
String rmSpecVersion = (String) options.getProperty(SandeshaClientConstants.RM_SPEC_VERSION);
if (rmSpecVersion == null)
rmSpecVersion = SpecSpecificConstants.getDefaultSpecVersion();
if (!SpecSpecificConstants.isSequenceClosingAllowed(rmSpecVersion))
throw new SandeshaException(SandeshaMessageHelper.getMessage(
SandeshaMessageKeys.closeSequenceSpecLevel, rmSpecVersion));
SOAPEnvelope dummyEnvelope = null;
SOAPFactory factory = null;
String soapNamespaceURI = options.getSoapVersionURI();