Class DatabaseBackupStream

All Implemented Interfaces:
BackupFunction, PamSettings, SettingsNameProvider

public class DatabaseBackupStream extends FileBackupStream
  • Constructor Details

    • DatabaseBackupStream

      public DatabaseBackupStream(DBControlUnit dbControlUnit)
  • Method Details

    • getToDoList

      public List<StreamItem> getToDoList(List<StreamItem> streamItems, BackupAction action)
      Description copied from class: BackupStream
      Get a list of items that this action needs to work on. this may be a subset of sourceItems
      Overrides:
      getToDoList in class FileBackupStream
      Returns:
    • doAction

      public boolean doAction(BackupManager backupManager, BackupAction action, StreamItem streamItem) throws BackupException
      Description copied from class: BackupStream
      Carry out some action or other on the stream item.
      Overrides:
      doAction in class BackupStream
      Parameters:
      action - Backup action to perform
      Returns:
      true if successful, otherwise false
      Throws:
      BackupException
    • getAvailableActions

      public List<ActionMaker> getAvailableActions()
      Overrides:
      getAvailableActions in class FileBackupStream
    • catalogData

      public List<StreamItem> catalogData()
      Description copied from class: BackupStream
      build the data catalogue from the last item in the current database.
      Individual actions may want to look in the database to see if they have themselves acted on the data, so will run their own query.

      Note that catalogData and getToDoList are separate functions, the idea being that catalog data will be listing all files in the source folder (or ones not already listed in the database table) whereas getToDoList can provide a set of files that are associated with a particular action, which may be a subset of files found in catalogData or may ignore catalogData in it's entirity.

      Overrides:
      catalogData in class FileBackupStream
      Returns:
    • updateActedItem

      public void updateActedItem(BackupAction action, StreamItem streamItem)
      Overrides:
      updateActedItem in class FileBackupStream
    • getSourceLocation

      public FileLocation getSourceLocation()
      Description copied from class: FileBackupStream
      Source location - For most things, like the sound recorder or binary files this will have to be taken from the other settings. For some modules like the gemini, which are recording elsewhere, it can be anything.
      Specified by:
      getSourceLocation in class FileBackupStream
      Returns:
      the source location.
    • setSourceLocation

      public void setSourceLocation(FileLocation fileLocation)
      Description copied from class: FileBackupStream
      As with the getter, this may be ignored by many modules which will perfectly well know their source location
      Specified by:
      setSourceLocation in class FileBackupStream