private List<String> getIdStack() { return idStack==null ? Manager.instance().getCurrentConversationIdStack() : idStack; }
private Set<String> getNamesForAllConversationsFromSession() { Set<String> results = new HashSet<String>(); List<String> ids = Manager.instance().getCurrentConversationIdStack(); if (ids != null) { for (String conversationId: ids) { String prefix = getPrefix(conversationId); for (String name: session.keySet()) { if (name.startsWith(prefix)) { String shortName = name.substring(prefix.length()); if (!removals.contains(shortName)) { results.add(name); } } } } } return results; }
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; }
/** * Begin a new nested conversation. */ public void beginNestedConversation() { log.debug("Beginning nested conversation"); List<String> oldStack = getCurrentConversationIdStack(); if (oldStack==null) { throw new IllegalStateException("No long-running conversation active"); } String id = Id.nextId(); setCurrentConversationId(id); createCurrentConversationIdStack(id).addAll(oldStack); createConversationEntry(); storeConversationToViewRootIfNecessary(); if ( Events.exists() ) Events.instance().raiseEvent(EVENT_CONVERSATION_BEGIN); }
touchConversationStack( getCurrentConversationIdStack() );
|| !getCurrentConversationIdStack().contains( conversationEntry.getId()))