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 Details

    • prepareAndValidateBackup

      void prepareAndValidateBackup() throws org.infinispan.commons.CacheException
      A method to ensure that the resources requested in the BackupManager.Resources are valid and can be included in a backup. This method is called for all ContainerResource implementations before the backup process begins in order to allow a backup to fail-fast before any data is processed.
      Throws:
      org.infinispan.commons.CacheException - if an invalid parameter is specified, e.g. a unknown resource name.
    • backup

      Writes the backup files for the BackupManager.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 this BackupManager.Resources.Type has finished.
    • writeToManifest

      void writeToManifest(Properties properties)
      Writes the name of the individual resources that have been included in this backup. The BackupManager.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 - the Properties instance to add the key/value property.
    • prepareAndValidateRestore

      void prepareAndValidateRestore(Properties properties)
      A method to ensure that the resources requested in the BackupManager.Resources are contained in the backup to be restored. This method is called for all ContainerResource implementations before the restore process begins in order to allow a restore to fail-fast before any state is restored to a container.
    • restore

      CompletionStage<Void> restore(ZipFile zip)
      Restores the BackupManager.Resources.Type content from the provided ZipFile to the target container.
      Parameters:
      zip - the ZipFile to restore content from.
      Returns:
      a CompletionStage that completes once the restoration of this BackupManager.Resources.Type has finished.