BootstrapCheckpointHandler { public Checkpoint createInitialBootstrapCheckpoint(Checkpoint ckpt, Long sinceScn) { if (sinceScn < 0) { throw new DatabusRuntimeException("sinceScn must be non-negative:" + sinceScn); } if (null == ckpt) { ckpt = new Checkpoint(); } ckpt.resetBootstrap(); ckpt.setConsumptionMode(DbusClientMode.BOOTSTRAP_SNAPSHOT); ckpt.setBootstrapSinceScn(sinceScn); setSnapshotSource(ckpt, 0); setCatchupSource(ckpt, 0); ckpt.startSnapShotSource(); return 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 testStartBootstrap() { BootstrapCheckpointHandler handler = new BootstrapCheckpointHandler(ONE_SOURCE); Checkpoint cp1 = handler.createInitialBootstrapCheckpoint(null, 0L); assertStartBootstrapCheckpoint(handler, cp1, ONE_SOURCE[0], 0L); handler = new BootstrapCheckpointHandler(TWO_SOURCES); Checkpoint cp2 = handler.createInitialBootstrapCheckpoint(null, (long)Integer.MAX_VALUE + 5); assertStartBootstrapCheckpoint(handler, cp2, TWO_SOURCES.get(0), (long)Integer.MAX_VALUE + 5); handler = new BootstrapCheckpointHandler(THREE_SOURCES); Checkpoint cp3 = handler.createInitialBootstrapCheckpoint(null, Long.MAX_VALUE); assertStartBootstrapCheckpoint(handler, cp3, THREE_SOURCES[0], Long.MAX_VALUE); try { handler.createInitialBootstrapCheckpoint(null, -1L); Assert.fail("DatabusRuntimeException expected"); } catch (DatabusRuntimeException e) { } }