org.duracloud.sync.backup
Class ChangedListBackupManager

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

public class ChangedListBackupManager
extends java.lang.Object
implements java.lang.Runnable

Manages the backing up of the changed list on a consistent schedule.


Field Summary
static int SAVED_BACKUPS
           
 
Constructor Summary
ChangedListBackupManager(ChangedList changedList, java.io.File backupDir, long backupFrequency)
           
 
Method Summary
 void endBackup()
           
 long loadBackup()
          Attempts to reload the changed list from a backup file.
 void run()
          Runs the backup manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SAVED_BACKUPS

public static final int SAVED_BACKUPS
See Also:
Constant Field Values
Constructor Detail

ChangedListBackupManager

public ChangedListBackupManager(ChangedList changedList,
                                java.io.File backupDir,
                                long backupFrequency)
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.

Specified by:
run in interface java.lang.Runnable

endBackup

public void endBackup()


Copyright © 2009-2011 DuraSpace. All Rights Reserved.