/** * Deletes a thread from this blip, deleting that thread's blips. */ void deleteThread(WaveletBasedConversationThread threadToDelete) { threadToDelete.deleteBlips(); manifestBlip.removeReply(threadToDelete.getManifestThread()); clearInlineReplyAnchor(threadToDelete.getId()); }
/** * Deletes all threads from this blip. * * @see WaveletBasedConversationBlip#deleteThread(WaveletBasedConversationThread) */ void deleteThreads() { // deleteThread() equivalent is inline here so we can do only one // document traversal to remove inline reply anchors. List<WaveletBasedConversationThread> threads = CollectionUtils.newArrayList(getReplyThreads()); for (WaveletBasedConversationThread threadToDelete : threads) { threadToDelete.deleteBlips(); manifestBlip.removeReply(threadToDelete.getManifestThread()); } clearAllInlineReplyAnchors(); }
/** * Removes a thread from the manifest, as though a remote client had done so. */ private void remoteRemoveThread(WaveletBasedConversationThread thread) { ManifestBlip parentBlip = thread.getParentBlip().getManifestBlip(); ManifestThread manifestThread = thread.getManifestThread(); parentBlip.removeReply(manifestThread); }
/** * Removes a blip from the manifest, as though a remote client had done so. */ private void remoteRemoveBlip(WaveletBasedConversationBlip blip) { ManifestThread parentThread = blip.getThread().getManifestThread(); ManifestBlip manifestBlip = blip.getManifestBlip(); parentThread.removeBlip(manifestBlip); }
/** * Removes a blip from the manifest, as though a remote client had done so. */ private void remoteRemoveBlip(WaveletBasedConversationBlip blip) { ManifestThread parentThread = blip.getThread().getManifestThread(); ManifestBlip manifestBlip = blip.getManifestBlip(); parentThread.removeBlip(manifestBlip); }
/** * Removes a thread from the manifest, as though a remote client had done so. */ private void remoteRemoveThread(WaveletBasedConversationThread thread) { ManifestBlip parentBlip = thread.getParentBlip().getManifestBlip(); ManifestThread manifestThread = thread.getManifestThread(); parentBlip.removeReply(manifestThread); }
/** * Test that iterating a thread whose manifest contains blips not backed by the * wavelet skips those blips. */ public void testMissingBlipIteration() { WaveletBasedConversationThread thread = target.getRootThread(); WaveletBasedConversationBlip first = thread.appendBlip(); manifestDoc.with(new Action() { @Override public <N, E extends N, T extends N> void exec(MutableDocument<N, E, T> doc) { N rootThreadNode = doc.getFirstChild(doc.getDocumentElement()); E rootThread = doc.asElement(rootThreadNode); doc.createChildElement(rootThread, "blip", Collections.singletonMap( "id", idGenerator.newBlipId())); } }); WaveletBasedConversationBlip third = thread.appendBlip(); assertEquals(3, CollectionUtils.newArrayList(thread.getManifestThread().getBlips()).size()); assertEquals(Arrays.asList(first, third), getBlipList(thread)); }
/** * Test that iterating a thread whose manifest contains blips not backed by the * wavelet skips those blips. */ public void testMissingBlipIteration() { WaveletBasedConversationThread thread = target.getRootThread(); WaveletBasedConversationBlip first = thread.appendBlip(); manifestDoc.with(new Action() { @Override public <N, E extends N, T extends N> void exec(MutableDocument<N, E, T> doc) { N rootThreadNode = doc.getFirstChild(doc.getDocumentElement()); E rootThread = doc.asElement(rootThreadNode); doc.createChildElement(rootThread, "blip", Collections.singletonMap( "id", idGenerator.newBlipId())); } }); WaveletBasedConversationBlip third = thread.appendBlip(); assertEquals(3, CollectionUtils.newArrayList(thread.getManifestThread().getBlips()).size()); assertEquals(Arrays.asList(first, third), getBlipList(thread)); }