/** * Prepends the given delta onto the queue's head. No merging is * allows on this delta. This is because we don't know if the server have actually got * the previously sent delta, we can't change the delta once it's sent. * * @param newHead delta to use for the queue. Must only contain operations from a * single author. May be empty, in which case this call will do * nothing. */ public void insertHead(List<WaveletOperation> newHead) { if (newHead.isEmpty()) { return; } MergingSequence mergingHead = new MergingSequence(newHead); Item item = new Item(mergingHead, ItemState.SENT); ParticipantId creator = mergingHead.get(0).getContext().getCreator(); if (queue.isEmpty()) { queue.add(item); tailCreator = creator; } else { queue.addFirst(item); } }
private static void assertTimestamp(long timestamp, MergingSequence delta) { assertEquals(timestamp, ((WaveletBlipOperation) delta.get(0)).getBlipOp().getContext().getTimestamp()); }
private static void assertTimestamp(long timestamp, MergingSequence delta) { assertEquals(timestamp, ((WaveletBlipOperation) delta.get(0)).getBlipOp().getContext().getTimestamp()); }