diff options
author | Keuin <[email protected]> | 2021-01-23 14:10:32 +0800 |
---|---|---|
committer | keuin <[email protected]> | 2021-01-23 14:10:32 +0800 |
commit | 4a1d885afa7217b47d6183488c3dc6537cef05b6 (patch) | |
tree | 1b499db6b834cb0709029e30c0d52c0ddf200ffa /src/main/java/com/keuin/kbackupfabric/backup/incremental/serializer/SavedIncrementalBackup.java | |
parent | 4ac575330130ac4e1b4b35386ffc0aacd431a5a4 (diff) |
Version 1.4.6 (preview): added metadata for incremental backup (need integrated test and display implementation)
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/backup/incremental/serializer/SavedIncrementalBackup.java')
-rw-r--r-- | src/main/java/com/keuin/kbackupfabric/backup/incremental/serializer/SavedIncrementalBackup.java | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/backup/incremental/serializer/SavedIncrementalBackup.java b/src/main/java/com/keuin/kbackupfabric/backup/incremental/serializer/SavedIncrementalBackup.java new file mode 100644 index 0000000..e2e50b6 --- /dev/null +++ b/src/main/java/com/keuin/kbackupfabric/backup/incremental/serializer/SavedIncrementalBackup.java @@ -0,0 +1,62 @@ +package com.keuin.kbackupfabric.backup.incremental.serializer; + + +import com.keuin.kbackupfabric.backup.incremental.ObjectCollection2; + +import java.io.Serializable; +import java.time.ZonedDateTime; + +/** + * The abstraction of an object saved in the disk, containing all information (except binary data of files) about an incremental backup. + */ +public interface SavedIncrementalBackup extends Serializable { + + /** + * Get an instance with the latest version. + */ + static SavedIncrementalBackup newLatest(ObjectCollection2 objectCollection2, String backupName, ZonedDateTime backupTime, long totalSizeBytes, long increasedSizeBytes, int filesAdded, int totalFiles) { + return new SavedIncBackupV1(objectCollection2, backupName, backupTime, totalSizeBytes, increasedSizeBytes, filesAdded, totalFiles); + } + + /** + * Get the object collection of the level directory. + * + * @return the object collection. + */ + ObjectCollection2 getObjectCollection(); + + /** + * Get the custom backup name. + * + * @return the backup name. + */ + String getBackupName(); + + /** + * Get the time when this backup was made. + * + * @return the time. + */ + ZonedDateTime getBackupTime(); + + /** + * Get new files added to the base. + * + * @return file count. + */ + int getFilesAdded(); + + /** + * Get the total size of the saved world. + * + * @return the size in bytes. + */ + long getTotalSizeBytes(); + + /** + * Get the size we cost to add this backup into the base. + * + * @return the increased size in bytes. + */ + long getIncreasedSizeBytes(); +} |