@Test public void testBegin() throws Exception { checkpoint.begin("1.1"); assertThat(findBackupFiles(DB_NAME, "1.1"), is(arrayWithSize(1))); }
@Override public void begin(String version) throws Exception { upgradeDir = appDirectories.getWorkDirectory("upgrades/" + databaseName); String timestampSuffix = String.format("-%1$tY%1$tm%1$td-%1$tH%1$tM%1$tS", System.currentTimeMillis()); backupZip = new File(upgradeDir, databaseName + "-" + version + timestampSuffix + "-backup.zip"); failedZip = new File(upgradeDir, databaseName + "-failed.zip"); log.debug("Backing up database to {}", backupZip); try (OutputStream out = new FileOutputStream(backupZip)) { databaseInstance.get().externalizer().backup(out); } }
DatabaseCheckpointSupport extends ComponentSupport implements Checkpoint { @Override public void begin(String version) throws Exception { upgradeDir = appDirectories.getWorkDirectory("upgrades/" + databaseName); String timestampSuffix = String.format("-%1$tY%1$tm%1$td-%1$tH%1$tM%1$tS", System.currentTimeMillis()); backupZip = new File(upgradeDir, databaseName + "-" + version + timestampSuffix + "-backup.zip"); failedZip = new File(upgradeDir, databaseName + "-failed.zip"); log.debug("Backing up database to {}", backupZip); try (OutputStream out = new FileOutputStream(backupZip)) { databaseInstance.get().externalizer().backup(out); } } }
DatabaseCheckpointSupport extends ComponentSupport implements Checkpoint { @Override public void begin(String version) throws Exception { upgradeDir = appDirectories.getWorkDirectory("upgrades/" + databaseName); String timestampSuffix = String.format("-%1$tY%1$tm%1$td-%1$tH%1$tM%1$tS", System.currentTimeMillis()); backupZip = new File(upgradeDir, databaseName + "-" + version + timestampSuffix + "-backup.zip"); failedZip = new File(upgradeDir, databaseName + "-failed.zip"); log.debug("Backing up database to {}", backupZip); try (OutputStream out = new FileOutputStream(backupZip)) { databaseInstance.get().externalizer().backup(out); } } protected  DatabaseCheckpointSupport(final String databaseName,
                                      final Provider<DatabaseInstance> databaseInstance,
                                      final ApplicationDirectories appDirectories); }
DatabaseCheckpointSupport extends ComponentSupport implements Checkpoint { @Override public void begin(String version) throws Exception { upgradeDir = appDirectories.getWorkDirectory("upgrades/" + databaseName); String timestampSuffix = String.format("-%1$tY%1$tm%1$td-%1$tH%1$tM%1$tS", System.currentTimeMillis()); backupZip = new File(upgradeDir, databaseName + "-" + version + timestampSuffix + "-backup.zip"); failedZip = new File(upgradeDir, databaseName + "-failed.zip"); log.debug("Backing up database to {}", backupZip); try (OutputStream out = new FileOutputStream(backupZip)) { databaseInstance.get().externalizer().backup(out); } } protected  DatabaseCheckpointSupport(final String databaseName,
                                      final Provider<DatabaseInstance> databaseInstance,
                                      final ApplicationDirectories appDirectories); @Override void begin(String version); @Override void commit(); @Override void rollback(); @Override void end(); }
DatabaseCheckpointSupport extends ComponentSupport implements Checkpoint { @Override public void begin(String version) throws Exception { upgradeDir = appDirectories.getWorkDirectory("upgrades/" + databaseName); String timestampSuffix = String.format("-%1$tY%1$tm%1$td-%1$tH%1$tM%1$tS", System.currentTimeMillis()); backupZip = new File(upgradeDir, databaseName + "-" + version + timestampSuffix + "-backup.zip"); failedZip = new File(upgradeDir, databaseName + "-failed.zip"); log.debug("Backing up database to {}", backupZip); try (OutputStream out = new FileOutputStream(backupZip)) { databaseInstance.get().externalizer().backup(out); } } protected  DatabaseCheckpointSupport(final String databaseName,
                                      final Provider<DatabaseInstance> databaseInstance,
                                      final ApplicationDirectories appDirectories); @Override void begin(String version); @Override void commit(); @Override void rollback(); @Override void end();  }