Class BackupCatalog
- Direct Known Subclasses:
DatabaseCatalog
Order of operations for all the backing up using the database is
1) List all files in source folder (in DataStream)
2) Check table (can do in constructor)
3) Get all files already in output database and cross check to make list of new files.
This doesn't mean that the files have been backed up, just that they are catalogued
4) For each action, re-query the database to see which items have null in that action column
5) run action on that item, and update that row of the database
6) Repeat 4 invalid input: '&' 5 for next action.
If this was done without the database, it's harder !
1) List all files in source (step 1 above)
2) For each action , list all files in destination and make list of source files not in dest
3) Run action on each item
4) Repeat 2 and 3 for next action
- Author:
- dg50
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
Called when backup of a stream is complete so that catalogue can be closed.abstract List<StreamItem>
catalogNewItems
(List<StreamItem> allSourceItems) If possible, save new items in the backup catalog.abstract List<StreamItem>
getUnactedItems
(List<StreamItem> sourceItems, BackupAction action) Get a list of items that have not been operated by the given action (may vary by action, particularly if new actions are added).abstract boolean
updateItem
(StreamItem streamItem, BackupAction action) Once an action is complete, store it's result (if possible)
-
Constructor Details
-
BackupCatalog
-
-
Method Details
-
catalogNewItems
If possible, save new items in the backup catalog. Doesn't look at output of actions yet. Used by the database to add to the backuptable.- Parameters:
allSourceItems
- all source items- Returns:
- items added to the catalog (hopefully a subset).
-
getUnactedItems
Get a list of items that have not been operated by the given action (may vary by action, particularly if new actions are added).- Parameters:
sourceItems
- all potentially new items.action
-- Returns:
- list of items that need acting on.
-
updateItem
Once an action is complete, store it's result (if possible)- Parameters:
streamItem
-action
-- Returns:
-
getBackupStream
- Returns:
- the backupStream
-
getSource
- Returns:
- the source
-
backupComplete
public abstract void backupComplete()Called when backup of a stream is complete so that catalogue can be closed.
-