public abstract class AbstractBackupStrategy extends java.lang.Object implements BackupStrategy2
BackupStrategy2, simply append '.bak.n' to the end of normal file name when
naming a backup with index n.
Developers can simply extend this class when defining their own BackupStrategy2.
NO_LIMIT| Constructor and Description |
|---|
AbstractBackupStrategy() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getBackupFileName(java.lang.String fileName,
int backupIndex)
Get the backup file name for specific index.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetMaxBackupIndexshouldBackuppublic java.lang.String getBackupFileName(java.lang.String fileName,
int backupIndex)
BackupStrategy2Generally, a backup file with normal file name 'log' and index 'n' could simply be 'log.bak.n', you can specify your own naming rules, by overriding this method.
Make sure to return different backup file name with different backup index, and same backup file name with same index. Otherwise, it will lead to unexpected behavior.
getBackupFileName in interface BackupStrategy2fileName - the normal file name, generated by
FileNameGenerator.generateFileName(int, long)backupIndex - the backup index, which will increase from 1 to BackupStrategy2.getMaxBackupIndex()