Package backupmanager.stream
Class FileBackupStream
java.lang.Object
backupmanager.stream.BackupStream
backupmanager.stream.FileBackupStream
- All Implemented Interfaces:
BackupFunction
,PamSettings
,SettingsNameProvider
- Direct Known Subclasses:
BespokeFileStream
,BinaryBackupStream
,DatabaseBackupStream
,RecorderBackupStream
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Called when backup of a stream is complete so that catalogue can be closed, etc.build the data catalogue from the last item in the current database.Get all files in the source folder system.getAllSourceItems
(long maximumTimeMillis) Get new file items that haven't been recently modified and convert to StreamItems.Get the amount of space remaining at the data source locationReturn basic settings.getDialogPanel
(Window owner) A dialog panellong
Get the minimum delay from the time when a file was last modified or created to when it can be backed upabstract FileLocation
Source location - For most things, like the sound recorder or binary files this will have to be taken from the other settings.getToDoList
(List<StreamItem> sourceItems, BackupAction action) Get a list of items that this action needs to work on.boolean
setBackupSettings
(BackupSettings restoredSettings) Set settings when read back from PmSettings.abstract void
setSourceLocation
(FileLocation fileLocation) As with the getter, this may be ignored by many modules which will perfectly well know their source locationvoid
updateActedItem
(BackupAction action, StreamItem streamItem) Methods inherited from class backupmanager.stream.BackupStream
addAction, doAction, getActions, getName, getSettingsReference, getSettingsVersion, getUnitName, getUnitType, removeAction, restoreSettings, runBackup
-
Constructor Details
-
FileBackupStream
-
-
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 classBackupStream
-
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
As with the getter, this may be ignored by many modules which will perfectly well know their source location- Parameters:
fileLocation
-
-
getAllSourceItems
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
Get all files in the source folder system.- Returns:
- big list of files.
-
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 classBackupStream
- Returns:
-
setBackupSettings
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 classBackupStream
- Returns:
-
getAvailableActions
- Specified by:
getAvailableActions
in classBackupStream
-
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 classBackupStream
- 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
Description copied from interface:BackupFunction
A dialog panel- Specified by:
getDialogPanel
in interfaceBackupFunction
- Overrides:
getDialogPanel
in classBackupStream
- Parameters:
owner
- owner should be the dialog, not the main PAMGuard frame- Returns:
- dialog panel (can be null if no options to set).
-
getToDoList
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 classBackupStream
- Returns:
-
updateActedItem
- Specified by:
updateActedItem
in classBackupStream
-
getAvailableSpace
Description copied from class:BackupStream
Get the amount of space remaining at the data source location- Overrides:
getAvailableSpace
in classBackupStream
- Returns:
- space in bytes
-