Class FileBackupStream

java.lang.Object
backupmanager.stream.BackupStream
backupmanager.stream.FileBackupStream
All Implemented Interfaces:
BackupFunction, PamSettings, SettingsNameProvider
Direct Known Subclasses:
BespokeFileStream, BinaryBackupStream, DatabaseBackupStream, RecorderBackupStream

public abstract class FileBackupStream extends BackupStream
  • Constructor Details

  • Method Details

    • backupComplete

      public void backupComplete()
      Description copied from class: BackupStream
      Called when backup of a stream is complete so that catalogue can be closed, etc.
      Specified by:
      backupComplete in class BackupStream
    • getSourceLocation

      public abstract FileLocation getSourceLocation()
      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.
      Returns:
      the source location.
    • setSourceLocation

      public abstract void setSourceLocation(FileLocation fileLocation)
      As with the getter, this may be ignored by many modules which will perfectly well know their source location
      Parameters:
      fileLocation -
    • getAllSourceItems

      public List<StreamItem> getAllSourceItems(long maximumTimeMillis)
      Get new file items that haven't been recently modified and convert to StreamItems.
      Parameters:
      maximumTimeMillis - last allowed modified time.
      Returns:
      list of StreamItems in the root folders.
    • getAllFiles

      public List<File> getAllFiles()
      Get all files in the source folder system.
      Returns:
      big list of files.
    • getBackupSettings

      public FileBackupSettings getBackupSettings()
      Description copied from class: BackupStream
      Return basic settings. Cannot be null. does not need to add all of the Action and Decision settings since that will all be handled by the calling functions getSettings from pamSettings
      Specified by:
      getBackupSettings in class BackupStream
      Returns:
    • setBackupSettings

      public boolean setBackupSettings(BackupSettings restoredSettings)
      Description copied from class: BackupStream
      Set settings when read back from PmSettings. Should always br the right type, but return flase if it isn't.
      Specified by:
      setBackupSettings in class BackupStream
      Returns:
    • getAvailableActions

      public List<ActionMaker> getAvailableActions()
      Specified by:
      getAvailableActions in class BackupStream
    • 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.

      Specified by:
      catalogData in class BackupStream
      Returns:
    • getMinBackupDelay

      public long getMinBackupDelay()
      Get the minimum delay from the time when a file was last modified or created to when it can be backed up
      Returns:
      time in milliseconds
    • getDialogPanel

      public PamDialogPanel getDialogPanel(Window owner)
      Description copied from interface: BackupFunction
      A dialog panel
      Specified by:
      getDialogPanel in interface BackupFunction
      Overrides:
      getDialogPanel in class BackupStream
      Parameters:
      owner - owner should be the dialog, not the main PAMGuard frame
      Returns:
      dialog panel (can be null if no options to set).
    • getToDoList

      public List<StreamItem> getToDoList(List<StreamItem> sourceItems, 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
      Specified by:
      getToDoList in class BackupStream
      Returns:
    • updateActedItem

      public void updateActedItem(BackupAction action, StreamItem streamItem)
      Specified by:
      updateActedItem in class BackupStream
    • getAvailableSpace

      public Long getAvailableSpace()
      Description copied from class: BackupStream
      Get the amount of space remaining at the data source location
      Overrides:
      getAvailableSpace in class BackupStream
      Returns:
      space in bytes