Interface ContainerResource
- All Known Implementing Classes:
CacheResource
,CounterResource
public interface ContainerResource
An interface that defines how a container resource is backed up and
restored by the
BackupManager
.- Since:
- 12.0
- Author:
- Ryan Emerson
-
Method Summary
Modifier and TypeMethodDescriptionbackup()
Writes the backup files for theBackupManager.Resources.Type
to the local filesystem, where it can then be packaged for distribution.void
A method to ensure that the resources requested in theBackupManager.Resources
are valid and can be included in a backup.void
prepareAndValidateRestore
(Properties properties) A method to ensure that the resources requested in theBackupManager.Resources
are contained in the backup to be restored.Restores theBackupManager.Resources.Type
content from the providedZipFile
to the target container.void
writeToManifest
(Properties properties) Writes the name of the individual resources that have been included in this backup.
-
Method Details
-
prepareAndValidateBackup
A method to ensure that the resources requested in theBackupManager.Resources
are valid and can be included in a backup. This method is called for allContainerResource
implementations before the backup process begins in order to allow a backup to fail-fast before any data is processed.- Throws:
CacheException
- if an invalid parameter is specified, e.g. a unknown resource name.
-
backup
CompletionStage<Void> backup()Writes the backup files for theBackupManager.Resources.Type
to the local filesystem, where it can then be packaged for distribution.Implementations of this method depend on content created by
prepareAndValidateBackup()
.- Returns:
- a
CompletionStage
that completes once the backup of thisBackupManager.Resources.Type
has finished.
-
writeToManifest
Writes the name of the individual resources that have been included in this backup. TheBackupManager.Resources.Type
associated with an implementation is the key, whilst the value is a csv of resource names.Implementations of this method depend on state created by
backup()
.- Parameters:
properties
- theProperties
instance to add the key/value property.
-
prepareAndValidateRestore
A method to ensure that the resources requested in theBackupManager.Resources
are contained in the backup to be restored. This method is called for allContainerResource
implementations before the restore process begins in order to allow a restore to fail-fast before any state is restored to a container. -
restore
Restores theBackupManager.Resources.Type
content from the providedZipFile
to the target container.- Parameters:
zip
- theZipFile
to restore content from.- Returns:
- a
CompletionStage
that completes once the restoration of thisBackupManager.Resources.Type
has finished.
-