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 Details

    • setFile

      @NotNull RestoreOperation setFile(@NotNull File file)
      Sets the location of the backup file.
      Parameters:
      file - backup file
      Returns:
      this operation
    • restore

      @NotNull RestoreOperation restore() throws IOException

      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

      @NotNull RestoreOperation checkBackupFile() throws IOException
      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

      @NotNull Map<Long,String> getStructureNames()
      Call this method after restore() 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 ProgressGauge allowing you to check this operation's progress and cancel it in a different thread.
    • setRestoreHistory

      @NotNull RestoreOperation setRestoreHistory(boolean restoreHistory)
      Sets the restoreHistory flag. When the flag is set, the histories will be restored.
      Parameters:
      restoreHistory - default value is true
      Returns:
      this operation