Interface BackupManager

All Superinterfaces:
net.solarnetwork.settings.SettingSpecifierProvider
All Known Implementing Classes:
DefaultBackupManager

public interface BackupManager extends net.solarnetwork.settings.SettingSpecifierProvider
Manager API for node-level backups.
Version:
2.0
Author:
matt
  • Field Details

  • Method Details

    • activeBackupService

      BackupService activeBackupService()
      Get the active BackupService.
      Returns:
      the BackupService, or null if none configured
    • resourcesForBackup

      Iterable<BackupResource> resourcesForBackup()
      Get a Iterator of BackupResource needing to be backed up.
      Returns:
      the backup resources
    • createBackup

      Backup createBackup()
      Create a new Backup, using the active backup service.
      Returns:
      the backup, or null if none could be created
    • createBackup

      Backup createBackup(Map<String,String> props)
      Create a new Backup, using the active backup service.
      Parameters:
      props - An optional set of properties to customize the backup with.
      Returns:
      the backup, or null if none could be created
      Since:
      1.1
    • createAsynchronousBackup

      Future<Backup> createAsynchronousBackup()
      Create a new Backup, using the active backup service, in the background. This method will immediately return a Future where you can track the status of the background backup, if desired.
      Returns:
      the backup, or null if none could be created
    • createAsynchronousBackup

      Future<Backup> createAsynchronousBackup(Map<String,String> props)
      Create a new Backup, using the active backup service, in the background. This method will immediately return a Future where you can track the status of the background backup, if desired.
      Parameters:
      props - An optional set of properties to customize the backup with.
      Returns:
      the backup, or null if none could be created
      Since:
      1.1
    • restoreBackup

      void restoreBackup(Backup backup)
      Restore all resources from a given backup.
      Parameters:
      backup - the backup to restore
    • restoreBackup

      void restoreBackup(Backup backup, Map<String,String> props)
      Restore all resources from a given backup.
      Parameters:
      backup - the backup to restore
      props - An optional set of properties to customize the backup with.
      Since:
      1.1
    • exportBackupArchive

      void exportBackupArchive(String backupKey, OutputStream out) throws IOException
      Export a backup zip archive.
      Parameters:
      backupKey - the backup to export
      out - the output stream to export to
      Throws:
      IOException - if any IO error occurs
    • exportBackupArchive

      void exportBackupArchive(String backupKey, OutputStream out, Map<String,String> props) throws IOException
      Export a backup zip archive.
      Parameters:
      backupKey - the backup to export
      out - the output stream to export to
      props - An optional set of properties to customize the backup with.
      Throws:
      IOException - if any IO error occurs
      Since:
      1.1
    • importBackupArchive

      Future<Backup> importBackupArchive(InputStream archive) throws IOException
      Import a backup archive into the active backup service. This method can import an archive exported via exportBackupArchive(String, OutputStream). Once imported, the backup will appear as a new backup in the active backup service.
      Parameters:
      archive - the archive input stream to import
      Returns:
      the backup future
      Throws:
      IOException - if any IO error occurs
    • importBackupArchive

      Future<Backup> importBackupArchive(InputStream archive, Map<String,String> props) throws IOException
      Import a backup archive with properties. This method can import an archive exported via exportBackupArchive(String, OutputStream). The RESOURCE_PROVIDER_FILTER property can be used to filter which provider resources are included in the imported backup. The BACKUP_KEY can be used to provide a hint of the original backup key (and possibly date). Once imported, the backup will appear as a new backup in the active backup service.
      Parameters:
      archive - the archive input stream to import
      props - An optional set of properties to customize the backup with.
      Returns:
      the backup future
      Throws:
      IOException - if any IO error occurs
      Since:
      1.1
    • infoForBackup

      BackupInfo infoForBackup(String key, Locale locale)
      Get metadata about a particular backup.
      Parameters:
      key - The key of the backup to get the information for.
      locale - The desired locale of the information, or null for the system locale.
      Returns:
      The backup info, or null if no backup is available for the given key.
      Since:
      1.2