public List<ConversationEntry> getConversationEntries() { return new ArrayList<ConversationEntry>( ConversationEntries.instance().getConversationEntries() ); }
private void touchConversationStack(List<String> stack) { if ( stack!=null ) { //iterate in reverse order, so that current conversation //sits at top of conversation lists ListIterator<String> iter = stack.listIterator( stack.size() ); while ( iter.hasPrevious() ) { String conversationId = iter.previous(); ConversationEntry conversationEntry = ConversationEntries.instance().getConversationEntry(conversationId); if (conversationEntry!=null) { conversationEntry.touch(); } } } }
/** * Clean up all state associated with a conversation */ private void destroyConversation(String conversationId, Map<String, Object> session) { Lifecycle.destroyConversationContext(session, conversationId); ConversationEntries.instance().removeConversationEntry(conversationId); }
public ConversationEntry getCurrentConversationEntry() { if (currentConversationEntry==null) { currentConversationEntry = ConversationEntries.instance().getConversationEntry( getCurrentConversationId() ); } return currentConversationEntry; }
private void endNestedConversations(String id) { for ( ConversationEntry ce: ConversationEntries.instance().getConversationEntries() ) { if ( ce.getConversationIdStack().contains(id) ) { ce.end(); } } }
public String select() { boolean isOutcome = conversationIdOrOutcome==null || (!Character.isDigit(conversationIdOrOutcome.charAt(0)) && conversationIdOrOutcome.indexOf(':') < 0); String actualOutcome; if (isOutcome) { resultingConversationIdOrOutcome = conversationIdOrOutcome; actualOutcome = conversationIdOrOutcome; } else { ConversationEntry ce = ConversationEntries.instance().getConversationEntry(conversationIdOrOutcome); if (ce!=null) { resultingConversationIdOrOutcome = ce.getId(); ce.redirect(); } actualOutcome = null; } return actualOutcome; }
public String getParentConversationViewId() { ConversationEntry conversationEntry = ConversationEntries.instance().getConversationEntry(getParentConversationId()); return conversationEntry==null ? null : conversationEntry.getViewId(); }
private void destroyNestedConversationContexts(Map<String, Object> session, String conversationId) { List<ConversationEntry> entries = new ArrayList<ConversationEntry>( ConversationEntries.instance().getConversationEntries() ); for ( ConversationEntry ce: entries ) { if ( ce.getConversationIdStack().contains(conversationId) ) { String entryConversationId = ce.getId(); log.debug("destroying nested conversation: " + entryConversationId); destroyConversation(entryConversationId, session); } } }
private ConversationEntry createConversationEntry() { ConversationEntry entry = ConversationEntries.instance() .createConversationEntry( getCurrentConversationId(), getCurrentConversationIdStack() ); if ( !entry.isNested() ) { //if it is a newly created nested //conversation, we already own the //lock entry.lock(); } return entry; }
Contexts.sessionContext.set(tempSessionContext); Set<String> conversationIds = ConversationEntries.instance().getConversationIds(); log.debug("destroying conversation contexts: " + conversationIds); for (String conversationId: conversationIds)
public void unlockConversation() { ConversationEntry ce = getCurrentConversationEntry(); if (ce!=null) { if ( ce.isLockedByCurrentThread() ) { ce.unlock(); } } else if ( isNestedConversation() ) { ConversationEntries.instance().getConversationEntry( getParentConversationId() ).unlock(); } }
/** * Initialize the request conversation context, given the * conversation id and optionally a parent conversation id. * If no conversation entry is found for the first id, try * the parent, and if that also fails, initialize a new * temporary conversation context. * * @return false if the conversation entry was not found * and it was required */ public boolean restoreConversation() { ConversationPropagation cp = ConversationPropagation.instance(); String conversationId = cp.getConversationId(); String parentConversationId = cp.getParentConversationId(); ConversationEntry ce = null; if (conversationId!=null) { ConversationEntries entries = ConversationEntries.instance(); ce = entries.getConversationEntry(conversationId); if (ce==null) { ce = entries.getConversationEntry(parentConversationId); } } return restoreAndLockConversation(ce) || !cp.isValidateLongRunningConversation(); }
ConversationEntry ce = ConversationEntries.instance().getConversationEntry(id); if (ce!=null)
ConversationEntries conversationEntries = ConversationEntries.instance(); Events events = Events.exists() ? Events.instance() : null;
ConversationEntry ce = ConversationEntries.instance().getConversationEntry(param.getConversationId()); if (ce != null)