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
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceAn interface to encapsulate the various arguments required by theBackupManagerin order to include/exclude resources from a backup/restore operation.static enumAn 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.Resourcesobject.getBackupLocation(String name) Returns thePathof a backup file if it is complete.getBackupStatus(String name) Return the currentBackupManager.Statusof a Backup request.getRestoreStatus(String name) Return the currentBackupManager.Statusof a Restore request.voidinit()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.Statusof a Backup request.- Parameters:
name- the name of the backup.- Returns:
- the
BackupManager.Statusof the backup.
-
getBackupLocation
Returns thePathof a backup file if it is complete.- Parameters:
name- the name of the backup.- Returns:
- the
Pathof 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.COMPLETEis returned. However, if a backup operation is currently in progress, then the removal is attempted once the backup has completed andBackupManager.Status.IN_PROGRESSis returned. Finally,BackupManager.Status.NOT_FOUNDis returned if no backup exists with the specified name.- Parameters:
name- the name of the backup.- Returns:
- a
CompletionStagethat returns aBackupManager.Statuswhen 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
CompletionStagethat on completion returns thePathto 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.Resourcesobject.- Parameters:
name- the name of the backup.params- a map of container names and an associatedBackupManager.Resourcesinstance.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
CompletionStagethat on completion returns thePathto 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
CompletionStagethat completes when all of the entries in the backup have been restored.
-
restore
Restore content from the provided backup file. The keyset of the providedMapdetermines which containers are restored from the backup file. Similarly, theBackupManager.Resourcesobject determines whichBackupManager.Resources.Types are restored.- Parameters:
name- a unique name to identify the restore request.backup- a path to the backup file to be restored.- Returns:
- a
CompletionStagethat 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.COMPLETEis returned. However, if a restore operation is currently in progress, then the removal is attempted once the restore has completed andBackupManager.Status.IN_PROGRESSis returned. Finally,BackupManager.Status.NOT_FOUNDis returned if no restore exists with the specified name.- Parameters:
name- a unique name to identify the restore request.- Returns:
- a
CompletionStagethat returns aBackupManager.Statuswhen complete to indicate what course of action was taken.
-
getRestoreStatus
Return the currentBackupManager.Statusof a Restore request.- Parameters:
name- a unique name to identify the restore request.- Returns:
- the
BackupManager.Statusof the restore.
-
getRestoreNames
- Returns:
- the names of all restores.
-