Package net.solarnetwork.node.backup
Interface BackupService
- All Known Implementing Classes:
BackupServiceSupport,FileSystemBackupService
public interface BackupService
API for node backup.
- Version:
- 2.0
- Author:
- matt
-
Method Summary
Modifier and TypeMethodDescriptionbackupForKey(String key) Get a backup for a given backup key.Get a collection of Backup instances known by this service.getBackupResources(Backup backup) Get the resources for a specific backup.getInfo()Get general status information about the service.getKey()Get a unique key for this service.net.solarnetwork.settings.SettingSpecifierProviderGet aSettingSpecifierProviderfor this service.net.solarnetwork.settings.SettingSpecifierProviderGet aSettingSpecifierProviderfor this service, when restoring from an existing backup.importBackup(Date date, BackupResourceIterable resources, Map<String, String> props) Import a set of backup resources as a newBackup.booleanmarkBackupForRestore(Backup backup, Map<String, String> props) Mark a specific backup to be restored in the future call tomarkedBackupForRestore(Map).markedBackupForRestore(Map<String, String> props) Get a backup previously set viamarkBackupForRestore(Backup, Map).performBackup(Iterable<BackupResource> resources) Execute a backup now.
-
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
BackupServiceInfo getInfo()Get general status information about the service.- Returns:
- status info (never null)
-
performBackup
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
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
Get the resources for a specific backup.- Parameters:
backup- the backup to get the resources for- Returns:
- an
Iterablefor the backup resources
-
getSettingSpecifierProvider
net.solarnetwork.settings.SettingSpecifierProvider getSettingSpecifierProvider()Get aSettingSpecifierProviderfor this service.- Returns:
- provider, or null if not supported
-
markBackupForRestore
Mark a specific backup to be restored in the future call tomarkedBackupForRestore(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
Get a backup previously set viamarkBackupForRestore(Backup, Map).- Parameters:
props- An optional map in which any properties passed tomarkBackupForRestore(Backup, Map)should be populated into- Returns:
- The marked backup, or null if none exists.
- Since:
- 1.1
-
importBackup
Import a set of backup resources as a newBackup.- 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. TheBackupManager.BACKUP_KEYproperty 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 aSettingSpecifierProviderfor this service, when restoring from an existing backup.- Returns:
- provider, or null if not supported
- Since:
- 1.3
-