Class BackupManagerImpl
java.lang.Object
org.infinispan.server.core.backup.BackupManagerImpl
- All Implemented Interfaces:
BackupManager
- Since:
- 12.0
- Author:
- Ryan Emerson
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.infinispan.server.core.BackupManager
BackupManager.Resources, BackupManager.Status -
Constructor Summary
ConstructorsConstructorDescriptionBackupManagerImpl(BlockingManager blockingManager, DefaultCacheManager cm, Path dataRoot) -
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.
-
Constructor Details
-
BackupManagerImpl
-
-
Method Details
-
init
Description copied from interface:BackupManagerPerforms initialisation of all resources required by the implementation before backup files can be created or restored.- Specified by:
initin interfaceBackupManager- Throws:
IOException
-
getBackupNames
- Specified by:
getBackupNamesin interfaceBackupManager- Returns:
- the names of all backups.
-
getBackupStatus
Description copied from interface:BackupManagerReturn the currentBackupManager.Statusof a Backup request.- Specified by:
getBackupStatusin interfaceBackupManager- Parameters:
name- the name of the backup.- Returns:
- the
BackupManager.Statusof the backup.
-
getBackupLocation
Description copied from interface:BackupManagerReturns thePathof a backup file if it is complete.- Specified by:
getBackupLocationin interfaceBackupManager- Parameters:
name- the name of the backup.- Returns:
- the
Pathof the created backup file ifBackupManager.Status.COMPLETE, otherwise null.
-
removeBackup
Description copied from interface:BackupManagerRemove 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.- Specified by:
removeBackupin interfaceBackupManager- Parameters:
name- the name of the backup.- Returns:
- a
CompletionStagethat returns aBackupManager.Statuswhen complete to indicate what course of action was taken.
-
create
Description copied from interface:BackupManagerCreate a backup of all containers configured on the server, including all available resources.- Specified by:
createin interfaceBackupManager- 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
public CompletionStage<Path> create(String name, Path workingDir, Map<String, BackupManager.Resources> params) Description copied from interface:BackupManagerCreate a backup of the specified containers, including the resources defined in the providedBackupManager.Resourcesobject.- Specified by:
createin interfaceBackupManager- 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.Resourcesinstance.- Returns:
- a
CompletionStagethat on completion returns thePathto the backup file that will be created.
-
removeRestore
Description copied from interface:BackupManagerRemove 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.- Specified by:
removeRestorein interfaceBackupManager- 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
Description copied from interface:BackupManagerReturn the currentBackupManager.Statusof a Restore request.- Specified by:
getRestoreStatusin interfaceBackupManager- Parameters:
name- a unique name to identify the restore request.- Returns:
- the
BackupManager.Statusof the restore.
-
getRestoreNames
- Specified by:
getRestoreNamesin interfaceBackupManager- Returns:
- the names of all restores.
-
restore
Description copied from interface:BackupManagerRestore content from the provided backup file.- Specified by:
restorein interfaceBackupManager- 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
public CompletionStage<Void> restore(String name, Path backup, Map<String, BackupManager.Resources> params) Description copied from interface:BackupManagerRestore 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.- Specified by:
restorein interfaceBackupManager- 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.
-