diff options
author | Keuin <[email protected]> | 2020-11-30 13:15:15 +0800 |
---|---|---|
committer | keuin <[email protected]> | 2020-11-30 13:15:15 +0800 |
commit | 61ade9adad4668494dfc32da7751e1b86251dc97 (patch) | |
tree | c220fe41d0691d7ad6ed08e51d351537fa220a4f /src/main/java/com/keuin/kbackupfabric/operation/backup/BackupMethod.java | |
parent | e59bdf4ac0b66ce683be1bbc36852bfce6f70a63 (diff) |
Implementing incremental backup
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/operation/backup/BackupMethod.java')
-rw-r--r-- | src/main/java/com/keuin/kbackupfabric/operation/backup/BackupMethod.java | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/operation/backup/BackupMethod.java b/src/main/java/com/keuin/kbackupfabric/operation/backup/BackupMethod.java index b0b77cb..4e9eb6c 100644 --- a/src/main/java/com/keuin/kbackupfabric/operation/backup/BackupMethod.java +++ b/src/main/java/com/keuin/kbackupfabric/operation/backup/BackupMethod.java @@ -2,10 +2,12 @@ package com.keuin.kbackupfabric.operation.backup; import com.keuin.kbackupfabric.util.backup.builder.BackupFileNameBuilder; import com.keuin.kbackupfabric.util.backup.formatter.BackupFileNameFormatter; -import com.sun.istack.internal.NotNull; import java.io.IOException; +/** + * Provide specific backup method, which is implemented statelessly. + */ public interface BackupMethod { /** @@ -14,10 +16,29 @@ public interface BackupMethod { * @param backupName the backup name. * @return if the backup operation succeed. */ - boolean backup(@NotNull String backupName, @NotNull String levelPath, @NotNull String backupSaveDirectory) throws IOException; + BackupResult backup(String backupName, String levelPath, String backupSaveDirectory) throws IOException; + + boolean restore(String backupName, String levelPath, String backupSaveDirectory) throws IOException; BackupFileNameBuilder getBackupFileNameBuilder(); BackupFileNameFormatter getBackupFileNameFormatter(); + class BackupResult { + private final boolean success; + private final long backupSizeBytes; + + public BackupResult(boolean success, long backupSizeBytes) { + this.success = success; + this.backupSizeBytes = backupSizeBytes; + } + + public boolean isSuccess() { + return success; + } + + public long getBackupSizeBytes() { + return backupSizeBytes; + } + } } |