Package fr.gouv.vitam.functional.administration.core.backup

# Interface RestoreBackupService

All Known Implementing Classes:
  `RestoreBackupServiceImpl`

public interface RestoreBackupService
Service used to recover a Backup copy of the given Vitam collection.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Optional<String>`
  `getLatestSavedFileName(String strategy, String offerId, DataCategory type, FunctionalAdminCollections collection)`
  get the latest file name according to the name suffix.
  `Iterator<List<OfferLog>>`
  `getListing(String strategy, DataCategory category, Long offset, int limit, Order order)`
  Retrieve list of offer log defining objects to reconstruct from offer log
  `AccessionRegisterBackupModel`
  `loadData(String strategy, FunctionalAdminCollections collection, String filename, long offset)`
  Load data from storage
  `Optional<CollectionBackupModel>`
  `readLatestSavedFile(String strategy, String offerId, FunctionalAdminCollections collection)`
  Read the latest file using the name requested by getLatestSavedFileName.
  Be careful, this method use tenant that is requested from the VitamSession

- ## Method Details

  - ### getLatestSavedFileName

    Optional<String> getLatestSavedFileName(String strategy, String offerId, DataCategory type, FunctionalAdminCollections collection)
    get the latest file name according to the name suffix.
    Parameters:
      `strategy` - the storage strategy to be applied
      `offerId` - offer from the object should be readed
      `type` - the storage collection type.
      `collection` - the collection to be restored
    Returns:
      the last version.

  - ### readLatestSavedFile

    Optional<CollectionBackupModel> readLatestSavedFile(String strategy, String offerId, FunctionalAdminCollections collection)
    Read the latest file using the name requested by getLatestSavedFileName.
    Be careful, this method use tenant that is requested from the VitamSession
    Parameters:
      `strategy` - the storage strategy to be applied
      `collection` - the collection to be restored
    Returns:
      the backup copy.

  - ### getListing

    Iterator<List<OfferLog>> getListing(String strategy, DataCategory category, Long offset, int limit, Order order) throws StorageServerClientException, StorageNotFoundClientException
    Retrieve list of offer log defining objects to reconstruct from offer log
    Parameters:
      `strategy` - storage strategy
      `category` - collection
      `offset` - offset
      `limit` - limit
    Returns:
      list of offer log by bulk
    Throws:
      `VitamRuntimeException` - storage error
      `IllegalArgumentException` - input error
      `StorageServerClientException`
      `StorageNotFoundClientException`

  - ### loadData

    AccessionRegisterBackupModel loadData(String strategy, FunctionalAdminCollections collection, String filename, long offset)
    Load data from storage
    Parameters:
      `strategy` - storage strategy
      `collection` - collection
      `filename` - name of file to load
      `offset` - offset
    Returns:
      data
    Throws:
      `VitamRuntimeException` - storage error
      `IllegalArgumentException` - input error