public abstract class BackupStrategy
extends java.lang.Object
BackupBean. Only listed by
listFiles() and accepted by acceptFile(File) files are put into backup file with defined
pre- (beforeBackup()) and postprocessing (afterBackup()).Backupable,
BackupBean| Modifier and Type | Class and Description |
|---|---|
static class |
BackupStrategy.FileDescriptor
Descriptor of a file to be put into backup file.
|
| Modifier and Type | Field and Description |
|---|---|
static BackupStrategy |
EMPTY |
| Constructor and Description |
|---|
BackupStrategy() |
| Modifier and Type | Method and Description |
|---|---|
long |
acceptFile(@NotNull java.io.File file) |
void |
afterBackup()
Backup postprocessing procedure.
|
void |
beforeBackup()
Backup pre-processing procedure.
|
boolean |
isInterrupted()
Can be used to interrupt backup process.
|
abstract java.lang.Iterable<BackupStrategy.FileDescriptor> |
listFiles() |
void |
onError(java.lang.Throwable t)
Override this method to define custom exception handling.
|
public static final BackupStrategy EMPTY
public void beforeBackup()
throws java.lang.Exception
Environment turns database GC off before backup.java.lang.Exceptionpublic abstract java.lang.Iterable<BackupStrategy.FileDescriptor> listFiles()
public void afterBackup()
throws java.lang.Exception
Environment turns database GC on after backup.java.lang.Exceptionpublic boolean isInterrupted()
BackupBean
checks if backup procedure should be interrupted.public void onError(java.lang.Throwable t)
t - throwable thrown during backup.public long acceptFile(@NotNull
@NotNull java.io.File file)
file - file to be backed up.