BootstrapCheckpointHandler { public void advanceAfterTargetScn(Checkpoint ckpt) { assertBootstrapCheckpoint(ckpt); if (! ckpt.isBootstrapTargetScnSet()) { throw new InvalidCheckpointException("bootstrap_target_scn must be set", ckpt); } if (0 != ckpt.getBootstrapCatchupSourceIndex()) { throw new InvalidCheckpointException("bootstrap_catchup_source_index must be 0", ckpt); } startCatchupSource(ckpt); } BootstrapCheckpointHandler(List<String> sourceNames);  BootstrapCheckpointHandler(String... sourceNames); void setSourceNames(List<String> sourceNames); boolean needsMoreCatchup(Checkpoint ckpt); boolean needsMoreSnapshot(Checkpoint ckpt); Checkpoint createInitialBootstrapCheckpoint(Checkpoint ckpt, Long sinceScn); boolean needsMoreCowbell(Checkpoint ckpt); void finalizeSnapshotPhase(Checkpoint ckpt); void finalizeCatchupPhase(Checkpoint ckpt); void advanceAfterSnapshotPhase(Checkpoint ckpt); void advanceAfterCatchupPhase(Checkpoint ckpt); void advanceAfterTargetScn(Checkpoint ckpt); boolean assertBootstrapCheckpoint(Checkpoint ckpt); void resetForServerChange(Checkpoint ckpt); void setStartScnAfterServerChange(Checkpoint ckpt, Long startScn);  }
@Test public void testAdvanceAfterTargetScn() { BootstrapCheckpointHandler handler = new BootstrapCheckpointHandler(ONE_SOURCE); Checkpoint cp1 = handler.createInitialBootstrapCheckpoint(null, 100L); assertStartBootstrapCheckpoint(handler, cp1, ONE_SOURCE[0], 100L); cp1.setBootstrapStartScn(200L); handler.finalizeSnapshotPhase(cp1); assertSnapshotCompleteCheckpoint(handler, cp1, 0, ONE_SOURCE[0]); Assert.assertTrue(cp1.isSnapShotSourceCompleted()); handler.advanceAfterSnapshotPhase(cp1); assertAfterSnapshotCheckpoint(cp1, 1, Checkpoint.NO_SOURCE_NAME); Assert.assertTrue(cp1.isSnapShotSourceCompleted()); Assert.assertTrue(!handler.needsMoreSnapshot(cp1)); try { cp1.setBootstrapTargetScn(100L); Assert.fail("InvalidCheckpointException expected"); } catch (InvalidCheckpointException e) { } try { cp1.setBootstrapTargetScn(Checkpoint.UNSET_BOOTSTRAP_TARGET_SCN); handler.advanceAfterTargetScn(cp1); Assert.fail("InvalidCheckpointException expected"); } catch (InvalidCheckpointException e) { } cp1.setBootstrapTargetScn(200L); handler.advanceAfterTargetScn(cp1); Assert.assertEquals(DbusClientMode.BOOTSTRAP_CATCHUP, cp1.getConsumptionMode()); Assert.assertEquals(cp1.getWindowOffset().longValue(), 0L); Assert.assertEquals(cp1.getWindowScn(), cp1.getBootstrapStartScn().longValue()); }