use of com.axway.ats.environment.database.model.BackupHandler in project ats-framework by Axway.
the class DatabaseEnvironmentUnit method backup.
@Override
@PublicAtsApi
public void backup() throws EnvironmentCleanupException {
BackupHandler dbBackup = null;
try {
log.info("Creating backup of environment unit " + getDescription() + "...");
//create db backup handler instance
dbBackup = environmentHandlerFactory.createDbBackupHandler(dbConnection);
dbBackup.setLockTables(addLocks);
dbBackup.setForeignKeyCheck(disableForeignKeys);
dbBackup.setIncludeDeleteStatements(includeDeleteStatements);
for (DbTable dbTable : dbTables) {
dbBackup.addTable(dbTable);
}
String backupFile = getBackupFile();
createDirIfNotExist(backupFile);
dbBackup.createBackup(backupFile);
log.info("Successfully created backup of environment unit " + getDescription());
} finally {
setTempBackupDir(null);
if (dbBackup != null) {
dbBackup.disconnect();
}
}
}
Aggregations