public ConversationEntry(String id, List<String> stack, ConversationEntries entries) { this.id = id; if (stack==null) throw new IllegalArgumentException("Stack must not be null"); if (id==null) throw new IllegalArgumentException("id must not be null"); this.conversationIdStack = stack; this.startDatetime = new Date(); this.entries = entries; if ( conversationIdStack.size()>1 ) { // get the root conversation entry lock (we want to share the same lock // among all nested conversations in the same conversation stack) lock = entries.getConversationEntry( conversationIdStack.get( conversationIdStack.size()-1 ) ).lock; } else { lock = new ReentrantLock(true); } touch(); }
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(); } } } }
public ConversationEntry getCurrentConversationEntry() { if (currentConversationEntry==null) { currentConversationEntry = ConversationEntries.instance().getConversationEntry( getCurrentConversationId() ); } return currentConversationEntry; }
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(); }
while ( ids.hasPrevious() ) ConversationEntry entry = conversationEntries.getConversationEntry( ids.previous() ); if ( entry.isDisplayable() && !Session.instance().isInvalid() )
/** * 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) if (param != null) ConversationEntry ce = ConversationEntries.instance().getConversationEntry(param.getConversationId()); if (ce != null)
public void unlockConversation() { ConversationEntry ce = getCurrentConversationEntry(); if (ce!=null) { if ( ce.isLockedByCurrentThread() ) { ce.unlock(); } } else if ( isNestedConversation() ) { ConversationEntries.instance().getConversationEntry( getParentConversationId() ).unlock(); } }
ConversationEntry ce = ConversationEntries.instance().getConversationEntry(id); if (ce!=null)
ConversationEntry ce = ConversationEntries.instance().getConversationEntry(param.getConversationId()); if (ce != null)