@Test public void testFlushState() { final TransactionTester<RemoteProxyTransaction> transactionTester = createRemoteProxyTransactionTester(); final RemoteProxyTransaction successor = transactionTester.getTransaction(); doAnswer(LocalProxyTransactionTest::applyToCursorAnswer).when(modification).applyToCursor(any()); transaction.sealOnly(); final TransactionRequest<?> request = transaction.flushState().get(); transaction.forwardToSuccessor(successor, request, null); verify(modification).applyToCursor(any()); transactionTester.getTransaction().seal(); transactionTester.getTransaction().directCommit(); final ModifyTransactionRequest modifyRequest = transactionTester.expectTransactionRequest(ModifyTransactionRequest.class); checkModifications(modifyRequest); }
@Override Optional<ModifyTransactionRequest> flushState() { final ModifyTransactionRequestBuilder b = new ModifyTransactionRequestBuilder(getIdentifier(), localActor()); b.setSequence(0); sealedModification.applyToCursor(new AbstractDataTreeModificationCursor() { @Override public void write(final PathArgument child, final NormalizedNode<?, ?> data) { b.addModification(new TransactionWrite(current().node(child), data)); } @Override public void merge(final PathArgument child, final NormalizedNode<?, ?> data) { b.addModification(new TransactionMerge(current().node(child), data)); } @Override public void delete(final PathArgument child) { b.addModification(new TransactionDelete(current().node(child))); } }); return Optional.of(b.build()); }
LocalReadWriteProxyTransaction extends LocalProxyTransaction { @Override Optional<ModifyTransactionRequest> flushState() { final ModifyTransactionRequestBuilder b = new ModifyTransactionRequestBuilder(getIdentifier(), localActor()); b.setSequence(0); sealedModification.applyToCursor(new AbstractDataTreeModificationCursor() { @Override public void write(final PathArgument child, final NormalizedNode<?, ?> data) { b.addModification(new TransactionWrite(current().node(child), data)); } @Override public void merge(final PathArgument child, final NormalizedNode<?, ?> data) { b.addModification(new TransactionMerge(current().node(child), data)); } @Override public void delete(final PathArgument child) { b.addModification(new TransactionDelete(current().node(child))); } }); return Optional.of(b.build()); } }
LocalReadWriteProxyTransaction extends LocalProxyTransaction { @Override Optional<ModifyTransactionRequest> flushState() { final ModifyTransactionRequestBuilder b = new ModifyTransactionRequestBuilder(getIdentifier(), localActor()); b.setSequence(0); sealedModification.applyToCursor(new AbstractDataTreeModificationCursor() { @Override public void write(final PathArgument child, final NormalizedNode<?, ?> data) { b.addModification(new TransactionWrite(current().node(child), data)); } @Override public void merge(final PathArgument child, final NormalizedNode<?, ?> data) { b.addModification(new TransactionMerge(current().node(child), data)); } @Override public void delete(final PathArgument child) { b.addModification(new TransactionDelete(current().node(child))); } }); return Optional.of(b.build()); } LocalReadWriteProxyTransaction(final ProxyHistory parent, final TransactionIdentifier identifier,
        final DataTreeSnapshot snapshot);   LocalReadWriteProxyTransaction(final ProxyHistory parent, final TransactionIdentifier identifier); }
LocalReadWriteProxyTransaction extends LocalProxyTransaction { @Override Optional<ModifyTransactionRequest> flushState() { final ModifyTransactionRequestBuilder b = new ModifyTransactionRequestBuilder(getIdentifier(), localActor()); b.setSequence(0); sealedModification.applyToCursor(new AbstractDataTreeModificationCursor() { @Override public void write(final PathArgument child, final NormalizedNode<?, ?> data) { b.addModification(new TransactionWrite(current().node(child), data)); } @Override public void merge(final PathArgument child, final NormalizedNode<?, ?> data) { b.addModification(new TransactionMerge(current().node(child), data)); } @Override public void delete(final PathArgument child) { b.addModification(new TransactionDelete(current().node(child))); } }); return Optional.of(b.build()); } LocalReadWriteProxyTransaction(final ProxyHistory parent, final TransactionIdentifier identifier,
        final DataTreeSnapshot snapshot);   LocalReadWriteProxyTransaction(final ProxyHistory parent, final TransactionIdentifier identifier);  }
LocalReadWriteProxyTransaction extends LocalProxyTransaction { @Override Optional<ModifyTransactionRequest> flushState() { final ModifyTransactionRequestBuilder b = new ModifyTransactionRequestBuilder(getIdentifier(), localActor()); b.setSequence(0); sealedModification.applyToCursor(new AbstractDataTreeModificationCursor() { @Override public void write(final PathArgument child, final NormalizedNode<?, ?> data) { b.addModification(new TransactionWrite(current().node(child), data)); } @Override public void merge(final PathArgument child, final NormalizedNode<?, ?> data) { b.addModification(new TransactionMerge(current().node(child), data)); } @Override public void delete(final PathArgument child) { b.addModification(new TransactionDelete(current().node(child))); } }); return Optional.of(b.build()); } LocalReadWriteProxyTransaction(final ProxyHistory parent, final TransactionIdentifier identifier,
        final DataTreeSnapshot snapshot);   LocalReadWriteProxyTransaction(final ProxyHistory parent, final TransactionIdentifier identifier);   }