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
ConstructorDescriptionBackupManagerImpl
(org.infinispan.util.logging.events.EventLogger eventLogger, 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.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.
-
Constructor Details
-
BackupManagerImpl
public BackupManagerImpl(org.infinispan.util.logging.events.EventLogger eventLogger, BlockingManager blockingManager, DefaultCacheManager cm, Path dataRoot)
-
-
Method Details
-
init
Description copied from interface:BackupManager
Performs initialisation of all resources required by the implementation before backup files can be created or restored.- Specified by:
init
in interfaceBackupManager
- Throws:
IOException
-
getBackupNames
- Specified by:
getBackupNames
in interfaceBackupManager
- Returns:
- the names of all backups.
-
getBackupStatus
Description copied from interface:BackupManager
Return the currentBackupManager.Status
of a Backup request.- Specified by:
getBackupStatus
in interfaceBackupManager
- Parameters:
name
- the name of the backup.- Returns:
- the
BackupManager.Status
of the backup.
-
getBackupLocation
Description copied from interface:BackupManager
Returns thePath
of a backup file if it is complete.- Specified by:
getBackupLocation
in interfaceBackupManager
- Parameters:
name
- the name of the backup.- Returns:
- the
Path
of the created backup file ifBackupManager.Status.COMPLETE
, otherwise null.
-
removeBackup
Description copied from interface:BackupManager
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.- Specified by:
removeBackup
in interfaceBackupManager
- 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
Description copied from interface:BackupManager
Create a backup of all containers configured on the server, including all available resources.- Specified by:
create
in 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
CompletionStage
that on completion returns thePath
to 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:BackupManager
Create a backup of the specified containers, including the resources defined in the providedBackupManager.Resources
object.- Specified by:
create
in 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.Resources
instance.- Returns:
- a
CompletionStage
that on completion returns thePath
to the backup file that will be created.
-
removeRestore
Description copied from interface:BackupManager
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.- Specified by:
removeRestore
in interfaceBackupManager
- 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
Description copied from interface:BackupManager
Return the currentBackupManager.Status
of a Restore request.- Specified by:
getRestoreStatus
in interfaceBackupManager
- Parameters:
name
- a unique name to identify the restore request.- Returns:
- the
BackupManager.Status
of the restore.
-
getRestoreNames
- Specified by:
getRestoreNames
in interfaceBackupManager
- Returns:
- the names of all restores.
-
restore
Description copied from interface:BackupManager
Restore content from the provided backup file.- Specified by:
restore
in interfaceBackupManager
- 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
public CompletionStage<Void> restore(String name, Path backup, Map<String, BackupManager.Resources> params) Description copied from interface:BackupManager
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.- Specified by:
restore
in interfaceBackupManager
- 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.
-