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.Typeto the local filesystem, where it can then be packaged for distribution.voidA method to ensure that the resources requested in theBackupManager.Resourcesare valid and can be included in a backup.voidprepareAndValidateRestore(Properties properties) A method to ensure that the resources requested in theBackupManager.Resourcesare contained in the backup to be restored.Restores theBackupManager.Resources.Typecontent from the providedZipFileto the target container.voidwriteToManifest(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.Resourcesare valid and can be included in a backup. This method is called for allContainerResourceimplementations 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.Typeto the local filesystem, where it can then be packaged for distribution.Implementations of this method depend on content created by
prepareAndValidateBackup().- Returns:
- a
CompletionStagethat completes once the backup of thisBackupManager.Resources.Typehas finished.
-
writeToManifest
Writes the name of the individual resources that have been included in this backup. TheBackupManager.Resources.Typeassociated 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- thePropertiesinstance to add the key/value property.
-
prepareAndValidateRestore
A method to ensure that the resources requested in theBackupManager.Resourcesare contained in the backup to be restored. This method is called for allContainerResourceimplementations 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.Typecontent from the providedZipFileto the target container.- Parameters:
zip- theZipFileto restore content from.- Returns:
- a
CompletionStagethat completes once the restoration of thisBackupManager.Resources.Typehas finished.
-