Package org.duracloud.sync.backup
Class ChangedListBackupManager
- java.lang.Object
-
- org.duracloud.sync.backup.ChangedListBackupManager
-
-
Field Summary
Fields Modifier and Type Field Description protected static intDEFAULT_SLEEP_TIMEstatic intSAVED_BACKUPS
-
Constructor Summary
Constructors Constructor Description ChangedListBackupManager(ChangedList changedList, File backupDir, long backupFrequency, List<File> contentDirs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()voidendBackup()booleanhasBackups()longloadBackup()Attempts to reload the changed list from a backup file.voidrun()Runs the backup manager.protected voidsleep(long milliseconds)
-
-
-
Field Detail
-
SAVED_BACKUPS
public static final int SAVED_BACKUPS
- See Also:
- Constant Field Values
-
DEFAULT_SLEEP_TIME
protected static final int DEFAULT_SLEEP_TIME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ChangedListBackupManager
public ChangedListBackupManager(ChangedList changedList, File backupDir, long backupFrequency, List<File> contentDirs)
-
-
Method Detail
-
loadBackup
public long loadBackup()
Attempts to reload the changed list from a backup file. If there are no backup files or the backup file cannot be read, returns -1, otherwise the backup file is loaded and the time the backup file was written is returned.- Returns:
- the write time of the backup file, or -1 if no backup is available
-
run
public void run()
Runs the backup manager. Writes out files which are a backups of the changed list based on the set backup frequency. Retains SAVED_BACKUPS number of backup files, removes the rest.
-
sleep
protected void sleep(long milliseconds)
-
clear
public void clear()
-
endBackup
public void endBackup()
-
hasBackups
public boolean hasBackups()
-
-