Package org.infinispan.server.core
Interface BackupManager
- All Known Implementing Classes:
BackupManagerImpl
public interface BackupManager
Handles all tasks related to the creation/restoration of server backups.
- Since:
- 12.0
- Author:
- Ryan Emerson
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
An interface to encapsulate the various arguments required by theBackupManager
in order to include/exclude resources from a backup/restore operation.static enum
An enum representing the current state of a Backup operation. -
Method Summary
Modifier and TypeMethodDescriptionCreate a backup of all containers configured on the server, including all available resources.Create a backup of the specified containers, including the resources defined in the providedBackupManager.Resources
object.getBackupLocation
(String name) Returns thePath
of a backup file if it is complete.getBackupStatus
(String name) Return the currentBackupManager.Status
of a Backup request.getRestoreStatus
(String name) Return the currentBackupManager.Status
of a Restore request.void
init()
Performs initialisation of all resources required by the implementation before backup files can be created or restored.removeBackup
(String name) Remove the created backup file from the server.removeRestore
(String name) Remove the meta information associated with a restoration.Restore content from the provided backup file.Restore content from the provided backup file.
-
Method Details
-
init
Performs initialisation of all resources required by the implementation before backup files can be created or restored.- Throws:
IOException
-
getBackupNames
- Returns:
- the names of all backups.
-
getBackupStatus
Return the currentBackupManager.Status
of a Backup request.- Parameters:
name
- the name of the backup.- Returns:
- the
BackupManager.Status
of the backup.
-
getBackupLocation
Returns thePath
of a backup file if it is complete.- Parameters:
name
- the name of the backup.- Returns:
- the
Path
of the created backup file ifBackupManager.Status.COMPLETE
, otherwise null.
-
removeBackup
Remove the created backup file from the server. When it's possible to remove a backup file immediately, then aBackupManager.Status.COMPLETE
is returned. However, if a backup operation is currently in progress, then the removal is attempted once the backup has completed andBackupManager.Status.IN_PROGRESS
is returned. Finally,BackupManager.Status.NOT_FOUND
is returned if no backup exists with the specified name.- Parameters:
name
- the name of the backup.- Returns:
- a
CompletionStage
that returns aBackupManager.Status
when complete to indicate what course of action was taken.
-
create
Create a backup of all containers configured on the server, including all available resources.- Parameters:
name
- the name of the backup.workingDir
- a path used as the working directory for creating the backup contents and storing the final backup. If null, then the default location is used.- Returns:
- a
CompletionStage
that on completion returns thePath
to the backup file that will be created.
-
create
CompletionStage<Path> create(String name, Path workingDir, Map<String, BackupManager.Resources> params) Create a backup of the specified containers, including the resources defined in the providedBackupManager.Resources
object.- Parameters:
name
- the name of the backup.workingDir
- a path used as the working directory for creating the backup contents and storing the final * backup. If null, then the default location is used.params
- a map of container names and an associatedBackupManager.Resources
instance.- Returns:
- a
CompletionStage
that on completion returns thePath
to the backup file that will be created.
-
restore
Restore content from the provided backup file.- Parameters:
name
- a unique name to identify the restore processbackup
- a path to the backup file to be restored.- Returns:
- a
CompletionStage
that completes when all of the entries in the backup have been restored.
-
restore
Restore content from the provided backup file. The keyset of the providedMap
determines which containers are restored from the backup file. Similarly, theBackupManager.Resources
object determines whichBackupManager.Resources.Type
s are restored.- Parameters:
name
- a unique name to identify the restore request.backup
- a path to the backup file to be restored.- Returns:
- a
CompletionStage
that completes when all of the entries in the backup have been restored.
-
removeRestore
Remove the meta information associated with a restoration. When a restoration is not currently in progress, then aBackupManager.Status.COMPLETE
is returned. However, if a restore operation is currently in progress, then the removal is attempted once the restore has completed andBackupManager.Status.IN_PROGRESS
is returned. Finally,BackupManager.Status.NOT_FOUND
is returned if no restore exists with the specified name.- Parameters:
name
- a unique name to identify the restore request.- Returns:
- a
CompletionStage
that returns aBackupManager.Status
when complete to indicate what course of action was taken.
-
getRestoreStatus
Return the currentBackupManager.Status
of a Restore request.- Parameters:
name
- a unique name to identify the restore request.- Returns:
- the
BackupManager.Status
of the restore.
-
getRestoreNames
- Returns:
- the names of all restores.
-