Interface BackupService

All Known Implementing Classes:
BackupServiceSupport, FileSystemBackupService

public interface BackupService
API for node backup.
Version:
2.0
Author:
matt
  • Method Details

    • getKey

      String getKey()
      Get a unique key for this service.

      This key should be unique among all possible implementations of BackupService.

      Returns:
      a unique key
    • getInfo

      Get general status information about the service.
      Returns:
      status info (never null)
    • performBackup

      Backup performBackup(Iterable<BackupResource> resources)
      Execute a backup now.

      This method may block until the backup completes.

      Parameters:
      resources - the resources to include in the backup
      Returns:
      backup instance
    • backupForKey

      Backup backupForKey(String key)
      Get a backup for a given backup key.
      Parameters:
      key - the key
      Returns:
      the backup
    • getAvailableBackups

      Collection<Backup> getAvailableBackups()
      Get a collection of Backup instances known by this service.

      These should be ideally ordered in newest to oldest order.

      Returns:
      the available backups, never null
    • getBackupResources

      BackupResourceIterable getBackupResources(Backup backup)
      Get the resources for a specific backup.
      Parameters:
      backup - the backup to get the resources for
      Returns:
      an Iterable for the backup resources
    • getSettingSpecifierProvider

      net.solarnetwork.settings.SettingSpecifierProvider getSettingSpecifierProvider()
      Get a SettingSpecifierProvider for this service.
      Returns:
      provider, or null if not supported
    • markBackupForRestore

      boolean markBackupForRestore(Backup backup, Map<String,String> props)
      Mark a specific backup to be restored in the future call to markedBackupForRestore(Map).
      Parameters:
      backup - The backup to mark for restoration later, or null to clear a previous marked backup.
      props - An optional map of properties to save with the mark.
      Returns:
      true on success
      Since:
      1.1
    • markedBackupForRestore

      Backup markedBackupForRestore(Map<String,String> props)
      Get a backup previously set via markBackupForRestore(Backup, Map).
      Parameters:
      props - An optional map in which any properties passed to markBackupForRestore(Backup, Map) should be populated into
      Returns:
      The marked backup, or null if none exists.
      Since:
      1.1
    • importBackup

      Backup importBackup(Date date, BackupResourceIterable resources, Map<String,String> props)
      Import a set of backup resources as a new Backup.
      Parameters:
      date - The backup date, or null if not known.
      resources - The resources to include in the backup.
      props - An optional map of properties to pass to the import process. The BackupManager.BACKUP_KEY property can be used to provide a proposed backup key.
      Returns:
      A backup instance for the imported resources.
      Since:
      1.2
    • getSettingSpecifierProviderForRestore

      net.solarnetwork.settings.SettingSpecifierProvider getSettingSpecifierProviderForRestore()
      Get a SettingSpecifierProvider for this service, when restoring from an existing backup.
      Returns:
      provider, or null if not supported
      Since:
      1.3