public abstract class BackupStrategy
extends java.lang.Object
BackupBean. Only listed by
getContents() and accepted by acceptFile(VirtualFileDescriptor) 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)
Deprecated.
|
long |
acceptFile(@NotNull VirtualFileDescriptor file) |
void |
afterBackup()
Backup postprocessing procedure.
|
void |
beforeBackup()
Backup pre-processing procedure.
|
java.lang.Iterable<VirtualFileDescriptor> |
getContents() |
boolean |
isInterrupted()
Can be used to interrupt backup process.
|
java.lang.Iterable<BackupStrategy.FileDescriptor> |
listFiles()
Deprecated.
|
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.Exception - if something went wrongpublic java.lang.Iterable<VirtualFileDescriptor> getContents()
@Deprecated public java.lang.Iterable<BackupStrategy.FileDescriptor> listFiles()
public void afterBackup()
throws java.lang.Exception
Environment turns database GC on after backup.java.lang.Exception - if something went wrongpublic 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 VirtualFileDescriptor file)
file - file to be backed up.@Deprecated
public long acceptFile(@NotNull
@NotNull java.io.File file)
file - file to be backed up.acceptFile(VirtualFileDescriptor)