Interface RestoreOperation
public interface RestoreOperation
Restore operation reads a backup file and loads it into the Structure database.
Note that if there's existing data in the structure database, it's not removed, but rather written over. If there's a structure with an ID that is present in the backup file, it will be overwritten. If there's a structure that's not present in the backup file, it will remain.
-
Method Summary
Modifier and TypeMethodDescriptionChecks that backup file has correct format.Call this method afterrestore()has completed to get names of all restored structures.restore()Performs the restore from backup synchronously.Sets the location of the backup file.setRestoreHistory(boolean restoreHistory) Sets therestoreHistoryflag.
-
Method Details
-
setFile
Sets the location of the backup file.- Parameters:
file- backup file- Returns:
- this operation
-
restore
Performs the restore from backup synchronously. After this method has finished successfully, the structure data contains all structures and other data from the backup file.
Issues in the backup file are referred to by their ID.
During this operation all exceptions or not found issues in JIRA are collected in
getErrorsContainer()- Returns:
- this operation
- Throws:
IOException- if the file cannot be read or has invalid format
-
checkBackupFile
Checks that backup file has correct format. Returns normally if the file can be used to restore data and throws exception if not.- Returns:
- this operation
- Throws:
IOException- if the file cannot be read or has invalid format
-
getStructureNames
Call this method afterrestore()has completed to get names of all restored structures.- Returns:
- map of structure names. Key is the structure ID, and value is the structure name.
-
getErrorsContainer
ErrorsContainer getErrorsContainer()- Returns:
- container with invalid issues (not found in JIRA), synchronizers that wasn't correctly processed during restore
-
getProgressGauge
ProgressGauge getProgressGauge()- Returns:
- a
ProgressGaugeallowing you to check this operation's progress and cancel it in a different thread.
-
setRestoreHistory
Sets therestoreHistoryflag. When the flag is set, the histories will be restored.- Parameters:
restoreHistory- default value is true- Returns:
- this operation
-