Class ChangedListBackupManager

java.lang.Object
org.duracloud.sync.backup.ChangedListBackupManager
All Implemented Interfaces:
Runnable

public class ChangedListBackupManager extends Object implements Runnable
Manages the backing up of the changed list on a consistent schedule.
  • Field Details

  • Constructor Details

    • ChangedListBackupManager

      public ChangedListBackupManager(ChangedList changedList, File backupDir, long backupFrequency, List<File> contentDirs)
  • Method Details

    • 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.
      Specified by:
      run in interface Runnable
    • sleep

      protected void sleep(long milliseconds)
    • clear

      public void clear()
    • endBackup

      public void endBackup()
    • hasBackups

      public boolean hasBackups()